-
Notifications
You must be signed in to change notification settings - Fork 152
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
document zarr functions properly #1688
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## ig/io_module #1688 +/- ##
================================================
- Coverage 84.50% 84.50% -0.01%
================================================
Files 40 40
Lines 6049 6047 -2
================================================
- Hits 5112 5110 -2
Misses 937 937
Flags with carried forward coverage won't be shown. Click here to find out more.
|
I just noticed that the reson we don’t do that is probably zarr’s slow import. |
OK, I pushed an alternative that works. Another one would be def __getattr__(attr_name: Literal["read_zarr", "write_zarr"]):
if attr_name in {"read_zarr", "write_zarr"}:
from ._io import zarr
return getattr(zarr, attr_name)
raise AttributeError(attr_name)
__all__ = [
...
"read_zarr", # noqa: F822
...
"write_zarr", # noqa: F822
...
] which is less hacky, but makes type checking sadder. |
In any case, I think this would probably be better. In vscode, this would also give the docstring as well, no? |
Hmm, the
nope, PyRight doesn’t understand this, even when being super verbose and adding I feel like the hack is the only thing that works. We could also move the hack into |
I'm ok with how things are right now, but if it's clean and easy to do this, wouldn't be so bad. It should be straightforward to override the doc/import location right? We have something for this? |
The stuff we have for overriding locations is only for links. In this case we want An altenative I can think of: I could replace the condition with |
I think that's reasonable |
OK, there we go. This should work nicely, for static typing, docs, and at runtime |
No description provided.