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

Bitbucket commits-noreply at bitbucket.org
Sat Nov 17 04:17:12 PST 2012


3 new commits in yt:


https://bitbucket.org/yt_analysis/yt/changeset/8b9f0a2ec31a/
changeset:   8b9f0a2ec31a
branch:      yt
user:        jzuhone
date:        2012-11-17 13:15:41
summary:     A bug fix for when there is only one FLASH grid.
affected #:  2 files

diff -r c57187ca13b69862a02b80af7b5b3eb83698a4c6 -r 8b9f0a2ec31a3c1e56ffb25f79a9713688597624 setup.cfg
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,9 +1,3 @@
 [egg_info]
 #tag_build = .dev
 #tag_svn_revision = 1
-
-[nosetests]
-detailed-errors=1
-where=yt
-exclude=answer_testing
-with-xunit=1


diff -r c57187ca13b69862a02b80af7b5b3eb83698a4c6 -r 8b9f0a2ec31a3c1e56ffb25f79a9713688597624 yt/frontends/flash/data_structures.py
--- a/yt/frontends/flash/data_structures.py
+++ b/yt/frontends/flash/data_structures.py
@@ -126,8 +126,11 @@
         except KeyError:
             self.grid_particle_count[:] = 0.0
         self._particle_indices = np.zeros(self.num_grids + 1, dtype='int64')
-        np.add.accumulate(self.grid_particle_count.squeeze(),
-                          out=self._particle_indices[1:])
+        if self.num_grids > 1 :
+            np.add.accumulate(self.grid_particle_count.squeeze(),
+                              out=self._particle_indices[1:])
+        else :
+            self._particle_indices[1] = self.grid_particle_count.squeeze()
         # This will become redundant, as _prepare_grid will reset it to its
         # current value.  Note that FLASH uses 1-based indexing for refinement
         # levels, but we do not, so we reduce the level by 1.



https://bitbucket.org/yt_analysis/yt/changeset/cd2e4c940137/
changeset:   cd2e4c940137
branch:      yt
user:        jzuhone
date:        2012-11-17 13:16:07
summary:     Merging
affected #:  4 files

diff -r 8b9f0a2ec31a3c1e56ffb25f79a9713688597624 -r cd2e4c940137c56458d7a0f0ab2e8394207da288 yt/frontends/athena/data_structures.py
--- a/yt/frontends/athena/data_structures.py
+++ b/yt/frontends/athena/data_structures.py
@@ -331,6 +331,8 @@
             dimensionality = 2
         if grid['dimensions'][1] == 1 :
             dimensionality = 1
+        if dimensionality <= 2 : self.domain_dimensions[2] = 1.
+        if dimensionality == 1 : self.domain_dimensions[1] = 1.
         self.dimensionality = dimensionality
         self.current_time = grid["time"]
         self.unique_identifier = self._handle.__hash__()


diff -r 8b9f0a2ec31a3c1e56ffb25f79a9713688597624 -r cd2e4c940137c56458d7a0f0ab2e8394207da288 yt/frontends/flash/data_structures.py
--- a/yt/frontends/flash/data_structures.py
+++ b/yt/frontends/flash/data_structures.py
@@ -421,7 +421,11 @@
             nblockx = self.parameters["iprocs"]
             nblocky = self.parameters["jprocs"]
             nblockz = self.parameters["kprocs"]
-                        
+
+        # In case the user wasn't careful
+        if dimensionality <= 2 : nblockz = 1
+        if dimensionality == 1 : nblocky = 1
+
         self.dimensionality = dimensionality
         self.domain_dimensions = \
             np.array([nblockx*nxb,nblocky*nyb,nblockz*nzb])


diff -r 8b9f0a2ec31a3c1e56ffb25f79a9713688597624 -r cd2e4c940137c56458d7a0f0ab2e8394207da288 yt/frontends/flash/fields.py
--- a/yt/frontends/flash/fields.py
+++ b/yt/frontends/flash/fields.py
@@ -266,9 +266,9 @@
 def GetMagRescalingFactor(pf):
     if pf['unitsystem'].lower() == "cgs":
          factor = 1
-    if pf['unitsystem'].lower() == "si":
+    elif pf['unitsystem'].lower() == "si":
          factor = np.sqrt(4*np.pi/1e7)
-    if pf['unitsystem'].lower() == "none":
+    elif pf['unitsystem'].lower() == "none":
          factor = np.sqrt(4*np.pi)
     else:
         raise RuntimeError("Runtime parameter unitsystem with"


diff -r 8b9f0a2ec31a3c1e56ffb25f79a9713688597624 -r cd2e4c940137c56458d7a0f0ab2e8394207da288 yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -216,9 +216,9 @@
 
 def data_dir_load(pf_fn):
     path = ytcfg.get("yt", "test_data_dir")
+    if isinstance(pf_fn, StaticOutput): return pf_fn
     if not os.path.isdir(path):
         return False
-    if isinstance(pf_fn, StaticOutput): return pf_fn
     with temp_cwd(path):
         pf = load(pf_fn)
         pf.h



https://bitbucket.org/yt_analysis/yt/changeset/d491ba54ddbd/
changeset:   d491ba54ddbd
branch:      yt
user:        jzuhone
date:        2012-11-17 13:16:41
summary:     Merging
affected #:  2 files

diff -r cd2e4c940137c56458d7a0f0ab2e8394207da288 -r d491ba54ddbdf07b04e5733db2e1e6396162a11e yt/frontends/flash/fields.py
--- a/yt/frontends/flash/fields.py
+++ b/yt/frontends/flash/fields.py
@@ -271,7 +271,7 @@
     elif pf['unitsystem'].lower() == "none":
          factor = np.sqrt(4*np.pi)
     else:
-        raise RuntimeError("Runtime parameter unitsystem with"
+        raise RuntimeError("Runtime parameter unitsystem with "
                            "value %s is unrecognized" % pf['unitsystem'])
     return factor
 


diff -r cd2e4c940137c56458d7a0f0ab2e8394207da288 -r d491ba54ddbdf07b04e5733db2e1e6396162a11e yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -29,6 +29,7 @@
 import contextlib
 import urllib2
 import cPickle
+import sys
 
 from nose.plugins import Plugin
 from yt.testing import *
@@ -53,16 +54,14 @@
 
     def options(self, parser, env=os.environ):
         super(AnswerTesting, self).options(parser, env=env)
-        parser.add_option("--answer-compare", dest="compare_name",
-            default=_latest, help="The name against which we will compare")
+        parser.add_option("--answer-compare-name", dest="compare_name", metavar='str',
+            default=_latest, help="The name of tests against which we will compare")
         parser.add_option("--answer-big-data", dest="big_data",
             default=False, help="Should we run against big data, too?",
             action="store_true")
-        parser.add_option("--answer-name", dest="this_name",
+        parser.add_option("--answer-store-name", dest="store_name", metavar='str',
             default=None,
             help="The name we'll call this set of tests")
-        parser.add_option("--answer-store", dest="store_results",
-            default=False, action="store_true")
         parser.add_option("--local-store", dest="store_local_results",
             default=False, action="store_true", help="Store/Load local results?")
 
@@ -83,8 +82,14 @@
         if not self.enabled:
             return
         disable_stream_logging()
-        if options.this_name is None: 
-            options.this_name = self.my_version
+        if options.store_name is not None:
+            self.store_results = True
+        # If the user sets the storage_name, then it means they are storing and
+        # not comparing, even if they set the compare_name (since it is set by default)
+            options.compare_name = None
+        else: 
+            self.store_results = False
+            options.store_name = self.my_version
         from yt.config import ytcfg
         ytcfg["yt","__withintesting"] = "True"
         AnswerTestingTest.result_storage = \
@@ -93,7 +98,7 @@
             options.compare_name = None
         elif options.compare_name == "latest":
             options.compare_name = _latest
-
+            
         # Local/Cloud storage 
         if options.store_local_results:
             storage_class = AnswerTestLocalStorage
@@ -102,22 +107,21 @@
                 options.compare_name = "%s/%s/%s" % \
                     (os.path.realpath(options.output_dir), options.compare_name, 
                      options.compare_name)
-            if options.this_name is not None:
+            if options.store_name is not None:
                 name_dir_path = "%s/%s" % \
                     (os.path.realpath(options.output_dir), 
-                    options.this_name)
+                    options.store_name)
                 if not os.path.isdir(name_dir_path):
                     os.mkdir(name_dir_path)
-                options.this_name= "%s/%s" % \
-                        (name_dir_path, options.this_name)
+                options.store_name= "%s/%s" % \
+                        (name_dir_path, options.store_name)
         else:
             storage_class = AnswerTestCloudStorage
 
         # Initialize answer/reference storage
         AnswerTestingTest.reference_storage = self.storage = \
-                storage_class(options.compare_name, options.this_name)
+                storage_class(options.compare_name, options.store_name)
 
-        self.store_results = options.store_results
         self.store_local_results = options.store_local_results
         global run_big_data
         run_big_data = options.big_data

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