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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed May 18 11:07:04 PDT 2016


4 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/da50456d423b/
Changeset:   da50456d423b
Branch:      yt
User:        ngoldbaum
Date:        2016-05-17 16:33:05+00:00
Summary:     remove 'io' from enzo particle types for active particle datasets

This fixes the 'all' particle union, which wasn't being created properly because
there aren't any 'io' particles in active particle datasets.
Affected #:  2 files

diff -r 06b1bf872faa352183a5f8ec91d72937b9c43523 -r da50456d423bf0f34561b93291f98793536a0c6d yt/frontends/enzo/data_structures.py
--- a/yt/frontends/enzo/data_structures.py
+++ b/yt/frontends/enzo/data_structures.py
@@ -444,6 +444,14 @@
             if "AppendActiveParticleType" in self.dataset.parameters:
                 ap_fields = self._detect_active_particle_fields()
                 field_list = list(set(field_list).union(ap_fields))
+                if not any(f[0] == 'io' for f in field_list):
+                    ptypes_raw = list(self.dataset.particle_types_raw)
+                    ptypes_raw.remove('io')
+                    self.dataset.particle_types_raw = tuple(ptypes_raw)
+
+                    ptypes = list(self.dataset.particle_types)
+                    ptypes.remove('io')
+                    self.dataset.particle_types = tuple(ptypes)
             ptypes = self.dataset.particle_types
             ptypes_raw = self.dataset.particle_types_raw
         else:

diff -r 06b1bf872faa352183a5f8ec91d72937b9c43523 -r da50456d423bf0f34561b93291f98793536a0c6d yt/frontends/enzo/tests/test_outputs.py
--- a/yt/frontends/enzo/tests/test_outputs.py
+++ b/yt/frontends/enzo/tests/test_outputs.py
@@ -126,6 +126,8 @@
 def test_active_particle_datasets():
     two_sph = data_dir_load(two_sphere_test)
     assert 'AccretingParticle' in two_sph.particle_types_raw
+    assert 'io' not in two_sph.particle_types_raw
+    assert 'all' in two_sph.particle_types
     assert_equal(len(two_sph.particle_unions), 0)
     pfields = ['GridID', 'creation_time', 'dynamical_time',
                'identifier', 'level', 'metallicity', 'particle_mass']


https://bitbucket.org/yt_analysis/yt/commits/4e887197254e/
Changeset:   4e887197254e
Branch:      yt
User:        ngoldbaum
Date:        2016-05-17 19:23:19+00:00
Summary:     Fix test for number of active particle unions
Affected #:  1 file

diff -r da50456d423bf0f34561b93291f98793536a0c6d -r 4e887197254e7d1a7ef1383e2b042fe6b74fbff5 yt/frontends/enzo/tests/test_outputs.py
--- a/yt/frontends/enzo/tests/test_outputs.py
+++ b/yt/frontends/enzo/tests/test_outputs.py
@@ -128,7 +128,7 @@
     assert 'AccretingParticle' in two_sph.particle_types_raw
     assert 'io' not in two_sph.particle_types_raw
     assert 'all' in two_sph.particle_types
-    assert_equal(len(two_sph.particle_unions), 0)
+    assert_equal(len(two_sph.particle_unions), 1)
     pfields = ['GridID', 'creation_time', 'dynamical_time',
                'identifier', 'level', 'metallicity', 'particle_mass']
     pfields += ['particle_position_%s' % d for d in 'xyz']


https://bitbucket.org/yt_analysis/yt/commits/e50272bb2eb1/
Changeset:   e50272bb2eb1
Branch:      yt
User:        ngoldbaum
Date:        2016-05-17 20:55:12+00:00
Summary:     Only remove the io ptype if it is in the ptypes list
Affected #:  1 file

diff -r 4e887197254e7d1a7ef1383e2b042fe6b74fbff5 -r e50272bb2eb18e3ea5a6db4dcf6d24c58afddce1 yt/frontends/enzo/data_structures.py
--- a/yt/frontends/enzo/data_structures.py
+++ b/yt/frontends/enzo/data_structures.py
@@ -445,13 +445,15 @@
                 ap_fields = self._detect_active_particle_fields()
                 field_list = list(set(field_list).union(ap_fields))
                 if not any(f[0] == 'io' for f in field_list):
-                    ptypes_raw = list(self.dataset.particle_types_raw)
-                    ptypes_raw.remove('io')
-                    self.dataset.particle_types_raw = tuple(ptypes_raw)
+                    if 'io' in self.dataset.particle_types_raw:
+                        ptypes_raw = list(self.dataset.particle_types_raw)
+                        ptypes_raw.remove('io')
+                        self.dataset.particle_types_raw = tuple(ptypes_raw)
 
-                    ptypes = list(self.dataset.particle_types)
-                    ptypes.remove('io')
-                    self.dataset.particle_types = tuple(ptypes)
+                    if 'io' in self.dataset.particle_types:
+                        ptypes = list(self.dataset.particle_types)
+                        ptypes.remove('io')
+                        self.dataset.particle_types = tuple(ptypes)
             ptypes = self.dataset.particle_types
             ptypes_raw = self.dataset.particle_types_raw
         else:


https://bitbucket.org/yt_analysis/yt/commits/5e29cd4d7853/
Changeset:   5e29cd4d7853
Branch:      yt
User:        jzuhone
Date:        2016-05-18 18:06:56+00:00
Summary:     Merged in ngoldbaum/yt (pull request #2180)

[bugfix] remove 'io' from enzo particle types for active particle datasets
Affected #:  2 files

diff -r 513de336ea4bb226c8b8e32c893449b68d2af45b -r 5e29cd4d785390ca22dca3124da7f7b7f9fc5f2a yt/frontends/enzo/data_structures.py
--- a/yt/frontends/enzo/data_structures.py
+++ b/yt/frontends/enzo/data_structures.py
@@ -444,6 +444,16 @@
             if "AppendActiveParticleType" in self.dataset.parameters:
                 ap_fields = self._detect_active_particle_fields()
                 field_list = list(set(field_list).union(ap_fields))
+                if not any(f[0] == 'io' for f in field_list):
+                    if 'io' in self.dataset.particle_types_raw:
+                        ptypes_raw = list(self.dataset.particle_types_raw)
+                        ptypes_raw.remove('io')
+                        self.dataset.particle_types_raw = tuple(ptypes_raw)
+
+                    if 'io' in self.dataset.particle_types:
+                        ptypes = list(self.dataset.particle_types)
+                        ptypes.remove('io')
+                        self.dataset.particle_types = tuple(ptypes)
             ptypes = self.dataset.particle_types
             ptypes_raw = self.dataset.particle_types_raw
         else:

diff -r 513de336ea4bb226c8b8e32c893449b68d2af45b -r 5e29cd4d785390ca22dca3124da7f7b7f9fc5f2a yt/frontends/enzo/tests/test_outputs.py
--- a/yt/frontends/enzo/tests/test_outputs.py
+++ b/yt/frontends/enzo/tests/test_outputs.py
@@ -126,7 +126,9 @@
 def test_active_particle_datasets():
     two_sph = data_dir_load(two_sphere_test)
     assert 'AccretingParticle' in two_sph.particle_types_raw
-    assert_equal(len(two_sph.particle_unions), 0)
+    assert 'io' not in two_sph.particle_types_raw
+    assert 'all' in two_sph.particle_types
+    assert_equal(len(two_sph.particle_unions), 1)
     pfields = ['GridID', 'creation_time', 'dynamical_time',
                'identifier', 'level', 'metallicity', 'particle_mass']
     pfields += ['particle_position_%s' % d for d in 'xyz']

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-svn-spacepope.org/attachments/20160518/5efd0624/attachment-0002.htm>


More information about the yt-svn mailing list