[yt-dev] Issue #905: Cannot create plots from a data source (yt_analysis/yt)

Nathan Goldbaum issues-reply at bitbucket.org
Thu Sep 18 22:11:06 PDT 2014


New issue 905: Cannot create plots from a data source
https://bitbucket.org/yt_analysis/yt/issue/905/cannot-create-plots-from-a-data-source

Nathan Goldbaum:

A field detection/generation issue is breaking `to_pw`:


```
#!python

import yt
ds = yt.load('IsolatedGalaxy/galaxy0030/galaxy0030')
prj = ds.proj('density', 2)
plot = prj.to_pw()
```

This raises the following traceback on the current tip of the yt branch:


```
#!python

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    plot = prj.to_pw()
  File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/construction_data_containers.py", line 389, in to_pw
    pw = self._get_pw(fields, center, width, origin, 'Projection')
  File "/Users/goldbaum/Documents/yt-hg/yt/data_objects/data_containers.py", line 810, in _get_pw
    frb_generator=frb, plot_type=plot_type)
  File "/Users/goldbaum/Documents/yt-hg/yt/visualization/plot_window.py", line 618, in __init__
    PlotWindow.__init__(self, *args, **kwargs)
  File "/Users/goldbaum/Documents/yt-hg/yt/visualization/plot_window.py", line 203, in __init__
    self._set_window(bounds) # this automatically updates the data and plot
  File "/Users/goldbaum/Documents/yt-hg/yt/visualization/plot_container.py", line 46, in newfunc
    args[0]._recreate_frb()
  File "/Users/goldbaum/Documents/yt-hg/yt/visualization/plot_window.py", line 254, in _recreate_frb
    self.frb._get_data_source_fields()
  File "/Users/goldbaum/Documents/yt-hg/yt/visualization/fixed_resolution.py", line 143, in _get_data_source_fields
    if f not in exclude and f[0] not in self.data_source.ds.particle_types:
TypeError: 'NoneType' object has no attribute '__getitem__'

```






More information about the yt-dev mailing list