-
Notifications
You must be signed in to change notification settings - Fork 335
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
Rename integer charge to charge number #1136
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov Report
@@ Coverage Diff @@
## master #1136 +/- ##
==========================================
+ Coverage 96.90% 96.92% +0.01%
==========================================
Files 70 71 +1
Lines 6953 6992 +39
==========================================
+ Hits 6738 6777 +39
Misses 215 215
Continue to review full report at Codecov.
|
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 in general; test failures seem to point to a mis-import probably since 5d2d129; the doc failure is unrelated (see Element). A couple of docstring mishaps in there.
...since changes to integer_charge should be made known to the end user.
...and use ReST markup for ionic notation while I'm at it.
I'm not sure why sections of docstrings ended up getting repeated. It could have been a mishap with auto-renaming via PyCharm, though it could have been a side effect of coding while listening to a BBC dramatization of my favorite book series. 🐉 In any case, I'll need to double check for this problem before this gets merged, and I have a few other things I need to finish up too. Thanks for finding that! |
My to do list for this PR and beyond. It's mostly tedious work at this point.
|
Probably don't need to have exhaustive tests for integer_charge if it's just going to be a deprecated alias for charge_number! |
Very true. I was planning on having maybe one or two tests for each function/method...just enough to make sure it works. |
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.
Add a stub file in docs/api_static
for plasmapy.utils.decorators.deprecation
.
Co-authored-by: Erik Everson <eteverson@gmail.com>
def test_integer_charge(): | ||
with pytest.warns(PlasmaPyFutureWarning): | ||
assert integer_charge("Fe 20+") == 20 |
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.
If you want to be thorough, then it would be worthwhile to do a mock
test here to ensure integer_charge
calls charge_number
. It's a bit overkill, but it does enforce the connection between the two.
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.
It's probably more effort than is worth it for a deprecated feature, though this idea is worth keeping in mind for future features that we intend to keep around for a while.
Do you want to merge #1073 first because it sure looks like you branched this PR off of that one? If so, that would avoid the scope creep of this PR. |
I'd rather merge this one first and then go back to #1073 and enjoy the wonders of resolving git conflicts. Thanks for the quick review! (Also: it's amazing how productive I can be when I'm procrastinating writing emails that I don't want to write.) |
Looks like the stub file is in there, and I didn't see any more issues being raised!
This PR replaces usage of the term "integer charge" and code elements named like
integer_charge
with the term "charge number" andcharge_number
. This is because charge number is the technical name for this concept (see #1126). The things named after "integer charge" are going to be kept for a few releases and then removed.As part of this PR, I'm likely going to use a variant of the
astropy.utils.decorators.deprecated
decorator.Closes #1126. Closes #945.