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

Use @particle_input decorator on functions in collisions.py #493

Merged
merged 3 commits into from Jun 10, 2018

Conversation

Projects
None yet
3 participants
@ritiek
Copy link
Contributor

ritiek commented Jun 10, 2018

Addresses #336.

I've used @particle_input decorator wherever possible on functions in collisions.py. Also, replaced TypeError with a ValueError in particle_input when number of input elements do not match expected elements in the tuple passed, since it seems more fitting. :)

@codecov

This comment has been minimized.

Copy link

codecov bot commented Jun 10, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #493   +/-   ##
=======================================
  Coverage   93.18%   93.18%           
=======================================
  Files          70       70           
  Lines        6871     6871           
=======================================
  Hits         6403     6403           
  Misses        468      468
Impacted Files Coverage Δ
plasmapy/physics/transport/collisions.py 99.06% <100%> (ø) ⬆️
plasmapy/atomic/tests/test_particle_input.py 86.95% <100%> (ø) ⬆️
plasmapy/atomic/particle_input.py 100% <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 de0d095...4977f0c. Read the comment docs.

@StanczakDominik
Copy link
Member

StanczakDominik left a comment

Neat stuff! I've got one doubt that could use resolving...

@@ -242,7 +242,7 @@ def wrapper(*args, **kwargs):
expected_params = len(annotated_argnames)
received_params = len(arguments[argname])
if not expected_params == received_params:
raise TypeError(
raise ValueError(

This comment has been minimized.

Copy link
@StanczakDominik

StanczakDominik Jun 10, 2018

Member

This will probably take an update in the docstring

This comment has been minimized.

Copy link
@ritiek

ritiek Jun 10, 2018

Author Contributor

Okay. I pushed some changes. Let me know if we need changes in the wording.

@StanczakDominik
Copy link
Member

StanczakDominik left a comment

Cool stuff! I guess there's nothing left to do here before merging, right?

@ritiek

This comment has been minimized.

Copy link
Contributor Author

ritiek commented Jun 10, 2018

Yep, I don't think so. This should be ready to merge.

@StanczakDominik

This comment has been minimized.

Copy link
Member

StanczakDominik commented Jun 10, 2018

All right, then, thanks!

@StanczakDominik StanczakDominik merged commit 3673ddb into PlasmaPy:master Jun 10, 2018

5 checks passed

ci/circleci: test-html Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 93.18%)
Details
codecov/project 93.18% (+0%) compared to de0d095
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ritiek ritiek deleted the ritiek:particle-input-in-collisions branch Jun 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.