138 imported openneuro at the top of the datasets module, but openneuro-py is not a hard dependency of pylossless.
This PR creates a soft import function that gets called only if/when a user calls the function in pylossless.datasets that needs openneuro-py, and raises an informative error if they don't have it installed.
This will likely become handy if we need to do similar soft imports in the future.
138 imported
openneuro
at the top of thedatasets
module, butopenneuro-py
is not a hard dependency of pylossless.This PR creates a soft import function that gets called only if/when a user calls the function in
pylossless.datasets
that needsopenneuro-py
, and raises an informative error if they don't have it installed.This will likely become handy if we need to do similar soft imports in the future.