-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add stubs #38
Add stubs #38
Conversation
@@ -5,8 +5,8 @@ edition = "2021" | |||
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |||
[lib] | |||
name = "zarrs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why that worked. In #37, you made it so there are two Rust libraries called zarrs
, which should be impossible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point.
The generated file looks like this: # This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501, F401
import numpy
import numpy.typing
import typing
class CodecPipelineImpl:
def __new__(cls,metadata,validate_checksums = ...,store_empty_chunks = ...,concurrent_target = ...): ...
def retrieve_chunks_and_apply_index(self, chunk_descriptions:typing.Sequence[tuple[tuple[str, typing.Sequence[int], str, typing.Sequence[int]], typing.Sequence[slice], typing.Sequence[slice]]], value:numpy.NDArray[typing.Any], chunk_concurrent_limit:int) -> None:
...
def retrieve_chunks(self, chunk_descriptions:typing.Sequence[tuple[str, typing.Sequence[int], str, typing.Sequence[int]]], chunk_concurrent_limit:int) -> list[numpy.typing.NDArray[numpy.uint8]]:
...
def store_chunks_with_indices(self, chunk_descriptions:typing.Sequence[tuple[tuple[str, typing.Sequence[int], str, typing.Sequence[int]], typing.Sequence[slice], typing.Sequence[slice]]], value:numpy.NDArray[typing.Any], chunk_concurrent_limit:int) -> None:
... The type inference for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add to docs how to use this? In contributing.md
?
TODO:
Eventually we should also get Jij-Inc/pyo3-stub-gen#102 merged and released, but that’s not important, as we will publish to PyPI and not to crates.io