yt-project/yt

YTQuadTreeProj contains many unusable methods

Open

#1,281 opened on Sep 21, 2016

View on GitHub
 (3 comments) (0 reactions) (0 assignees)Python (315 forks)auto 404
help wantedwishlist

Repository metrics

Stars
 (556 stars)
PR merge metrics
 (PR metrics pending)

Description

Originally reported by: Scott Feister (Bitbucket: phyzicist, GitHub: phyzicist)


Unless I am understanding something wrong, there are several non-functioning methods listed in YTQuadTreeProj.

The auto-generated documentation lists methods like "min()", "max()", "mean()", "integrate()", etc. These methods are also available to the python interface, but almost all of them just throw errors at me that say "Data selector... not implemented".

This is some combination of:

  1. A bug
  2. An oversight in documentation
  3. An issue with method inheritance for YTQuadTreeProj

OR I just messed something up.

Here is an example of code that gives an error.

#!python

import yt

exampledir = "/home/sfeister/test/yttest/ytExampleData/"
ds = yt.load(exampledir + "Enzo_64/DD0043/data0043")

reg = ds.all_data()
print reg.min('Density') # Works

proj = reg.integrate('Density', 2) # Do a projection of the region
print(proj.__doc__) # Methods of YTQuadTree include "integrate", "min", etc.
print("/n/n")
print proj.min('Density') # Fails, with error below
print proj.integrate('Density', 1) # Fails, similar error

Error is as follows:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sfeister/anaconda2/lib/python2.7/site-packages/yt/data_objects/data_containers.py", line 778, in min
    rv += (self._compute_extrema(f)[0],)
  File "/home/sfeister/anaconda2/lib/python2.7/site-packages/yt/data_objects/data_containers.py", line 706, in _compute_extrema
    mi, ma = self.quantities.extrema(field)
  File "/home/sfeister/anaconda2/lib/python2.7/site-packages/yt/data_objects/derived_quantities.py", line 510, in __call__
    rv = super(Extrema, self).__call__(fields, non_zero)
  File "/home/sfeister/anaconda2/lib/python2.7/site-packages/yt/data_objects/derived_quantities.py", line 66, in __call__
    for sto, ds in parallel_objects(chunks, -1, storage = storage):
  File "/home/sfeister/anaconda2/lib/python2.7/site-packages/yt/utilities/parallel_tools/parallel_analysis_interface.py", line 508, in parallel_objects
    for result_id, obj in oiter:
  File "/home/sfeister/anaconda2/lib/python2.7/site-packages/yt/data_objects/data_containers.py", line 1087, in chunks
    for chunk in self.index._chunk(self, chunking_style, **kwargs):
  File "/home/sfeister/anaconda2/lib/python2.7/site-packages/yt/geometry/geometry_handler.py", line 251, in _chunk
    self._identify_base_chunk(dobj)
  File "/home/sfeister/anaconda2/lib/python2.7/site-packages/yt/geometry/grid_geometry_handler.py", line 293, in _identify_base_chunk
    gi = dobj.selector.select_grids(self.grid_left_edge,
  File "/home/sfeister/anaconda2/lib/python2.7/site-packages/yt/data_objects/data_containers.py", line 1075, in selector
    raise YTDataSelectorNotImplemented(self._type_name)
yt.utilities.exceptions.YTDataSelectorNotImplemented: Data selector 'proj' not implemented.

Best,

Scott


Contributor guide