-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Set value for undefined variables in examples #51342
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
Comments
take |
Hey Wouldn't fixing EX02 also end up fixing these? |
Yes, good point, thanks @MarcoGorelli I'd say that fixing the errors here will also help fix the docstring validations EX02 and EX03. I created another issue with the remaining errors in the examples. I think we can add the validation once both are completed. @kkangs0226 I created two issues so two people could work in parallel, since these issues aren't trivial and will take some time. Please don't assign two issues to yourself at the same time, so other people can work on the one you aren't working yet.do you mind releasing the one you aren't workimg in yet? Thank you! |
@datapythonista Got it, I was looking at both issues because they looked related. I will release this issue for other developers to work on it! |
No problem at all. And surely feel free to work in both, but I think they' may take longer than what it seems, so better to start with one leaving the other free in case someone else is available to work on it in the meantime. Thanks for helping with this! |
assign me please . I am new to github |
@datapythonista almost all the examples are runnable, as we have been working a lot to remove EX02 errors. There are only about 13 functions that still need fixing. |
that's a good point - the sentence
should probably be updated to
Regarding the "PDF023" - this one is from a flake8 extension which we're no longer using, having moved to
(or the mamba equivalent) |
@MarcoGorelli just remember that the letter "s" is all over the place.. I don't know how many examples there are with this, but it seems like a colosal change. |
sure, maybe it's too large to change everywhere, but for new docstrings we could change the advice and no, ruff doesn't complain about it (though technically flake8 is still used for docstrings, but without extra plugins installed) |
Updated: Numpy, scikitlearn etc also have single letter names in the docstrings.. Also, I don’t know where on github to keep talking about this, as the same issue was opened several times. I understand that just one type of flake8 error needed to be fixed, as instructed in the original issue. But since we are not testing EX03 yet, the rest of flake8 errors didn't come up I think. I’m attaching the errors I get. I'm not sure if I should open an issue. |
thanks for flagging this - I think #51356 was an improvement because it took us from invalid syntax such as df.style.format(na_rep='MISS', precision=1, subset=[0])
.format(na_rep='PASS', precision=2, subset=[1, 2]) to valid syntax such as (df.style.format(na_rep='MISS', precision=1, subset=[0])
.format(na_rep='PASS', precision=2, subset=[1, 2])) Maybe these can be made more legibile, you're right, e.g. df.style.format(na_rep="MISS", precision=1, subset=[0]).format(
na_rep="PASS", precision=2, subset=[1, 2]
) , if you wanted to open an issue about that (or directly make a PR), that'd be welcome And if you wanted to open an issue about EX03 (similar to the current EX02/EX01 ones, which are gradually getting addressed - nice 🎉 ), that would also be welcome |
I will. Thanks for the explanations. |
I think Marc makes a good point here that's it's not really worth changing In general for these kinds of changes, it's probably more sustainable to either make changes as suggested by some automated tool, or to leave them, else it's a matter of taste and we end up ping-ponging between preferences Thanks anyway for your comments and for engaging in PR review though, much appreciated! |
xref #22900
Ideally we'd like to make all the examples in our documentation runnable. Seems like in some cases we're using variables without defining them. We should fix them if they are typos, or unimported modules (except
np
andpd
), or we should provide a value if it's just a variable we didn't define.We can get the list of problems with the next command:
The text was updated successfully, but these errors were encountered: