EGaraldi / corecon

User-friendly collection of Reionization-related constraints
https://corecon.readthedocs.io/en/latest/
GNU General Public License v3.0
8 stars 5 forks source link

Assert that field in get() is valid instead of silently returning None #9

Closed Stefan-Heimersheim closed 2 years ago

Stefan-Heimersheim commented 4 years ago

Hi again,

I noticed that the code just accepts typos like crc.get('To') and other invalid fields. Since this would lead to an error in the users code sooner or later, I'd rather raise an exception immediately instead of returning None (which is presumably harder to debug).

Cheers, Stefan