[yt-svn] commit/yt: jzuhone: Merged in ngoldbaum/yt (pull request #2180)

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


1 new commit in yt:

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/b5e065d6/attachment.html>


More information about the yt-svn mailing list