-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Docstring cleanup: "default None", doi #1828
Docstring cleanup: "default None", doi #1828
Conversation
Exclude .*=| from negative lookahead ^(\s{8}|\s{4})(?!try|else|doi|DOI|Warning|Access|Requests|Note)(\w*): (?!.*:)(.+)$ Reason: just this line 🌝 Remaining matches are type annotations in modelchain.py and pvsystem.py
2623253
to
15d8107
Compare
F: (?<spaces>\s{8}|\s{4})(?<name>\w*)\s?: (?<type>.*) \(optional, default=(?<default>.*)\)$ R:
1st-F: (?<spaces> {8}| {4})(?<name>\w*) : (?<types>.*), default None$ 2nd-F: (?<spaces> {8}| {4})(?<name>\w*) : [Nn}one or (?<type>.*), optional$ 3rd-F: (?<spaces> {8}| {4})(?<name>\w*) : (?<type>.*) or [nN]one, optional$ R: $1$2 : $3, optional
F: If None, R: If not specified,
F: If None R: If not specified,
regex Done! |
Regex find: (?:doi|DOI):(?!`)\s?(.*?)(\.\n|\n) Replace: :doi:`$1`$2
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 @echedey-ls
There's more markdown to be done in the descriptions of parameters this touches, if you feel it is in scope. I stopped suggesting it.
@pvlib/pvlib-maintainer it is questionable in my mind whether module_parameters
, inverter_parameters
and the like should be optional for instantiating a ModelChain
. The ModelChain
is created, true, but nothing runs.
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-Authored-By: Cliff Hansen <5393711+cwhanse@users.noreply.github.com>
…dey-ls/pvlib-python into refactor-docstring-params-2
Co-Authored-By: Cliff Hansen <5393711+cwhanse@users.noreply.github.com>
F: (?<spaces> {8}| {4})(?<name>\w*) : [Nn]one[ ,]*(?<type>.*), optional$ R: $1$2 : $3, optional Co-Authored-By: Cliff Hansen <5393711+cwhanse@users.noreply.github.com>
Co-Authored-By: Cliff Hansen <5393711+cwhanse@users.noreply.github.com>
Co-Authored-By: Cliff Hansen <5393711+cwhanse@users.noreply.github.com>
F1: (?<spaces> {8}| {4})(?<name>\w*) ?: (?<type>.*), default: None F2: (?<spaces> {8}| {4})(?<name>\w*) ?: (?<types>.*), default None$ F3: (?<spaces> {8}| {4})(?<name>\w*) ?: [Nn]one or (?<type>.*), optional$ zero results F4: (?<spaces> {8}| {4})(?<name>\w*) ?: (?<type>.*) or [nN]one, optional$ zero results R: $1$2 : $3, optional
@echedey-ls thanks for the work on this. If we don't get all instances of |
F: (?<spaces> {8}| {4})(?<name>\w*) ?: (?<type>.*), default:? None\.? R: $1$2 : $3, optional F: (?<spaces> {8}| {4})(?<name>\w*) ?: [Nn]one, (?<type>.*), default:? (?<def>.*)\.? R: $1$2 : $3, default $4 F: (?<spaces> {8}| {4})(?<name>\w*) ?: [Nn]one or (?<types>.*) R: $1$2 : $3 F: (?<spaces> {8}| {4})(?<name>\w*) ?: (?<types>.*) or [Nn]one(?<trailing>.*) R: $1$2 : $3$4 F: (?<spaces> {8}| {4})(?<name>\w*) ?: [Nn]one(?:,|or) (?<types>.*) R: $1$2 : $3
I had to iterate a bit more... At first glance I thought very constraining regexes were enough, but even trailing dots were messing with that. I think all have been addressed for now. |
This reverts commit b8f942b.
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
This should be ready to go, unless anything else wants to be done! |
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 @echedey-ls! Might be worth leaving a comment on this PR with a list of the final set of regexes you used for this PR, in case we want to re-run something like this in the future.
it is questionable in my mind whether module_parameters, inverter_parameters and the like should be optional for instantiating a ModelChain. The ModelChain is created, true, but nothing runs.
@cwhanse I'm not sure what you mean. ModelChain
doesn't take module_parameters
or inverter_parameters
.
None regexes
DOI regexes:
Some of them could be changed to be more flexible, but I wanted the least number of false positives. I'm looking at the excessive-parentheses regex, they are really ugly in the web. |
With no objections, time to merge! Thanks again @echedey-ls :) |
[ ] Tests added[ ] Updates entries indocs/sphinx/source/reference
for API changes.[ ] Adds description and name entries in the appropriate "what's new" file indocs/sphinx/source/whatsnew
for all changes. Includes link to the GitHub Issue with:issue:`num`
or this Pull Request with:pull:`num`
. Includes contributor name and/or GitHub username (link with:ghuser:`user`
).remote-data
) and Milestone are assigned to the Pull Request and linked Issue.Cherry-picked commits from #1790 and repeated the process with the regexes, with little changes to them.
Changes in this PR
return_components: bool (optional, default=False)
->return_components : bool, default False
If None
->If not specified
DOI: 10...
->:doi:`10...`