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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Jul 21 14:55:56 PDT 2014


6 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/e93ac6c71c43/
Changeset:   e93ac6c71c43
Branch:      yt-3.0
User:        chummels
Date:        2014-07-21 22:59:29
Summary:     Adding fix to the io_handler for when a chunk lacks particles in trying to make a particle union.
Affected #:  1 file

diff -r 603f8fbde5e92daf218f282bd4498e228aaab437 -r e93ac6c71c43a15f518e299c8b9a0469e10a71b2 yt/utilities/io_handler.py
--- a/yt/utilities/io_handler.py
+++ b/yt/utilities/io_handler.py
@@ -154,9 +154,9 @@
         for field in fields:
             if field[0] in unions:
                 for pt in unions[field[0]]:
-                    fsize[field] += psize[pt]
+                    fsize[field] += psize.get(pt, 0)
             else:
-                fsize[field] += psize[field[0]]
+                fsize[field] += psize.get(field[0], 0)
         for field in fields:
             if field[1] in self._vector_fields:
                 shape = (fsize[field], 3)


https://bitbucket.org/yt_analysis/yt/commits/cf03f7715bb3/
Changeset:   cf03f7715bb3
Branch:      yt-3.0
User:        chummels
Date:        2014-07-21 23:10:11
Summary:     Adding particle filter deposition test.
Affected #:  1 file

diff -r e93ac6c71c43a15f518e299c8b9a0469e10a71b2 -r cf03f7715bb33930d617f20272941dc844f3ab90 yt/utilities/tests/test_particle_filter.py
--- /dev/null
+++ b/yt/utilities/tests/test_particle_filter.py
@@ -0,0 +1,30 @@
+import numpy as np
+import yt
+from yt.mods import *
+from yt.testing import *
+from yt.utilities.particle_generator import *
+from yt.frontends.stream.api import load_uniform_grid, refine_amr
+import yt.utilities.initial_conditions as ic
+import yt.utilities.flagging_methods as fm
+from IPython import embed
+from yt.units.yt_array import uconcatenate
+from yt.data_objects.particle_filters import add_particle_filter
+
+def setup() :
+    pass
+
+# Stars function for stars particle filter
+# Define particle filter to filter stars younger than 100 Myr
+def Stars(pfilter, data):
+    filter = (data.ds.current_time - data["all", "creation_time"]).in_units('Myr') > 0
+    return filter
+
+# Simple test to create a particle filter, then access the deposition field 
+# (was a problem in previous versions on this dataset because there are chunks 
+#  with no stars in them).
+def test_particle_filter() :
+    add_particle_filter("stars", function=Stars, filtered_type='all', requires=["creation_time"])
+    ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
+    ds.add_particle_filter('stars')
+    ad = ds.all_data()
+    print ad['deposit', 'stars_cic']


https://bitbucket.org/yt_analysis/yt/commits/8e1e17cc1fe4/
Changeset:   8e1e17cc1fe4
Branch:      yt-3.0
User:        chummels
Date:        2014-07-21 23:21:11
Summary:     removing needless imports.
Affected #:  1 file

diff -r cf03f7715bb33930d617f20272941dc844f3ab90 -r 8e1e17cc1fe42dac9cfbc94bdbda061cbfc74785 yt/utilities/tests/test_particle_filter.py
--- a/yt/utilities/tests/test_particle_filter.py
+++ b/yt/utilities/tests/test_particle_filter.py
@@ -1,13 +1,5 @@
-import numpy as np
 import yt
-from yt.mods import *
 from yt.testing import *
-from yt.utilities.particle_generator import *
-from yt.frontends.stream.api import load_uniform_grid, refine_amr
-import yt.utilities.initial_conditions as ic
-import yt.utilities.flagging_methods as fm
-from IPython import embed
-from yt.units.yt_array import uconcatenate
 from yt.data_objects.particle_filters import add_particle_filter
 
 def setup() :


https://bitbucket.org/yt_analysis/yt/commits/0cfe4ebf9095/
Changeset:   0cfe4ebf9095
Branch:      yt-3.0
User:        chummels
Date:        2014-07-21 23:31:31
Summary:     Updating to assure user has appropriate dataset for test.
Affected #:  2 files

diff -r 8e1e17cc1fe42dac9cfbc94bdbda061cbfc74785 -r 0cfe4ebf9095e8db8beb64b388666be1dfa98e31 yt/utilities/tests/test_particle_filter.py
--- a/yt/utilities/tests/test_particle_filter.py
+++ /dev/null
@@ -1,22 +0,0 @@
-import yt
-from yt.testing import *
-from yt.data_objects.particle_filters import add_particle_filter
-
-def setup() :
-    pass
-
-# Stars function for stars particle filter
-# Define particle filter to filter stars younger than 100 Myr
-def Stars(pfilter, data):
-    filter = (data.ds.current_time - data["all", "creation_time"]).in_units('Myr') > 0
-    return filter
-
-# Simple test to create a particle filter, then access the deposition field 
-# (was a problem in previous versions on this dataset because there are chunks 
-#  with no stars in them).
-def test_particle_filter() :
-    add_particle_filter("stars", function=Stars, filtered_type='all', requires=["creation_time"])
-    ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
-    ds.add_particle_filter('stars')
-    ad = ds.all_data()
-    print ad['deposit', 'stars_cic']

diff -r 8e1e17cc1fe42dac9cfbc94bdbda061cbfc74785 -r 0cfe4ebf9095e8db8beb64b388666be1dfa98e31 yt/utilities/tests/test_particle_union.py
--- /dev/null
+++ b/yt/utilities/tests/test_particle_union.py
@@ -0,0 +1,27 @@
+import yt
+from yt.testing import *
+from yt.data_objects.particle_filters import add_particle_filter
+from yt.utilities.answer_testing.framework import requires_ds
+
+iso_galaxy = 'IsolatedGalaxy/galaxy0030/galaxy0030'
+
+ at requires_ds(iso_galaxy)
+def setup():
+    pass
+
+# Stars function for stars particle filter
+# Define particle filter to filter stars younger than 100 Myr
+def Stars(pfilter, data):
+    filter = (data.ds.current_time - data["all", "creation_time"]).in_units('Myr') > 0
+    return filter
+
+# Simple test to create a particle filter, then access the deposition field 
+# (was a problem in previous versions on this dataset because there are chunks 
+#  with no stars in them).
+ at requires_ds(iso_galaxy)
+def test_particle_filter() :
+    add_particle_filter("stars", function=Stars, filtered_type='all', requires=["creation_time"])
+    ds = yt.load(iso_galaxy)
+    ds.add_particle_filter('stars')
+    ad = ds.all_data()
+    print ad['deposit', 'stars_cic']


https://bitbucket.org/yt_analysis/yt/commits/e3f2fc2774d6/
Changeset:   e3f2fc2774d6
Branch:      yt-3.0
User:        chummels
Date:        2014-07-21 23:38:23
Summary:     removing unnecessary line.
Affected #:  1 file

diff -r 0cfe4ebf9095e8db8beb64b388666be1dfa98e31 -r e3f2fc2774d6bd6cd89dae6bf420baac60cf02ae yt/utilities/tests/test_particle_union.py
--- a/yt/utilities/tests/test_particle_union.py
+++ b/yt/utilities/tests/test_particle_union.py
@@ -5,7 +5,6 @@
 
 iso_galaxy = 'IsolatedGalaxy/galaxy0030/galaxy0030'
 
- at requires_ds(iso_galaxy)
 def setup():
     pass
 
@@ -18,6 +17,7 @@
 # Simple test to create a particle filter, then access the deposition field 
 # (was a problem in previous versions on this dataset because there are chunks 
 #  with no stars in them).
+
 @requires_ds(iso_galaxy)
 def test_particle_filter() :
     add_particle_filter("stars", function=Stars, filtered_type='all', requires=["creation_time"])


https://bitbucket.org/yt_analysis/yt/commits/f7fca80f28c4/
Changeset:   f7fca80f28c4
Branch:      yt-3.0
User:        chummels
Date:        2014-07-21 23:42:19
Summary:     Cleaning test.
Affected #:  1 file

diff -r e3f2fc2774d6bd6cd89dae6bf420baac60cf02ae -r f7fca80f28c43a012d73e4f1cad78ca403cdccd5 yt/utilities/tests/test_particle_union.py
--- a/yt/utilities/tests/test_particle_union.py
+++ b/yt/utilities/tests/test_particle_union.py
@@ -3,11 +3,9 @@
 from yt.data_objects.particle_filters import add_particle_filter
 from yt.utilities.answer_testing.framework import requires_ds
 
+# Dataset required for this test
 iso_galaxy = 'IsolatedGalaxy/galaxy0030/galaxy0030'
 
-def setup():
-    pass
-
 # Stars function for stars particle filter
 # Define particle filter to filter stars younger than 100 Myr
 def Stars(pfilter, 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