This PR adds a new function that will check the ID type when passed a LIMS ID. That will let us quickly check to ensure that the correct ID type is passed to a given function. Here are some example use cases:
I added some logic to loading.get_ophys_dataset that will ensure that the passed ID is indeed an ophys_experiment_id. If not, it will throw a warning, then fail with an assertion error. This will stop the dreaded mystery crashes that are something 'One resulted expected ...' when I accidentally pass an ophys_session_id by mistake.
Here's what I see now when passing an ophys_session_id:
This PR adds a new function that will check the ID type when passed a LIMS ID. That will let us quickly check to ensure that the correct ID type is passed to a given function. Here are some example use cases:
The above examples are added as unit tests.
I added some logic to
loading.get_ophys_dataset
that will ensure that the passed ID is indeed anophys_experiment_id
. If not, it will throw a warning, then fail with an assertion error. This will stop the dreaded mystery crashes that are something 'One resulted expected ...' when I accidentally pass anophys_session_id
by mistake.Here's what I see now when passing an
ophys_session_id
: