[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Mar 24 14:31:36 PDT 2016
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/75eb04732491/
Changeset: 75eb04732491
Branch: yt
User: ngoldbaum
Date: 2016-03-24 18:52:15+00:00
Summary: Print a better error message when accessing fields that need ghost zones from a covering grid. Closes #1070.
Affected #: 1 file
diff -r 9c03543ba85f4f0aa07f2f0261724831cedfe754 -r 75eb04732491dc00828af6c059f0ed0dd7eb5369 yt/data_objects/construction_data_containers.py
--- a/yt/data_objects/construction_data_containers.py
+++ b/yt/data_objects/construction_data_containers.py
@@ -40,6 +40,8 @@
YTParticleDepositionNotImplemented, \
YTNoAPIKey, \
YTTooManyVertices
+from yt.fields.field_exceptions import \
+ NeedsGridType
from yt.utilities.lib.quad_tree import \
QuadTree
from yt.utilities.lib.interpolators import \
@@ -492,6 +494,8 @@
Number of cells along each axis of resulting covering_grid
fields : array_like, optional
A list of fields that you'd like pre-generated for your object
+ num_ghost_zones : integer, optional
+ The number of padding ghost zones used when accessing fields.
Examples
--------
@@ -609,7 +613,16 @@
fields_to_get = [f for f in fields if f not in self.field_data]
fields_to_get = self._identify_dependencies(fields_to_get)
if len(fields_to_get) == 0: return
- fill, gen, part, alias = self._split_fields(fields_to_get)
+ try:
+ fill, gen, part, alias = self._split_fields(fields_to_get)
+ except NeedsGridType:
+ if self._num_ghost_zones == 0:
+ raise RuntimeError(
+ "Attempting to access a field that needs ghost zones, but "
+ "num_ghost_zones = %s. You should create the covering grid "
+ "with nonzero num_ghost_zones." % self._num_ghost_zones)
+ else:
+ raise
if len(part) > 0: self._fill_particles(part)
if len(fill) > 0: self._fill_fields(fill)
for a, f in sorted(alias.items()):
https://bitbucket.org/yt_analysis/yt/commits/a776e67368c5/
Changeset: a776e67368c5
Branch: yt
User: xarthisius
Date: 2016-03-24 21:31:25+00:00
Summary: Merged in ngoldbaum/yt (pull request #2077)
Print a better error message when accessing fields that need ghost zones from a covering grid. Closes #1070.
Affected #: 1 file
diff -r 49e7f3e3aa0dd471bcfb6b350af8c9ca8b18e760 -r a776e67368c5629296b1e365dfca0b68b41ef1d5 yt/data_objects/construction_data_containers.py
--- a/yt/data_objects/construction_data_containers.py
+++ b/yt/data_objects/construction_data_containers.py
@@ -40,6 +40,8 @@
YTParticleDepositionNotImplemented, \
YTNoAPIKey, \
YTTooManyVertices
+from yt.fields.field_exceptions import \
+ NeedsGridType
from yt.utilities.lib.quad_tree import \
QuadTree
from yt.utilities.lib.interpolators import \
@@ -492,6 +494,8 @@
Number of cells along each axis of resulting covering_grid
fields : array_like, optional
A list of fields that you'd like pre-generated for your object
+ num_ghost_zones : integer, optional
+ The number of padding ghost zones used when accessing fields.
Examples
--------
@@ -609,7 +613,16 @@
fields_to_get = [f for f in fields if f not in self.field_data]
fields_to_get = self._identify_dependencies(fields_to_get)
if len(fields_to_get) == 0: return
- fill, gen, part, alias = self._split_fields(fields_to_get)
+ try:
+ fill, gen, part, alias = self._split_fields(fields_to_get)
+ except NeedsGridType:
+ if self._num_ghost_zones == 0:
+ raise RuntimeError(
+ "Attempting to access a field that needs ghost zones, but "
+ "num_ghost_zones = %s. You should create the covering grid "
+ "with nonzero num_ghost_zones." % self._num_ghost_zones)
+ else:
+ raise
if len(part) > 0: self._fill_particles(part)
if len(fill) > 0: self._fill_fields(fill)
for a, f in sorted(alias.items()):
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/20160324/c13c855f/attachment-0001.html>
More information about the yt-svn
mailing list