[yt-svn] commit/yt: 5 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Apr 12 10:19:51 PDT 2013


5 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/940c7f15440c/
Changeset:   940c7f15440c
Branch:      yt
User:        samskillman
Date:        2013-04-02 20:00:51
Summary:     Implementing data storage for athena datasets, and fixing a bug from h5py not
liking to save a string:

https://github.com/h5py/h5py/issues/63
Affected #:  2 files

diff -r 4c9a9cd7eac8541bc10a747fb90ad2fdf200761a -r 940c7f15440c12c15042c43fb2667702e019672d yt/data_objects/hierarchy.py
--- a/yt/data_objects/hierarchy.py
+++ b/yt/data_objects/hierarchy.py
@@ -317,7 +317,7 @@
         under the name *name* on the node /Objects.
         """
         s = cPickle.dumps(obj, protocol=-1)
-        self.save_data(s, "/Objects", name, force = True)
+        self.save_data(np.array(s), "/Objects", name, force = True)
 
     def load_object(self, name):
         """

diff -r 4c9a9cd7eac8541bc10a747fb90ad2fdf200761a -r 940c7f15440c12c15042c43fb2667702e019672d yt/frontends/athena/data_structures.py
--- a/yt/frontends/athena/data_structures.py
+++ b/yt/frontends/athena/data_structures.py
@@ -53,7 +53,7 @@
 class AthenaGrid(AMRGridPatch):
     _id_offset = 0
     def __init__(self, id, hierarchy, level, start, dimensions):
-        df = hierarchy.storage_filename
+        df = hierarchy.parameter_file.filename[4:-4]
         if 'id0' not in hierarchy.parameter_file.filename:
             gname = hierarchy.parameter_file.filename
         else:
@@ -119,12 +119,13 @@
 
     grid = AthenaGrid
     _data_style='athena'
+    _data_file = None
     
     def __init__(self, pf, data_style='athena'):
         self.parameter_file = weakref.proxy(pf)
+        self.directory = os.path.dirname(self.parameter_file.filename)
         self.data_style = data_style
         # for now, the hierarchy file is the parameter file!
-        self.storage_filename = self.parameter_file.storage_filename
         self.hierarchy_filename = self.parameter_file.filename
         #self.directory = os.path.dirname(self.hierarchy_filename)
         self._fhandle = file(self.hierarchy_filename,'rb')
@@ -132,9 +133,6 @@
 
         self._fhandle.close()
 
-    def _initialize_data_storage(self):
-        pass
-
     def _detect_fields(self):
         field_map = {}
         f = open(self.hierarchy_filename,'rb')
@@ -337,11 +335,11 @@
     _data_style = "athena"
 
     def __init__(self, filename, data_style='athena',
-                 storage_filename = None, parameters = {}):
+                 storage_filename=None, parameters={}):
         self.specified_parameters = parameters
         StaticOutput.__init__(self, filename, data_style)
         self.filename = filename
-        self.storage_filename = filename[4:-4]
+        self.storage_filename = storage_filename 
         
         # Unfortunately we now have to mandate that the hierarchy gets 
         # instantiated so that we can make sure we have the correct left 


https://bitbucket.org/yt_analysis/yt/commits/bb1c7ac50b87/
Changeset:   bb1c7ac50b87
Branch:      yt
User:        samskillman
Date:        2013-04-02 21:13:21
Summary:     Explicitly making the order of the np array 'c'.
Affected #:  1 file

diff -r 940c7f15440c12c15042c43fb2667702e019672d -r bb1c7ac50b875e82b79396abde25ef3a199d06c8 yt/data_objects/hierarchy.py
--- a/yt/data_objects/hierarchy.py
+++ b/yt/data_objects/hierarchy.py
@@ -317,7 +317,7 @@
         under the name *name* on the node /Objects.
         """
         s = cPickle.dumps(obj, protocol=-1)
-        self.save_data(np.array(s), "/Objects", name, force = True)
+        self.save_data(np.array(s, order='c'), "/Objects", name, force = True)
 
     def load_object(self, name):
         """


https://bitbucket.org/yt_analysis/yt/commits/8a02b74fec3d/
Changeset:   8a02b74fec3d
Branch:      yt
User:        samskillman
Date:        2013-04-02 23:09:41
Summary:     Need a different hash to uniquely identify athena datadumps.  This is one way.
Affected #:  1 file

diff -r bb1c7ac50b875e82b79396abde25ef3a199d06c8 -r 8a02b74fec3d86a0056f84393b769deb63b05c6b yt/frontends/athena/data_structures.py
--- a/yt/frontends/athena/data_structures.py
+++ b/yt/frontends/athena/data_structures.py
@@ -400,7 +400,7 @@
         if dimensionality == 1 : self.domain_dimensions[1] = np.int32(1)
         self.dimensionality = dimensionality
         self.current_time = grid["time"]
-        self.unique_identifier = self._handle.__hash__()
+        self.unique_identifier = self.parameter_filename.__hash__()
         self.cosmological_simulation = False
         self.num_ghost_zones = 0
         self.field_ordering = 'fortran'


https://bitbucket.org/yt_analysis/yt/commits/6ab1db6b056e/
Changeset:   6ab1db6b056e
Branch:      yt
User:        samskillman
Date:        2013-04-12 19:07:37
Summary:     Fixing up Athena data storage to not be in the id0/ directory *unless* you only
load up a single cpu file.  This requires setting the default path to check for
storage as using the directory '.' since if the initialize_data_storage can't
find the storage_filename file, it would end up looking in '', which returns
False for os.access('',os.W_OK).  I think it is okay to always set this to '.'
if '' is returned from dirname.  This also forces the save_object to cast the
pickle as 'c'. which is a 'char' dtype.
Affected #:  2 files

diff -r 8a02b74fec3d86a0056f84393b769deb63b05c6b -r 6ab1db6b056ed117fc4864a6453b7402a5154fc1 yt/data_objects/hierarchy.py
--- a/yt/data_objects/hierarchy.py
+++ b/yt/data_objects/hierarchy.py
@@ -236,6 +236,8 @@
                 fn = os.path.join(self.directory,
                         "%s.yt" % self.parameter_file.basename)
         dir_to_check = os.path.dirname(fn)
+        if dir_to_check == '':
+            dir_to_check = '.'
         # We have four options:
         #    Writeable, does not exist      : create, open as append
         #    Writeable, does exist          : open as append
@@ -317,7 +319,7 @@
         under the name *name* on the node /Objects.
         """
         s = cPickle.dumps(obj, protocol=-1)
-        self.save_data(np.array(s, order='c'), "/Objects", name, force = True)
+        self.save_data(np.array(s, dtype='c'), "/Objects", name, force = True)
 
     def load_object(self, name):
         """

diff -r 8a02b74fec3d86a0056f84393b769deb63b05c6b -r 6ab1db6b056ed117fc4864a6453b7402a5154fc1 yt/frontends/athena/data_structures.py
--- a/yt/frontends/athena/data_structures.py
+++ b/yt/frontends/athena/data_structures.py
@@ -339,8 +339,10 @@
         self.specified_parameters = parameters
         StaticOutput.__init__(self, filename, data_style)
         self.filename = filename
-        self.storage_filename = storage_filename 
-        
+        if storage_filename is None:
+            storage_filename = '%s.yt' % filename.split('/')[-1]
+        self.storage_filename = storage_filename
+
         # Unfortunately we now have to mandate that the hierarchy gets 
         # instantiated so that we can make sure we have the correct left 
         # and right domain edges.


https://bitbucket.org/yt_analysis/yt/commits/3708abcb5084/
Changeset:   3708abcb5084
Branch:      yt
User:        MatthewTurk
Date:        2013-04-12 19:19:45
Summary:     Merged in samskillman/yt (pull request #474)

Implementing data storage for athena datasets, and fixing a bug from h5py not
Affected #:  2 files
Diff not available.

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