[yt-dev] Issue #825: Creating an all_data object does not generate the field_info object. (yt_analysis/yt)

Matthew Turk matthewturk at gmail.com
Tue Apr 1 17:04:50 PDT 2014


Hi Nathan,

This was by design -- whether that was right or not -- because I
wanted to allow all of the objects to be created without requiring an
index, until data was accessed.  Specifically this fails because
TotalMass accesses field_info directly instead of via _get_field_info.

-Matt

On Tue, Apr 1, 2014 at 8:02 PM, Nathan Goldbaum
<issues-reply at bitbucket.org> wrote:
> New issue 825: Creating an all_data object does not generate the field_info object.
> https://bitbucket.org/yt_analysis/yt/issue/825/creating-an-all_data-object-does-not
>
> Nathan Goldbaum:
>
> The following script and traceback illustrates the issue:
>
>
> ```
> #!python
>
> import yt
>
> ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
>
> ad = ds.all_data()
>
> print ad.quantities.total_mass()
> ```
>
>
> ```
>   File "test.py", line 7, in <module>
>     print ad.quantities.total_mass()
>   File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 188, in __call__
>     fi = self.data_source.pf.field_info
> AttributeError: 'EnzoDataset' object has no attribute 'field_info'
>
> ```
>
> Adding a call to ds.index before the call to the `total_mass` derived quantity eliminates the error.
>
>
>
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org



More information about the yt-dev mailing list