pynbody / genetIC

The GM initial conditions generator
GNU General Public License v3.0
21 stars 8 forks source link

Fixing gas mapper flagging problem if referencing gas only #47

Closed Martin-Rey closed 5 years ago

Martin-Rey commented 5 years ago

Hi,

I discovered a bug in the GasMapper while playing with an unusual use case: I am trying to load an ID file of gas IDs only, generated from a uniform resolution baryon volume.

The current implementation of GasMapper seems to skip the gas IDs to flag only the DM grids. I assume it expects that the user would provide a combination of DM+gas but in my case, I don't have access to the DM IDs so it results in zero cells flagged at all.

The change implemented below correct this behaviour, not breaking other mapper and gas tests. However, I am not the most confident with this part of the code, so comments welcome.

I added a test for this use case.

Martin

apontzen commented 5 years ago

I think we agreed this is probably not a good change - am I ok to close this @Martin-Rey?

Martin-Rey commented 5 years ago

Sure!