Generate typing stubs with docstub#7546
Conversation
which features more detailed error messages that point to the parsed source where an error originates from.
mkcor
left a comment
There was a problem hiding this comment.
Happy to mark this as 'ready for review,' so we can move forward and continue the work in subsequent PRs.
| Returns | ||
| ------- | ||
| out : 2-D array (same dtype as input image) | ||
| out : 2-D array, same dtype as input image |
There was a problem hiding this comment.
Is there any consensus/convention on '2-D' vs '2D' and 'array' vs 'ndarray?'
If so, I'll update #7518 accordingly.
There was a problem hiding this comment.
Sorry for the late reply. I don't think there's a solid convention. But intuitively I'd say "ndarray" usually implies a true NumPy array while "array" just implies an object that is an instance of a NumPy array or implements the array API. That said, in context of our library that doesn't yet make a huge difference.
I'd go with "array" personally and "array-like" for everything that we expect to be coercible into a (NumPy) array.
There was a problem hiding this comment.
All good! Not sure I get the difference between a 'true NumPy array' and 'an instance of a NumPy array' but I agree with the choice: "array" for an actual (NumPy) array and "array-like" for anything coercible into a (NumPy) array.
Other change is required by pre-commit hooks.
Copies over the setup from docstub. Obviously this will throw a bazillion errors. But still useful to have this in place already.
|
|
||
|
|
||
| def walk_dir(root): | ||
| """Walk each directory and file in the file tree of `root`. |
There was a problem hiding this comment.
| """Walk each directory and file in the file tree of `root`. | |
| """Walk recursively the contents (directories and files) of `root`. |
| logger.info("creating empty __init__.py in root dir") | ||
| (dst / "__init__.py").touch() | ||
|
|
||
| # Copy tests/ directories to dst, while emulating the sub dir structure |
There was a problem hiding this comment.
| # Copy tests/ directories to dst, while emulating the sub dir structure | |
| # Copy tests/ subdirectories to dst, while emulating the tree structure |
|
Closing this in favor of a more granular / step-by-step approach in #7802. |
Description
It's very early days, but this WIP will help keep track of progress on how docstub works in conjunction with scikit-image.
Roadmap:
skimage.<submodule>...Checklist
./doc/examplesfor new featuresRelease note
For maintainers and optionally contributors, please refer to the instructions on how to document this PR for the release notes.