[yt-svn] commit/yt: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Thu Jun 14 10:43:23 PDT 2012
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/changeset/c2c63dc81624/
changeset: c2c63dc81624
branch: yt
user: samskillman
date: 2012-06-14 18:47:27
summary: If a simulation has both dtDataDump and CycleSkipDataDump, force it to use _find_outputs().
affected #: 1 file
diff -r 38a09b2207e912525f7b12dbe68adc7c9a74e193 -r c2c63dc81624504aa0f79e64949b10c1ccfa8c08 yt/frontends/enzo/simulation_handling.py
--- a/yt/frontends/enzo/simulation_handling.py
+++ b/yt/frontends/enzo/simulation_handling.py
@@ -401,10 +401,12 @@
if self.parameters['dtDataDump'] > 0 and \
self.parameters['CycleSkipDataDump'] > 0:
- raise AmbiguousOutputs(self.parameter_filename)
+ mylog.info("Simulation %s has both dtDataDump and CycleSkipDataDump set." % self.parameter_filename )
+ mylog.info(" Unable to calculate datasets. Attempting to search in the current directory")
+ self.all_time_outputs = self._find_outputs()
# Get all time or cycle outputs.
- if self.parameters['CycleSkipDataDump'] > 0:
+ elif self.parameters['CycleSkipDataDump'] > 0:
self._calculate_cycle_outputs()
else:
self._calculate_time_outputs()
@@ -518,12 +520,15 @@
"%s%s" % (dir_key, index),
"%s%s" % (output_key, index))
if os.path.exists(filename):
- pf = load(filename)
- if pf is not None:
- time_outputs.append({'filename': filename, 'time': pf.current_time})
- if pf.cosmological_simulation:
- time_outputs[-1]['redshift'] = pf.current_redshift
- del pf
+ try:
+ pf = load(filename)
+ if pf is not None:
+ time_outputs.append({'filename': filename, 'time': pf.current_time})
+ if pf.cosmological_simulation:
+ time_outputs[-1]['redshift'] = pf.current_redshift
+ del pf
+ except:
+ mylog.error('Failed to load %s' % filename)
mylog.info("Located %d time outputs." % len(time_outputs))
time_outputs.sort(key=lambda obj: obj['time'])
return time_outputs
https://bitbucket.org/yt_analysis/yt/changeset/1cb62c827289/
changeset: 1cb62c827289
branch: yt
user: samskillman
date: 2012-06-14 19:41:28
summary: explicitly catching the correct exception and del'ing the del
affected #: 1 file
diff -r c2c63dc81624504aa0f79e64949b10c1ccfa8c08 -r 1cb62c827289224f29cf3dfc1358c5c47bca6856 yt/frontends/enzo/simulation_handling.py
--- a/yt/frontends/enzo/simulation_handling.py
+++ b/yt/frontends/enzo/simulation_handling.py
@@ -526,9 +526,9 @@
time_outputs.append({'filename': filename, 'time': pf.current_time})
if pf.cosmological_simulation:
time_outputs[-1]['redshift'] = pf.current_redshift
- del pf
- except:
+ except YTOutputNotIdentified:
mylog.error('Failed to load %s' % filename)
+
mylog.info("Located %d time outputs." % len(time_outputs))
time_outputs.sort(key=lambda obj: obj['time'])
return time_outputs
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