Skip to content
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

Added examples in documentation to mass_density and Hall_parame… #709

Merged
merged 2 commits into from
Oct 22, 2019
Merged

Added examples in documentation to mass_density and Hall_parame… #709

merged 2 commits into from
Oct 22, 2019

Conversation

diego7319
Copy link
Contributor

-Closes #708.
-Added examples to documentation to mass_density and Hall_parameter functions that were missing.
-Changed a ValueError in mass_density with a clearer message :
From : You must pass a particle (not None) to calculate the mass density!
to: If passing a number density, you must pass a particle (not None) to calculate the mass density!

@diego7319 diego7319 changed the title Added examples to the documentation to mass_density and Hall_parameter functions Added examples in documentation to mass_density and Hall_parameter functions Oct 22, 2019
@codecov
Copy link

codecov bot commented Oct 22, 2019

Codecov Report

Merging #709 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #709   +/-   ##
=======================================
  Coverage   95.02%   95.02%           
=======================================
  Files          57       57           
  Lines        4722     4722           
=======================================
  Hits         4487     4487           
  Misses        235      235
Impacted Files Coverage Δ
plasmapy/formulary/parameters.py 98.9% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0876fb3...a11bbcf. Read the comment docs.

@StanczakDominik
Copy link
Member

Looks like this PR includes a bunch of commits from the asv benchmark PR; would you like me to clean it up for you? :)

@diego7319
Copy link
Contributor Author

Looks like this PR includes a bunch of commits from the asv benchmark PR; would you like me to clean it up for you? :)

yes please , I dont know why that happened

@StanczakDominik
Copy link
Member

That should do it! My best guess is that you stayed on your asv-benchmark branch before creating this new new_examples_doc one instead of switching to master, updating the current repo state via git pull, and then branching out of master. That's the best way to create short single feature branches, as far as I know.

What you did is, by the way, a completely viable strategy when you're making a huge change that you'd prefer to break up into a few parts for easier, "staged" review. 😄

>>> Hall_parameter(1e10 * u.m**-3, 2.8e3 * u.eV, 2.3 * u.T, 'He-4 +1')
<Quantity 7.26446755e+16>
>>> Hall_parameter(1e10 * u.m**-3, 5.8e3 * u.eV, 2.3 * u.T, 'He-4 +1')
<Quantity 3.25995498e+17>
Copy link
Member

@StanczakDominik StanczakDominik Oct 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests seem to output the following value here:

Suggested change
<Quantity 3.25995498e+17>
<Quantity 2.11158408e+17>

I may have messed the particle up while adding whitespace, didn't you have a proton or some such here before?

Anyway, it should be fine to keep it as it is and just modify the value :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just pushed the change

@diego7319
Copy link
Contributor Author

I just deleted that branch, those commits are no longer showing up, is it because that branch is gone or you did something?

@StanczakDominik
Copy link
Member

I just deleted that branch, those commits are no longer showing up, is it because that branch is gone or you did something?

I force-pushed to your branch due to AWESOME MAINTAINER POWERS, it shows up here if you scroll up:

@StanczakDominik force-pushed the diego7319:new_examples_doc branch from 4db44d9 to 8ed818f 9 minutes ago

I forgot to mention but you should now probably git fetch, then git reset origin/new_examples_doc to get the branch state from your github version of this branch.

@StanczakDominik
Copy link
Member

Or keep it deleted, since we're mostly done here!

@StanczakDominik
Copy link
Member

What I did locally, if you're interested, is:

  1. git rebase -i master to drop the previous PR's commits and squash the changes into a single commit, then
  2. git reset --patch master; git commit --amend to clean up some unnecessary white space changes from another commit which you accidentally included.

Nothing like some git magic to start your day :D

@diego7319
Copy link
Contributor Author

diego7319 commented Oct 22, 2019

I'm having some errors during the test process (python setup.py test),
TypeError: calling <function particle_input at 0x000001CC0CCBE678> returned <function particle_input.<locals>.decorator at 0x000001CC05332B88>, not a test

@StanczakDominik
Copy link
Member

python setup.py test is no longer supported after we removed the astropy-helpers submodule, use tox -e py36?

@diego7319
Copy link
Contributor Author

python setup.py test is no longer supported after we removed the astropy-helpers submodule, use tox -e py36?

_______________________________ [doctest] plasmapy.formulary.parameters.Hall_parameter ________________________________ [gw2] win32 -- Python 3.7.4 d:\python\plasmapy\.tox\py36\scripts\python.exe 084 Returns 085 ------- 086 astropy.units.quantity.Quantity 087 088 Examples 089 -------- 090 >>> from astropy import units as u 091 >>> Hall_parameter(1e10 * u.m**-3, 2.8e3 * u.eV, 2.3 * u.T, 'He-4 +1') 092 <Quantity 7.26446755e+16> 093 >>> Hall_parameter(1e10 * u.m**-3, 5.8e3 * u.eV, 2.3 * u.T, 'He-4 +1') Expected: <Quantity 3.25995498e+17> Got: <Quantity 2.11158408e+17>

@StanczakDominik
Copy link
Member

Yeah, I left a suggestion above implementing that exact change - scroll up! I may have messed up the particle while working my git magic - apologies.

@diego7319
Copy link
Contributor Author

diego7319 commented Oct 22, 2019

not problem at all, Im running again tox.
Edit: Passed all the tests. Thanks for your help

Copy link
Member

@StanczakDominik StanczakDominik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @diego7319 ! :)

@StanczakDominik StanczakDominik changed the title Added examples in documentation to mass_density and Hall_parameter functions Added examples in documentation to mass_density and Hall_parame… Oct 22, 2019
@StanczakDominik StanczakDominik merged commit 25676b4 into PlasmaPy:master Oct 22, 2019
@jakub-polak
Copy link
Contributor

Consider to update a documentation that tox is now a recommended way to run tests. I was dealing with outdated procedure described in documentation (http://docs.plasmapy.org/en/stable/development/testing_guide.html) before I came across with this post 😸

@diego7319
Copy link
Contributor Author

Consider to update a documentation that tox is now a recommended way to run tests. I was dealing with outdated procedure described in documentation (http://docs.plasmapy.org/en/stable/development/testing_guide.html) before I came across with this post 😸

like this? assert 2 + 2 == 4, "Addition is broken. Reinstall universe and reboot."

@jakub-polak
Copy link
Contributor

Consider to update a documentation that tox is now a recommended way to run tests. I was dealing with outdated procedure described in documentation (http://docs.plasmapy.org/en/stable/development/testing_guide.html) before I came across with this post smile_cat

like this? assert 2 + 2 == 4, "Addition is broken. Reinstall universe and reboot."

Yea, seems to be clear enough 👍

@rocco8773 rocco8773 added plasmapy.formulary Related to the plasmapy.formulary subpackage docs PlasmaPy Docs at http://docs.plasmapy.org labels Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs PlasmaPy Docs at http://docs.plasmapy.org plasmapy.formulary Related to the plasmapy.formulary subpackage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Posible bug in function mass_density
4 participants