[yt-dev] Issue #859: HaloCatalog tries to use non exisiting field (yt_analysis/yt)
Kacper Kowalik
issues-reply at bitbucket.org
Fri Jul 18 07:56:25 PDT 2014
New issue 859: HaloCatalog tries to use non exisiting field
https://bitbucket.org/yt_analysis/yt/issue/859/halocatalog-tries-to-use-non-exisiting
Kacper Kowalik:
Following script:
```
#!python
from yt.mods import load
from yt.analysis_modules.halo_analysis.api import HaloCatalog
import tempfile
import os
# Create temporary directory for storing files
tmpdir = tempfile.mkdtemp()
# Load the data set with the full simulation information
data_pf = load('Enzo_64/RD0006/RedshiftOutput0006')
# Load the rockstar data files
halos_pf = load('rockstar_halos/halos_0.0.bin')
# Instantiate a catalog using those two paramter files
hc = HaloCatalog(data_pf=data_pf, halos_pf=halos_pf,
output_dir=os.path.join(tmpdir, 'halo_catalog'))
```
fails with current tip (d44a659ea62c) yielding
```
#!text
Traceback (most recent call last):
File "ala.py", line 17, in <module>
output_dir=os.path.join(tmpdir, 'halo_catalog'))
File "yt/analysis_modules/halo_analysis/halo_catalog.py", line 139, in __init__
self.add_default_quantities()
File "yt/analysis_modules/halo_analysis/halo_catalog.py", line 448, in add_default_quantities
self.add_quantity("virial_radius", field_type=field_type,prepend=True)
File "yt/analysis_modules/halo_analysis/halo_catalog.py", line 218, in add_quantity
raise RuntimeError("HaloCatalog quantity must be a registered function or a field of a known type.")
RuntimeError: HaloCatalog quantity must be a registered function or a field of a known type.
```
Regression was introduced in 39697406e012
*viral_radius* was renamed to *radius* in `yt/frontends/halo_catalogs/rockstar/definitions.py`, however `yt/analysis_modules/halo_analysis/halo_catalog.py:add_default_quantities` still tries to use it.
More information about the yt-dev
mailing list