forked from PlasmaPy/PlasmaPy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug with proton equality while continuing
Particle.__init__
ref…
…actoring (PlasmaPy#1366) * Add failing test for proton equality bug * Add failing test for Particle("H", Z=1, mass_numb=1) * Add a hack to fix proton equality bug * A hack to try to fix This bug suggests that Particle.__init__ could use some friendly refactoring. * Add changelog entry * More extract method pattern from Particle.__init__ * Create inputs dict in Particle * Use Particle._inputs instead of arguments to methods * More extract method * Move method around * Minor reorganizing * More re-organizing * Rename variable * Use _inputs instead of arguments * Finally proton equality bug * Renaming and reorganization * Simplify naming * Simplify naming * Use _inputs * Minor changes * Minor changes * Minor changes * Minor changes * Minor changes * Renaming variables and some minor reorganization * Renaming variables and reorganization * Slight change to test * Slight change to test * Slight changes to tests * Add second changelog entry * Update docstrings * Remove Particle.__name__ * Remove unnecessary .keys() for dicts * Remove unnecessary .keys() for dicts * Change Particle._inputs to Particle.__inputs * Rename dict containing data about special particles * Remove delattr of Particle.__inputs * Remove unnecessary .keys() for dicts * Remove unnecessary use of .keys() in tests * Remove unnecessary import * Add docstring back for Particle.__init__ Adding this line back because it might be responsible for some documentation test failures that started happening soon after. * Add back Particle.__name__ * Remove docstring for Particle.__init__ * Revert Particle.__name__ line to pre-PR form * Add comment about Particle.__name__ * Updates following code review * Add comment about why protons are being treated specially
- Loading branch information
Showing
13 changed files
with
242 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Fixed a bug with |Particle| where ``Particle("p+") == Particle("H", Z=1, | ||
mass_numb=1)`` led to a |ParticleError|. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Used the extract method refactoring pattern on the initialization of | ||
|Particle| objects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.