Skip to content

Conversation

@namurphy
Copy link
Member

@namurphy namurphy commented Mar 21, 2024

#2048 describes a problem where particle categorization criteria were not being applied when a ParticleList was being supplied to a function decorated with @particle_input.

The essense of the error was that a list containing any objects will be interpreted as true, even if the objects the list contains are False.

>>> bool([False, False, False])
True

The improvements in #2648 led to a much cleaner implementation here than I had first attempted (hence the relatively long commit history).

Closes #2048.

@github-actions github-actions bot added plasmapy.particles Related to the plasmapy.particles subpackage testing labels Mar 21, 2024
@namurphy namurphy added the bugfix Pull requests that fix a bug. Remember: a bug is a sign of a missing test! label Mar 21, 2024
@github-actions github-actions bot added the bug Issues describing unexpected behavior or defects. Remember: a bug is a sign of a missing test! label Mar 21, 2024
@codecov
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.21%. Comparing base (221e4b7) to head (5cc24a5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2594   +/-   ##
=======================================
  Coverage   95.20%   95.21%           
=======================================
  Files         103      103           
  Lines        9414     9412    -2     
  Branches     2156     2155    -1     
=======================================
- Hits         8963     8962    -1     
+ Misses        274      273    -1     
  Partials      177      177           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@namurphy
Copy link
Member Author

pre-commit.ci autofix

@namurphy namurphy added this to the v2024.5.0 milestone Apr 9, 2024
@namurphy
Copy link
Member Author

namurphy commented May 4, 2024

This PR is partially superseded by #2648. I might close this and open a follow-up PR to add the tests from this PR to make sure the bug is fixed. Ultimately, I think #2648 will make this PR or its follow-up easier and cleaner.

namurphy added a commit to namurphy/PlasmaPy that referenced this pull request May 6, 2024
@namurphy namurphy marked this pull request as ready for review May 8, 2024 00:30
@namurphy namurphy requested a review from a team as a code owner May 8, 2024 00:30
@namurphy namurphy requested review from ejohnson-96 and removed request for a team May 8, 2024 00:30
Copy link
Contributor

@ejohnson-96 ejohnson-96 left a comment

Choose a reason for hiding this comment

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

👍

@namurphy namurphy merged commit 84fbedb into PlasmaPy:main May 8, 2024
@namurphy namurphy deleted the particle-input-list-categorization-criteria branch May 8, 2024 17:07
@namurphy namurphy removed the bug Issues describing unexpected behavior or defects. Remember: a bug is a sign of a missing test! label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull requests that fix a bug. Remember: a bug is a sign of a missing test! plasmapy.particles Related to the plasmapy.particles subpackage testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@particle_input does not apply categorization criteria when creating a ParticleList

2 participants