yt-project / yt

Main yt repository
http://yt-project.org
Other
468 stars 280 forks source link

"all" particle type fields are dimensionless #820

Closed yt-fido closed 7 years ago

yt-fido commented 10 years ago

Originally reported by: Britton Smith (Bitbucket: brittonsmith, GitHub: brittonsmith)


All particles fields that are accessed with "all" are now being returned as dimensionless. For example, with an enzo-3.0 dataset:

data["all", "particle_mass"] returns dimensionless, but data["DarkMatter", "particle_mass"] returns the proper units.


yt-fido commented 10 years ago

Original comment by chummels (Bitbucket: chummels, GitHub: chummels):


Removing milestone: 3.0 (automated comment)

yt-fido commented 10 years ago

Original comment by Matt Turk (Bitbucket: MatthewTurk, GitHub: MatthewTurk):


Fixed in PR 773.

yt-fido commented 10 years ago

Original comment by Matt Turk (Bitbucket: MatthewTurk, GitHub: MatthewTurk):


@brittonsmith I am on a8b501fd2fbf and I am able to do:

import yt
ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
dd = ds.all_data()
dd["all", "particle_mass"]

without problem.

yt-fido commented 10 years ago

Original comment by Matt Turk (Bitbucket: MatthewTurk, GitHub: MatthewTurk):


@brittonsmith okay, thanks.

yt-fido commented 10 years ago

Original comment by Britton Smith (Bitbucket: brittonsmith, GitHub: brittonsmith):


Actually, with that change I am unable to query any "all" field. I get the following:

#!python

>>> sp["all", "particle_mass"]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/brs/yt-3.0/src/yt-hg/yt/data_objects/data_containers.py", line 212, in __getitem__
    self.get_data(f)
  File "/home/brs/yt-3.0/src/yt-hg/yt/data_objects/data_containers.py", line 621, in get_data
    self._generate_fields(fields_to_generate)
  File "/home/brs/yt-3.0/src/yt-hg/yt/data_objects/data_containers.py", line 638, in _generate_fields
    fd = self._generate_field(field)
  File "/home/brs/yt-3.0/src/yt-hg/yt/data_objects/data_containers.py", line 247, in _generate_field
    tr = self._generate_particle_field(field)
  File "/home/brs/yt-3.0/src/yt-hg/yt/data_objects/data_containers.py", line 327, in _generate_particle_field
    rv = self.pf._get_field_info(*field)(gen_obj)
  File "/home/brs/yt-3.0/src/yt-hg/yt/fields/derived_field.py", line 175, in __call__
    "Something has gone terribly wrong, _function is NullFunc")
RuntimeError: Something has gone terribly wrong, _function is NullFunc

Querying actual particle types that exist still work, but it seems that the "all" union is messed up.

yt-fido commented 10 years ago

Original comment by Matt Turk (Bitbucket: MatthewTurk, GitHub: MatthewTurk):


@brittonsmith can you check if this is fixed in my PR?

https://bitbucket.org/yt_analysis/yt/pull-request/770/this-makes-things-a-bit-smarter-when/diff

yt-fido commented 10 years ago

Original comment by Matt Turk (Bitbucket: MatthewTurk, GitHub: MatthewTurk):


I think it is -- but there's some indication that my fix has side effects.

yt-fido commented 10 years ago

Original comment by Britton Smith (Bitbucket: brittonsmith, GitHub: brittonsmith):


This might be the same thing as what's happening in Issue #818.