Issue #946: Covering grid doesn't set "center" field parameter (yt_analysis/yt)
New issue 946: Covering grid doesn't set "center" field parameter https://bitbucket.org/yt_analysis/yt/issue/946/covering-grid-doesnt-set-cent... Kacper Kowalik: This simple script: ``` #!python import yt ds = yt.load("Sedov_3d/sedov_hdf5_chk_0003") data = ds.covering_grid(1, left_edge=ds.domain_left_edge, dims=[32,32,32]) data["radial_velocity"] ``` yields rather confusing traceback: ``` #!text Traceback (most recent call last): File "bug.py", line 4, in <module> data["radial_velocity"] File "yt/src/yt-my/yt/data_objects/data_containers.py", line 249, in __getitem__ self.get_data(f) File "yt/src/yt-my/yt/data_objects/construction_data_containers.py", line 531, in get_data if len(gen) > 0: self._generate_fields(gen) File "yt/src/yt-my/yt/data_objects/data_containers.py", line 719, in _generate_fields fd = self._generate_field(field) File "yt/src/yt-my/yt/data_objects/data_containers.py", line 286, in _generate_field tr = self._generate_fluid_field(field) File "yt/src/yt-my/yt/data_objects/data_containers.py", line 306, in _generate_fluid_field rv = finfo(gen_obj) File "yt/src/yt-my/yt/fields/derived_field.py", line 184, in __call__ dd = self._function(self, data) File "yt/src/yt-my/yt/fields/vector_operations.py", line 109, in _radial theta = data['index', 'spherical_theta'] File "yt/src/yt-my/yt/data_objects/data_containers.py", line 249, in __getitem__ self.get_data(f) File "yt/src/yt-my/yt/data_objects/construction_data_containers.py", line 531, in get_data if len(gen) > 0: self._generate_fields(gen) File "yt/src/yt-my/yt/data_objects/data_containers.py", line 719, in _generate_fields fd = self._generate_field(field) File "yt/src/yt-my/yt/data_objects/data_containers.py", line 286, in _generate_field tr = self._generate_fluid_field(field) File "yt/src/yt-my/yt/data_objects/data_containers.py", line 306, in _generate_fluid_field rv = finfo(gen_obj) File "yt/src/yt-my/yt/fields/derived_field.py", line 184, in __call__ dd = self._function(self, data) File "yt/src/yt-my/yt/fields/geometric_fields.py", line 104, in _spherical_theta coords = get_periodic_rvec(data) File "yt/src/yt-my/yt/fields/field_functions.py", line 51, in get_periodic_rvec coords = obtain_rvec(data) File "yt/utilities/lib/geometry_utils.pyx", line 89, in yt.utilities.lib.geometry_utils.obtain_rvec (yt/utilities/lib/geometry_utils.c:2228) TypeError: 'NoneType' object has no attribute '__getitem__' ``` `covering_grid` should either set sane default for *center* or fields using `ValidateParameter()` should catch this earlier and more gracefully.
participants (1)
-
Kacper Kowalik