-
Notifications
You must be signed in to change notification settings - Fork 306
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
Consolidate separate functions for ions and electrons in plasma parameter calculations #140
Consolidate separate functions for ions and electrons in plasma parameter calculations #140
Conversation
Hello @RoberTnf! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on October 04, 2017 at 12:11 Hours UTC |
Why do I lack coverage in parts of the code that I didn't touch? |
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.
Good stuff overall! By the way, am I right in guessing you're using PyCharm or some other IDE? :D
plasmapy/physics/parameters.py
Outdated
distribution. | ||
def thermal_speed(T, particle="e"): | ||
r"""Returns the most probable speed for an particle within a Maxwellian | ||
distributparticle. |
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.
What's a distributparticle? ;)
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.
Is a distribution that also accepts electrons.
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.
Ooooh wait, I get it. It's like a distribution, but particle? Does this exhaust the pun limit for physics
? 😄
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 an accidental pun, it's what happens when you try to replace the mentions to ion
with particle
. I will fix it 😄
plasmapy/physics/parameters.py
Outdated
@@ -380,7 +380,7 @@ def thermal_speed(T, ion="e"): | |||
>>> from astropy import units as u | |||
>>> thermal_speed(5*u.eV, 'p') |
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.
Do you think you could add an example for the default (electron) value here?
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.
I think that's is covered in line 386: thermal_speed(5*u.eV)
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.
... huh, it is. Sorry, I missed it somehow!
plasmapy/physics/parameters.py
Outdated
def ion_plasma_frequency(n_i, ion='p'): | ||
r"""Calculates the ion plasma frequency. | ||
def plasma_frequency(n, particle='e'): | ||
r"""Calculates the particle plasma frequency. |
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.
"Defaults to the fastest, electron plasma frequency.". How's that sound?
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.
I don't understand what you mean.
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.
I mean we could change the beginning of this docstring like this:
"""Calculates the particle plasma frequency. Defaults to the fastest, electron plasma frequency.
The default behavior of this function seems important enough to mention it straight away :)
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.
Ahh, Ok, sounds fine. Should something similar be done for every other function I modified?
I'm using VS Code, why? |
Well, your renaming commits come really fast, it's nice to see this kind of proficiency :D |
I'm not sure whether it's really necessary for all of them. The plasma
frequency sort of stood out to me as I was just reading about it like two
days ago. I think we can live without changing it in most of these
functions!
…On 4 October 2017 at 12:34, Roberto Díaz Pérez ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In plasmapy/physics/parameters.py
<#140 (comment)>:
> })
-def ion_plasma_frequency(n_i, ion='p'):
- r"""Calculates the ion plasma frequency.
+def plasma_frequency(n, particle='e'):
+ r"""Calculates the particle plasma frequency.
Ahh, Ok, sounds fine. Should something similar be done for every other
function I modified?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#140 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKxDL52ZhLpphZj3YjQEkqhAumqaIIdRks5so18ugaJpZM4PsbyS>
.
|
4c49d56
to
e78c189
Compare
I think that's everything, unless I missed something! |
Apparently we still have some conflicts on merge, probably because of the doctest thing I merged lately. Could you look into that? :) |
Ok, I'll try later! |
So after solving the conflicts I am not able to run pytest, it's trying to run docs/example.py, and obviously it can't. I suppose this is a separate issue but I'm not sure if it's something I did wrong. |
Oh yeah, there was a fix in master to this one. Check out these two lines and make sure that's in your code. In fact, with a proper merge from master this should be working, but git accidents happen all the time. |
I closed this by accident, sorry, not used to github. I have those lines, I've pulled master, but I get:
|
Happens to everyone :) This is something we'll have to fix - as a workaround, run it as |
Aaaand congratulations @RoberTnf ! :D |
Closing #106
The checklist of things to do are:
I will be updating as I progress with the tasklist.