-
Notifications
You must be signed in to change notification settings - Fork 289
Patch for NumpyDocString to add more parameter supported classes
#706
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
Conversation
…esides just Parameters e.g. Attributes.
…posed them via __init__
|
@jph00 is this good to go? |
jph00
left a 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.
Thanks for the contribution. It's a bit hard to review at the moment since it's so verbose and out of line with fastai style. Please try to keep it consistent with existing coding style, remove TODOs if you're not doing them (or else do them), and remove comments that aren't definitely needed to explain unusual special cases. Keep things clear and concise.
fastcore/parallel.py
Outdated
| @wraps(f) | ||
| def _f(*args, **kwargs): | ||
| res = (Thread,Process)[process](target=g, args=args, kwargs=kwargs) | ||
| if process: |
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.
This is unrelated to the PR - move to separate PR if needed.
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.
fe4d98f to
772dcd4
Compare
|
@jph00 so multiprocessing is now on its own PR and this is cleaner for just the docstring stuff |
jph00
left a 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.
Thanks for the improvements. Still a bit to do to get things more concise. Also remember the notebooks are the source, not the .py. Be sure to use the notebooks fully to take the reader through what's happening.
|
@jph00 I know that notebooks are source of truth.... but not all files come from notebooks? e.g. If so, I love working in nbdev and am happy to assist with that. I actually made an |
|
Many thanks for the style fixups. Looking good! And sorry, I totally forgot there isn't a notebook for docscrape. I suspect what happened is I borrowed the code from somewhere else and didn't get around to nb'ing it. Yes if you're open to doing that, that would be cool - we could then have some nice docs and stuff. I'd love to see your MCP BTW if you're open to sharing. |
|
@jph00 re: notebook-ify. Separate branch for the pr then? or continue here? |
|
Separate branch for the PR :) Stick your MCP thing in a github repo and share the URL here! |
At present
docscrape.NumpyDocStringfinally supports all Numpy Document Sections. However, only theParameterssection supports parameters. However pernumpydocmany sections should support parameters e.g. Attributes.This patch:
Adds a constant
PARAM_SECTIONSto note sections which support parameters.Updates
NumpyDocStringto:include a
param_sectionssimilar tosections,normalize the parameter processing done for
NumpyDocString.sections['Parameters']to the supportedparam_sections,exposes configuration options to
NumpyDocString.__init__At present, this will prevent complaints when running
nbdev_preparedue toTypeErrors. For example, consider the simple class:Then:
After applying the patch: