-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a spatialdata-io mirror #778
Added a spatialdata-io mirror #778
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #778 +/- ##
==========================================
- Coverage 91.78% 91.73% -0.06%
==========================================
Files 45 46 +1
Lines 7124 7128 +4
==========================================
Hits 6539 6539
- Misses 585 589 +4
|
Thanks for the PR! I reviewed the code and tried and unfortunately realized that there are two problems. The first is that while the following works: python -c "import_spatialdata_io; import spatialdata; print(spatialdata.io.xenium)" This (in the same environment) doesn't: python -c "import spatialdata; print(spatialdata.io.xenium)" This, not because ImportError: cannot import name 'SpatialData' from partially initialized module 'spatialdata' (most likely due to a circular import) (/Users/macbook/embl/projects/basel/spatialdata/src/spatialdata/__init__.py) We could maybe find a way around this, but there is actually another problem. I realized that users may be confused because they would be able to do I think we have to change a bit the syntax. We could aim at support The other option woudl be to support |
I implemented the approach based on the python -c "from spatialdata.io import xenium; print(xenium)"
python -c "import spatialdata.io; print(spatialdata.io.xenium)" Also the IDE (PyCharm) seems to behave nicely with respect to docstring/autosuggest. I am nevertheless less convinced about this approach because without an accessor we have less polished code (we now have the If we repeat the approach with other packages ( sdata.plot(plotting_library='spatialdata-plot') as opposed to import spatialdata.spatialdata_plot
spatialdata.spatialdata_plot Anyway, I would not overthink it. I marked this as experimental in the docstring; I'd merge and test it in action. |
Simple mirror so that
spatialdata.io.xenium
will callspatialdata_io.xenium
ifspatialdata-io
is installed.If not installed, it raises an error only when calling
spatialdata.io.xenium
, whilespatialdata.io
itself will not raise anything.