Issue #824: Field detection issue when recreating data objects (yt_analysis/yt)

New issue 824: Field detection issue when recreating data objects https://bitbucket.org/yt_analysis/yt/issue/824/field-detection-issue-when-re... Nathan Goldbaum: I ran into this when using a notebook. I found that when I re-ran a cell that creates a data object and then calculates a derived quantity, I get a field detection error the *second* time I run the cell. The following script exposes the buggy behavior: http://paste.yt-project.org/show/4462/ When run using the current experimental bookmark I get the following output and traceback: ``` goldbaum at ROUS in ~ ○ python test.py [8.15217983473e+49 g, 0.833333333333 code_mass] Traceback (most recent call last): File "test.py", line 21, in <module> print ad.quantities.total_mass() File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 194, in __call__ rv = super(TotalMass, self).__call__(fields) File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 163, in __call__ rv = super(TotalQuantity, self).__call__(fields) File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 59, in __call__ sto.result = self.process_chunk(ds, *args, **kwargs) File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 169, in process_chunk for field in fields] File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/data_containers.py", line 205, in __getitem__ f = self._determine_fields([key])[0] File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/data_containers.py", line 464, in _determine_fields raise YTFieldTypeNotFound(ftype) yt.utilities.exceptions.YTFieldTypeNotFound: Could not find field 'all'. ```

Hi Nathan, Weird. I think this is probably related to at some point guessing the field type; you'll note that it comes from _determine_fields, which will call _get_field_info with "unknown". If it can't figure out what it is (it defaults to the last type found) it throws the error. Can you check what the fname is? -Matt On Tue, Apr 1, 2014 at 7:55 PM, Nathan Goldbaum <issues-reply@bitbucket.org> wrote:
New issue 824: Field detection issue when recreating data objects https://bitbucket.org/yt_analysis/yt/issue/824/field-detection-issue-when-re...
Nathan Goldbaum:
I ran into this when using a notebook. I found that when I re-ran a cell that creates a data object and then calculates a derived quantity, I get a field detection error the *second* time I run the cell.
The following script exposes the buggy behavior: http://paste.yt-project.org/show/4462/
When run using the current experimental bookmark I get the following output and traceback:
``` goldbaum at ROUS in ~ ○ python test.py [8.15217983473e+49 g, 0.833333333333 code_mass] Traceback (most recent call last): File "test.py", line 21, in <module> print ad.quantities.total_mass() File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 194, in __call__ rv = super(TotalMass, self).__call__(fields) File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 163, in __call__ rv = super(TotalQuantity, self).__call__(fields) File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 59, in __call__ sto.result = self.process_chunk(ds, *args, **kwargs) File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 169, in process_chunk for field in fields] File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/data_containers.py", line 205, in __getitem__ f = self._determine_fields([key])[0] File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/data_containers.py", line 464, in _determine_fields raise YTFieldTypeNotFound(ftype) yt.utilities.exceptions.YTFieldTypeNotFound: Could not find field 'all'. ```
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org

Inspecting the stack trace with pdb reveals that fname is 'particle_mass'. On Tue, Apr 1, 2014 at 4:56 PM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Nathan,
Weird. I think this is probably related to at some point guessing the field type; you'll note that it comes from _determine_fields, which will call _get_field_info with "unknown". If it can't figure out what it is (it defaults to the last type found) it throws the error. Can you check what the fname is?
-Matt
On Tue, Apr 1, 2014 at 7:55 PM, Nathan Goldbaum <issues-reply@bitbucket.org> wrote:
New issue 824: Field detection issue when recreating data objects
https://bitbucket.org/yt_analysis/yt/issue/824/field-detection-issue-when-re...
Nathan Goldbaum:
I ran into this when using a notebook. I found that when I re-ran a
cell that creates a data object and then calculates a derived quantity, I get a field detection error the *second* time I run the cell.
The following script exposes the buggy behavior:
http://paste.yt-project.org/show/4462/
When run using the current experimental bookmark I get the following
output and traceback:
``` goldbaum at ROUS in ~ ○ python test.py [8.15217983473e+49 g, 0.833333333333 code_mass] Traceback (most recent call last): File "test.py", line 21, in <module> print ad.quantities.total_mass() File
"/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 194, in __call__
rv = super(TotalMass, self).__call__(fields) File
"/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 163, in __call__
rv = super(TotalQuantity, self).__call__(fields) File
"/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 59, in __call__
sto.result = self.process_chunk(ds, *args, **kwargs) File
"/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 169, in process_chunk
for field in fields] File
"/Users/goldbaum/Documents/yt-hg/yt/data_objects/data_containers.py", line 205, in __getitem__
f = self._determine_fields([key])[0] File
"/Users/goldbaum/Documents/yt-hg/yt/data_objects/data_containers.py", line 464, in _determine_fields
raise YTFieldTypeNotFound(ftype) yt.utilities.exceptions.YTFieldTypeNotFound: Could not find field 'all'. ```
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org

FWIW, this is the same bug I get in particle_trajectories in 3.0. On Apr 1, 2014, at 8:05 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
Inspecting the stack trace with pdb reveals that fname is 'particle_mass'.
On Tue, Apr 1, 2014 at 4:56 PM, Matthew Turk <matthewturk@gmail.com> wrote: Hi Nathan,
Weird. I think this is probably related to at some point guessing the field type; you'll note that it comes from _determine_fields, which will call _get_field_info with "unknown". If it can't figure out what it is (it defaults to the last type found) it throws the error. Can you check what the fname is?
-Matt
On Tue, Apr 1, 2014 at 7:55 PM, Nathan Goldbaum <issues-reply@bitbucket.org> wrote:
New issue 824: Field detection issue when recreating data objects https://bitbucket.org/yt_analysis/yt/issue/824/field-detection-issue-when-re...
Nathan Goldbaum:
I ran into this when using a notebook. I found that when I re-ran a cell that creates a data object and then calculates a derived quantity, I get a field detection error the *second* time I run the cell.
The following script exposes the buggy behavior: http://paste.yt-project.org/show/4462/
When run using the current experimental bookmark I get the following output and traceback:
``` goldbaum at ROUS in ~ ○ python test.py [8.15217983473e+49 g, 0.833333333333 code_mass] Traceback (most recent call last): File "test.py", line 21, in <module> print ad.quantities.total_mass() File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 194, in __call__ rv = super(TotalMass, self).__call__(fields) File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 163, in __call__ rv = super(TotalQuantity, self).__call__(fields) File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 59, in __call__ sto.result = self.process_chunk(ds, *args, **kwargs) File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/derived_quantities.py", line 169, in process_chunk for field in fields] File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/data_containers.py", line 205, in __getitem__ f = self._determine_fields([key])[0] File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/data_containers.py", line 464, in _determine_fields raise YTFieldTypeNotFound(ftype) yt.utilities.exceptions.YTFieldTypeNotFound: Could not find field 'all'. ```
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
participants (4)
-
John ZuHone
-
Matthew Turk
-
Nathan Goldbaum
-
Nathan Goldbaum