lina-usc / pylossless

🧠 EEG Processing pipeline that annotates continuous data
https://pylossless.readthedocs.io/en/latest/
MIT License
25 stars 10 forks source link

FIX: Don't import optional deps at the top-level #167

Closed scott-huberty closed 2 months ago

scott-huberty commented 2 months ago

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.

scott-huberty commented 2 months ago

Waiting for #168 to land, then CI's should be happy..