[yt-svn] commit/yt: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Fri Dec 2 04:32:47 PST 2011
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/changeset/c7dc277ad3e5/
changeset: c7dc277ad3e5
branch: yt
user: MatthewTurk
date: 2011-12-02 13:32:01
summary: We should always be checking if a parameter file exists in the _pf_store, even
if "serialize" is set to False. Not checking is an unwanted sideeffect.
Thanks to Elizabeth Tasker for this.
affected #: 1 file
diff -r c1a446be3a7a7d1fca1098ada8890e6e07f1458a -r c7dc277ad3e5f8e99074fe7c2d8c5954e17fc3a0 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -91,11 +91,10 @@
# Because we need an instantiated class to check the pf's existence in
# the cache, we move that check to here from __new__. This avoids
# double-instantiation.
- if ytcfg.getboolean('yt', 'serialize'):
- try:
- _pf_store.check_pf(self)
- except NoParameterShelf:
- pass
+ try:
+ _pf_store.check_pf(self)
+ except NoParameterShelf:
+ pass
self.print_key_parameters()
self.create_field_info()
https://bitbucket.org/yt_analysis/yt/changeset/9a034ddb95e8/
changeset: 9a034ddb95e8
branch: yt
user: MatthewTurk
date: 2011-12-02 13:32:31
summary: Merge
affected #: 2 files
diff -r c7dc277ad3e5f8e99074fe7c2d8c5954e17fc3a0 -r 9a034ddb95e84c554e79ba775252e5dce51bc3b8 yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py
+++ b/yt/data_objects/data_containers.py
@@ -78,11 +78,11 @@
and ensures that after the function is called, the field_parameters will
be returned to normal.
"""
- def save_state(self, grid, field=None):
+ def save_state(self, grid, field=None, *args, **kwargs):
old_params = grid.field_parameters
old_keys = grid.field_data.keys()
grid.field_parameters = self.field_parameters
- tr = func(self, grid, field)
+ tr = func(self, grid, field, *args, **kwargs)
grid.field_parameters = old_params
grid.field_data = YTFieldData( [(k, grid.field_data[k]) for k in old_keys] )
return tr
diff -r c7dc277ad3e5f8e99074fe7c2d8c5954e17fc3a0 -r 9a034ddb95e84c554e79ba775252e5dce51bc3b8 yt/frontends/enzo/data_structures.py
--- a/yt/frontends/enzo/data_structures.py
+++ b/yt/frontends/enzo/data_structures.py
@@ -575,24 +575,24 @@
reverse_tree = self.enzo.hierarchy_information["GridParentIDs"].ravel().tolist()
# Initial setup:
mylog.debug("Reconstructing parent-child relationships")
- self.grids = []
+ grids = []
# We enumerate, so it's 0-indexed id and 1-indexed pid
self.filenames = ["-1"] * self.num_grids
for id,pid in enumerate(reverse_tree):
- self.grids.append(self.grid(id+1, self))
- self.grids[-1].Level = self.grid_levels[id, 0]
+ grids.append(self.grid(id+1, self))
+ grids[-1].Level = self.grid_levels[id, 0]
if pid > 0:
- self.grids[-1]._parent_id = pid
- self.grids[pid-1]._children_ids.append(self.grids[-1].id)
+ grids[-1]._parent_id = pid
+ grids[pid-1]._children_ids.append(grids[-1].id)
self.max_level = self.grid_levels.max()
mylog.debug("Preparing grids")
self.grids = na.empty(len(grids), dtype='object')
- for i, grid in enumerate(self.grids):
+ for i, grid in enumerate(grids):
if (i%1e4) == 0: mylog.debug("Prepared % 7i / % 7i grids", i, self.num_grids)
grid.filename = None
grid._prepare_grid()
grid.proc_num = self.grid_procs[i,0]
- self.grids[gi] = grid
+ self.grids[i] = grid
mylog.debug("Prepared")
def _initialize_grid_arrays(self):
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