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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sat Jul 16 15:50:11 PDT 2016


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/10e032b52649/
Changeset:   10e032b52649
Branch:      yt
User:        langmm
Date:        2016-07-16 17:15:07+00:00
Summary:     Added Exception to AMRKDTree in the case of particle of oct-based data (Issue #1215)
Affected #:  1 file

diff -r b58837b96e9d93e200ec564f11db913ec4c515e0 -r 10e032b526497b00f99c44f2bc6f57b428e46a7f yt/utilities/amr_kdtree/amr_kdtree.py
--- a/yt/utilities/amr_kdtree/amr_kdtree.py
+++ b/yt/utilities/amr_kdtree/amr_kdtree.py
@@ -28,6 +28,7 @@
     ParallelAnalysisInterface
 from yt.utilities.lib.grid_traversal import PartitionedGrid
 from yt.utilities.math_utils import periodic_position
+from yt.geometry.grid_geometry_handler import GridIndex
 
 steps = np.array([[-1, -1, -1], [-1, -1,  0], [-1, -1,  1],
                   [-1,  0, -1], [-1,  0,  0], [-1,  0,  1],
@@ -137,6 +138,11 @@
 
 
 class AMRKDTree(ParallelAnalysisInterface):
+    r"""A KDTree for AMR data. 
+
+    Not applicable to particle or octree-based datasets.
+
+    """
 
     fields = None
     log_fields = None
@@ -145,6 +151,9 @@
     def __init__(self, ds, min_level=None, max_level=None,
                  data_source=None):
 
+        if not issubclass(ds.index.__class__, GridIndex):
+            raise RuntimeError("AMRKDTree does not support particle or octree-based data.")
+
         ParallelAnalysisInterface.__init__(self)
 
         self.ds = ds


https://bitbucket.org/yt_analysis/yt/commits/376a5fe19dff/
Changeset:   376a5fe19dff
Branch:      yt
User:        ngoldbaum
Date:        2016-07-16 22:49:43+00:00
Summary:     Merged in langmm/yt (pull request #2281)

Added Exception to AMRKDTree in the case of particle of oct-based data (Closes Issue #1215)
Affected #:  1 file

diff -r be5b44a0d960e1d4c553b1df7a2390a20623fd1d -r 376a5fe19dff3c6dc729c74587d33af1e0798848 yt/utilities/amr_kdtree/amr_kdtree.py
--- a/yt/utilities/amr_kdtree/amr_kdtree.py
+++ b/yt/utilities/amr_kdtree/amr_kdtree.py
@@ -30,6 +30,7 @@
     ParallelAnalysisInterface
 from yt.utilities.lib.partitioned_grid import PartitionedGrid
 from yt.utilities.math_utils import periodic_position
+from yt.geometry.grid_geometry_handler import GridIndex
 
 steps = np.array([[-1, -1, -1], [-1, -1,  0], [-1, -1,  1],
                   [-1,  0, -1], [-1,  0,  0], [-1,  0,  1],
@@ -139,6 +140,11 @@
 
 
 class AMRKDTree(ParallelAnalysisInterface):
+    r"""A KDTree for AMR data. 
+
+    Not applicable to particle or octree-based datasets.
+
+    """
 
     fields = None
     log_fields = None
@@ -147,6 +153,9 @@
     def __init__(self, ds, min_level=None, max_level=None,
                  data_source=None):
 
+        if not issubclass(ds.index.__class__, GridIndex):
+            raise RuntimeError("AMRKDTree does not support particle or octree-based data.")
+
         ParallelAnalysisInterface.__init__(self)
 
         self.ds = ds

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