-
Notifications
You must be signed in to change notification settings - Fork 16
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
Adding __init__
arguments to documentation for descents
#109
base: main
Are you sure you want to change the base?
Conversation
Opened an issue on equinox: patrick-kidger/equinox#933 |
Agreed! I believe (about 90% sure) that the default arguments are displayed via the default I think there's a reasonable argument to just always remove default arguments from that display, which lives here: |
Go for it. The type annotation here is coming from the parameter for |
97e80f0
to
898ca95
Compare
898ca95
to
f842522
Compare
Hi Patrick,
I would like to add documentation for the
__init__
methods of the descents we have.However, I'm not happy with how this documentation looks like - for instance, we have code that will look something like this
but when building the documentation, all the default arguments to "Newton" are collected as well and make the documentation much harder to read.
The documentation looks like this, blue is the stuff I'd like removed:
I'd like to write a decorator that is similar to
eqxi.docs_remove_args
, but which will instead remove all unchanged default values of arguments that are themselves classes, such that the documentation looks more like the code.Given that the descent is an
eqx.Module
without an explicit__init__
method, should this be a class decorator?I'm opening this as a PR here to provide an example. This can be merged once we have the decorator and be a draft for now.
(Name of this branch - this was a place to collect little odds and ends that are not critical and don't need their own PR.)