-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Using o16eb as an example:
import sntools.interaction_channels.o16eb as o16eb
# Should raise `ValueError` since "xb" is not in `o16eb.possible_flavors`.
# Instead, it currently ignores the input value and returns values for "eb".
c = o16eb.Channel("xb")
# Should raise `ValueError` since 0 MeV is outside of `o16eb.bounds_eNu`.
# Instead, it currently raises `UnboundLocalError` due to an implementation detail.
c.bounds_eE(eNu=0)In both cases, best practice would be to use the provided values (possible_flavors and bounds_eNu) to get physical values first; that’s why this isn’t an issue in sntools itself. However, if we want to make these interaction channels available as a public API, better input checking would be helpful.
In many cases, this could be tested in the CrossSectionTest base class (e.g. c.bounds_eE(-1) or c.bounds_eE(9999)); but accessing possible_flavors might require some changes to the individual test files.
Metadata
Metadata
Assignees
Labels
No labels