[yt-svn] commit/yt: sskory: An even better job of making LoadHaloes load h5 files intelligently.
Bitbucket
commits-noreply at bitbucket.org
Wed Dec 7 13:38:34 PST 2011
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/changeset/65ad16bbff40/
changeset: 65ad16bbff40
branch: yt
user: sskory
date: 2011-12-07 17:50:59
summary: An even better job of making LoadHaloes load h5 files intelligently.
affected #: 1 file
diff -r 5220b10d9105af3cff9abe85bae5a983f26fc2a7 -r 65ad16bbff4027496e4322660f179986a9432f7b yt/analysis_modules/halo_finding/halo_objects.py
--- a/yt/analysis_modules/halo_finding/halo_objects.py
+++ b/yt/analysis_modules/halo_finding/halo_objects.py
@@ -32,6 +32,7 @@
import numpy as na
import random
import sys
+import os.path as path
from collections import defaultdict
from yt.funcs import *
@@ -1360,15 +1361,16 @@
# The halos are listed in order in the file.
lines = file("%s.txt" % self.basename)
locations = []
+ realpath = path.realpath("%s.txt" % self.basename)
for line in lines:
line = line.split()
# Prepend the hdf5 file names with the full path.
temp = []
for item in line[1:]:
- if item[0] == "/":
- temp.append(item)
- else:
- temp.append(self.pf.fullpath + '/' + item)
+ # This assumes that the .txt is in the same place as
+ # the h5 files, which is a good one I think.
+ item = item.split("/")
+ temp.append(path.join(path.dirname(realpath), item[-1]))
locations.append(temp)
lines.close()
return locations
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list