Skip to content

Refactor test particles#37

Merged
henry2004y merged 6 commits into
mainfrom
tp-refactor
Jul 15, 2025
Merged

Refactor test particles#37
henry2004y merged 6 commits into
mainfrom
tp-refactor

Conversation

@henry2004y

@henry2004y henry2004y commented Jul 15, 2025

Copy link
Copy Markdown
Owner

This PR refactors the internals of the test particle module. More specifically,

  • Add a new ParticleTrajectory class to combine the particle ID and particle data together.
  • Refactor get_data with __getitem__, for more native Python operations.
  • Add utility methods for obtaining vectors directly, get_kinetic_energy, get_pitch_angle, get_pitch_angle_from_v_b, and get_first_adiabatic_invariant. This can be further improved later.
  • Add a more thorough type == "full" trajectory plot.

@henry2004y henry2004y changed the title Add ParticleTrajectory class; refactor get_data; add utility functions Refactor test particles Jul 15, 2025
@codecov

codecov Bot commented Jul 15, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 42.16867% with 96 lines in your changes missing coverage. Please review.

Project coverage is 52.94%. Comparing base (ca49b0a) to head (ece81ea).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/flekspy/tp/test_particles.py 38.06% 96 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #37      +/-   ##
==========================================
- Coverage   55.56%   52.94%   -2.62%     
==========================================
  Files          12       12              
  Lines        1726     1800      +74     
==========================================
- Hits          959      953       -6     
- Misses        767      847      +80     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@henry2004y henry2004y marked this pull request as ready for review July 15, 2025 15:31
@henry2004y henry2004y merged commit 15e5d5e into main Jul 15, 2025
1 of 3 checks passed
@henry2004y henry2004y deleted the tp-refactor branch July 15, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant