-
Notifications
You must be signed in to change notification settings - Fork 43
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 internal docs for metadata and array behind Extended help wrappers #694
base: main
Are you sure you want to change the base?
Conversation
These are not that useful, because they can't be reach anyways because they are in an extension.
@@ -96,6 +102,14 @@ end | |||
|
|||
# Metadata utils | |||
|
|||
""" | |||
Internal function. |
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.
Does "Internal function" do something or its just a marker?
I'm not used to adding this much documentation, don't we just want this as a code comment?
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.
IMO this is very nice - when you see it in a stack trace, you can run ?
on it and immediately see what it does. For people who are good at Julia, not 100% immersed in the DD world, and want to debug an error - this is priceless.
But the string itself is just a marker, there's no special treatment.
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 am wondering, whether the marker "Internal function" is even needed nowadays, because with the public keyword, and the changes in Base handling of the show of non-public functions this is rather handled by Base.
In Julia 1.11 the Internal function thing and the extended help is not needed anymore because it would look like this: help?> ?DimensionalData._dimlength
│ Warning
│
│ The following bindings may be internal; they may change or be removed in future versions:
│
│ • DimensionalData._dimlength
Internal function
Extended help
≡≡≡≡≡≡≡≡≡≡≡≡≡
_dimlength(dim)
Return the length of the dimension dim or in case of a Tuple the length of every dimension in the Tuple. The first part with the | signs in front is inserted from the REPL and the Warning is in yellow, so we could just add the docstring normally to the non-public functions. |
This adds docstrings to internal functions in metadata and array which are hidden behind an
Extended help
layer. The idea is to provide the docstring, but to make clear that the functions are internal.The docstrings could clearly be improved, they are based on my current understanding from reading the code.
If you like the overall look of this, I might be going through more of the internal functions in the next weeks to add more internal documentation.
I also added docstrings to
DimVector
and similar types following the docstring examples for AbstractVector.In the REPL this would look like this for internal functions: