jzuhone / pyxsim

Simulating X-ray observations from astrophysical sources.
http://hea-www.cfa.harvard.edu/~jzuhone/pyxsim
Other
20 stars 8 forks source link

Ensure we are always dealing with arrays when chunking in thermal source #36

Closed jzuhone closed 3 years ago

jzuhone commented 3 years ago

ThermalSourceModel iterates over a yt data container object by using yt's chunking--occasionally that can lead to single-element scalars which are then attempted to be indexed.

This should fix it by requiring that we are always working with arrays.

Fixes issue #35.

jzuhone commented 3 years ago

@benopp99 this should fix the issues you were seeing with the indexing scalars. If you checkout the fix_single_cell branch and try running it would be good to know if it fixes your issue.