Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use particle unions with derived fields #1932

Open
cphyc opened this issue Jul 30, 2018 · 2 comments
Open

Cannot use particle unions with derived fields #1932

cphyc opened this issue Jul 30, 2018 · 2 comments
Labels
new feature Something fun and new! yt core Core components and algorithms in yt
Milestone

Comments

@cphyc
Copy link
Member

cphyc commented Jul 30, 2018

Bug report

Bug summary

It is not possible to create particle unions made of particle fields from particle filters.

Code for reproduction

import yt
from yt.data_objects.particle_unions import \
    ParticleUnion

ds = yt.load('ramses_new_format/output_00002/info_00002.txt')

u = ParticleUnion("tracer", ["gas_tracer", "star_tracer"])
ds.add_particle_union(u)

ds.r['tracer', 'particle_family']

In this case gas_tracer and star_tracer are particle filters that get dynamically defined by the RAMSES frontend.

Actual outcome

Traceback (most recent call last):
  File "test_part_counts.py", line 11, in <module>
    u = ParticleUnion("tracer", ["gas_tracer", "star_tracer"])
  File "~/Documents/prog/yt/yt/data_objects/region_expression.py", line 42, in __getitem__
    return self.all_data[item]
  File "~/Documents/prog/yt/yt/data_objects/data_containers.py", line 255, in __getitem__
    self.get_data(f)
  File "~/Documents/prog/yt/yt/data_objects/data_containers.py", line 1359, in get_data
    read_particles, gen_particles = self.index._read_particle_fields(
  File "~/Documents/prog/yt/yt/geometry/geometry_handler.py", line 227, in _read_particle_fields
    fields_to_read)
  File "~/Documents/prog/yt/yt/utilities/io_handler.py", line 201, in _read_particle_selection
    psize = self._count_particles_chunks(chunks, ptf, selector)
  File "~/Documents/prog/yt/yt/utilities/io_handler.py", line 170, in _count_particles_chunks
    for ptype, (x, y, z) in self._read_particle_coords(chunks, ptf):
  File "~/Documents/prog/yt/yt/frontends/ramses/io.py", line 146, in _read_particle_coords
    rv = self._read_particle_subset(subset, fields)
  File "~/Documents/prog/yt/yt/frontends/ramses/io.py", line 195, in _read_particle_subset
    raise YTFieldTypeNotFound(ptype)
yt.utilities.exceptions.YTFieldTypeNotFound: Could not find field type 'gas_tracer'.

Version Information

  • Operating System: Arch Linux
  • Python Version: 3.6.6
  • yt version: 3.5dev0 46da297
@ngoldbaum
Copy link
Member

It is not possible to create particle unions made of derived fields.

Do you mean particle filters?

@ngoldbaum ngoldbaum added this to the 4.0 milestone Jul 30, 2018
@cphyc
Copy link
Member Author

cphyc commented Jul 30, 2018

@ngoldbaum yes sorry ; I edited my OP

@ngoldbaum ngoldbaum added new feature Something fun and new! yt core Core components and algorithms in yt labels Jul 30, 2018
@munkm munkm added this to To do in yt-4.0 release Mar 6, 2019
@chummels chummels removed this from To do in yt-4.0 release Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Something fun and new! yt core Core components and algorithms in yt
Projects
None yet
Development

No branches or pull requests

2 participants