-
Notifications
You must be signed in to change notification settings - Fork 308
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 __str__
method to CustomParticle
class.
#2702
Conversation
Thank you for submitting a pull request (PR) to PlasmaPy! ✨ The future of the project depends on contributors like you, so we deeply appreciate it! 🌱 Our contributor guide has information on:
Important PlasmaPy recently switched to an The bottom of this page shows several checks that are run for every PR. Don't worry if something broke! We break stuff all the time. 😺 Click on "Details" to learn why a check didn't pass. Please also feel free to ask for help. We do that all the time as well. 🌸 You can find us in our chat room or weekly community meeting & office hours. Here are some tips:
If this PR is marked as ready for review, someone should stop by to provide a code review and offer suggestions soon. ✅ If you don't get a review within a few days, please feel free to send us a reminder. Please also use SI units within PlasmaPy, except when there is strong justification otherwise or in some examples. We thank you once again! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2702 +/- ##
==========================================
- Coverage 95.25% 95.23% -0.02%
==========================================
Files 104 104
Lines 9435 9399 -36
Branches 2159 2155 -4
==========================================
- Hits 8987 8951 -36
Misses 272 272
Partials 176 176 ☔ View full report in Codecov by Sentry. |
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.
Thank you for adding this! It will be helpful to have CustomParticle
and Particle
objects behave the same when provided to repr
. I have some minor suggestions and otherwise we can probably get this in pretty quickly. Thank you again!
Co-authored-by: Nick Murphy <[email protected]>
Co-authored-by: Nick Murphy <[email protected]>
Co-authored-by: Nick Murphy <[email protected]>
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! 🚀 Thank you for doing this! 🙏🏻
Description
Adds the method
__str__
that calls the symbol getter of theCustomParticle
class.Motivation and context
This makes the behavior of custom particle instances consistent with that of other particle objects, With a fallback to the repr if no symbol was provided.
Related issues
Closes #2701