[yt-dev] Issue #564: Projections not passing field parameters (yt_analysis/yt)
dcollins4096
issues-reply at bitbucket.org
Thu May 9 15:42:06 PDT 2013
New issue 564: Projections not passing field parameters
https://bitbucket.org/yt_analysis/yt/issue/564/projections-not-passing-field-parameters
dcollins4096:
If I have a field defined as such:
add_field('linewidth',function=linewidth, validators=[ValidateParameter('avg_vx')])
and some region
region = pf.h.region(Center,Left,Right)
region.set_field_parameter('avg_vx',15)
plotting a projection of that region fails to find the field_parameter:
proj = oober.pf.h.proj(2,'linewidth',source=region)
>>> proj = oober.pf.h.proj(2,'linewidth',source=region)
Initializing tree 0 / 4100% |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:00
Traceback (most recent call last): | ETA: --:--:--
File "<stdin>", line 1, in <module>
File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/data_containers.py", line 1758, in __init__
self._refresh_data()
File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/data_containers.py", line 318, in _refresh_data
self.get_data()
File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/data_containers.py", line 1859, in get_data
self._add_level_to_tree(tree, level, fields)
File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/data_containers.py", line 1981, in _add_level_to_tree
self._add_grid_to_tree(tree, grid, fields, zero_out, dls)
File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/data_containers.py", line 1925, in _add_grid_to_tree
for fd in self._get_data_from_grid(grid, fields)]
File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/data_containers.py", line 93, in save_state
tr = func(self, grid, field, *args, **kwargs)
File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/data_containers.py", line 2003, in _get_data_from_grid
return [grid[field] * bad_points for field in fields]
File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/grid_patch.py", line 157, in __getitem__
self.get_data(key)
File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/grid_patch.py", line 200, in get_data
self._generate_field(field)
File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/grid_patch.py", line 132, in _generate_field
self.pf.field_info[field].check_available(self)
File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 364, in check_available
validator(data)
File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 440, in __call__
raise NeedsParameter(doesnt_have)
yt.data_objects.field_info_container.NeedsParameter: (['avg_vx'])
Responsible: MatthewTurk
More information about the yt-dev
mailing list