wtbarnes / fiasco

Python interface to the CHIANTI atomic database
http://fiasco.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
20 stars 15 forks source link

Refactor handling of including protons in `level_populations` #227

Closed wtbarnes closed 1 year ago

wtbarnes commented 1 year ago

Currently, the way these conditionals are handled is very sloppy. For example, we should not throw a warning if include_protons has already been set to False. E.g. in the AIA example: https://fiasco.readthedocs.io/en/stable/generated/gallery/aia_response.html#sphx-glr-generated-gallery-aia-response-py

Additionally, the manual checking of _psplups could be avoided by just catching the MissingDatasetException from the proton rate functions and then setting include_protons=False if it is thrown.

I thought I had fixed this in #223 but it somehow did not make it in...