-
Notifications
You must be signed in to change notification settings - Fork 442
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 core typing to documentation #5621
Conversation
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.
LGTM
# CellsLike.__doc__ | ||
# CellArrayLike.__doc__ |
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 wasn't sure how to document these. @darikg do you have a suggestion for these?
Thanks for the fixes and quick approval! Might be good to do a manual check before this is merged. The aliases need So, I'm not sure if sphinx will actually pick up the docstrings correctly or not. I'm also curious to see how the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5621 +/- ##
==========================================
- Coverage 96.54% 96.52% -0.02%
==========================================
Files 137 137
Lines 23301 23311 +10
==========================================
+ Hits 22495 22500 +5
- Misses 806 811 +5 |
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.
Thanks. I will check in my local. It would be nice if we could do a preview build, but that mechanism is being rebuilt in #5360.
I have not been able to review the docs locally. The docs are approx 3.5GB in size, and download speeds seem to be capped at 500KB/sec, which means downloading them takes approx 2 hours. For some reason, the download keeps failing for me part way through and I have to re-retry. The download has failed 4 times for me already, not sure if that's just my machine or my web browser. |
The volume of documentation is bloated and is straining our development efficiency. This is a significant problem. We are discussing it in #5352 and would appreciate any ideas you may have. |
I still can't download the docs locally for review 😔, not sure what the issue is or if there are any workarounds... |
github-actions preview |
github-actions preview |
Preview is deployed. Let's review! |
thank you🙏 that tool is very convenient Some of the docstrings didn't show, and the aliases were still expanded, hopefully fixed now |
It looks like the |
github-actions preview |
The alias in the set_array function signature is now correctly set as The alias in signature is not linked, however. This seems to be a bug, with a possible workaround here. |
This confirms that it may be (or is likely) necessary to add |
github-actions preview |
This PR looks good to me. I am a bit concerned that some references to |
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.
LGTM. Thanks!
Please wait while we merge #5670 first. |
Unfortunately, this issue has surfaced. Looking at the docs published here before this PR was merged, we see that PolyData's array-like aliases are expanded. |
I wonder if @dcbr can help. This PR added If we look at the docs for ChartBox, it has a working Do you know how this was achieved? |
It's been a while since I messed with those aliases, I know it was a lot of trial and error and don't remember the exact "solution"; but I will try to have another look and see if I can help resolve it. |
Thanks, this PR tried to copy the same config, and there was also lots of trial and error. A possible source of the issue may be from:
After writing this, I strongly suspect that # 2 is the issue, and that adding a conditional |
|
||
.. autotypevar:: NumberType | ||
|
||
.. autodata:: ArrayLike |
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.
Sorry, I haven't had much time lately, so I haven't properly looked into this yet.
But another difference I noticed is the way the documentation for the type alias is generated here. For ColorLike
it is generated using .. autosummary::
(see utilities.rst). I'm not at all a Sphinx expert, so maybe these are equivalent, but maybe you can give this a try?
Additionally, I don't see this typing module being documented on the deployed documentation for the 'dev' branch?
Overview
Add documentation for the type definitions in
core._typing_core
.Specifically:
Publish the types in the docs in
Core API -> Typing
Make the
_typing_core
types in docstrings and annotations automatically linkable.data : Array
parameter in the docstring, but it is not linkable. This makes it unclear what is meant byArray
.pyvista
namespace. This is so that adding the types to the docs with just the type name (e.g.Vector
will mean that sphinx will implictly find and link it automatically (no need to explicitly referencepyvista.core._typing_core.Vector
)Make the
_typing_core
annotations in function signatures more readable.validation
package #5571 (comment)The additions in this PR are similar to the configuration for ColorLike, which is a pyvista type alias that is linkable and is defined formally the docs. (See the
color
param for ChartBox as an example of its use in docstrings).