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

Modified the Tracker class in ~plasmapy/diagnostics/charged_particle_… #1830

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Sobeskes
Copy link
Contributor

…radiography.py to run in parallel

Description

Modified ~plasmapy/diagnostics/charged_particle_radiography.py to split array of simulated particles into partitions that are then run in parallel
Added tests to ~plasmapy/diagnostics/tests/test_charged_particle_radiography.py that test performance on extremely large inputs; extremely large tests are left commented to not dramatically slow down the test suite.

Motivation and context

@pheuer identified this as an embarrassingly parallelizable problem in #1728. In theory, by parallelizing this step of the simulation we should see a significant increase in speed performance.

Related issues

This issue was brought up in #1728

@Sobeskes Sobeskes requested review from rocco8773 and a team as code owners December 11, 2022 05:52
@github-actions
Copy link

Thank you for contributing to PlasmaPy! The project's future depends deeply on contributors like you, so we deeply appreciate it! 🌱 The following checklist will be used by the code reviewer to help guide the code review process.

  • Overall
    • Does the PR do what it intends to do?
    • Except for very minor changes, is a changelog entry included and consistent with the changelog guide?
    • Are the continuous integration checks passing? (Most linter problems can be automagically fixed by commenting on this PR with pre-commit.ci autofix.)
  • Code
    • Is new/updated code understandable and consistent with the coding guide?
    • Are there ways to greatly simplify the implementation?
    • Are there any large functions that should be split up into shorter functions?
  • Tests
    • Are tests added/updated as required, and consistent with the testing guide?
    • Are the tests understandable?
    • Do the tests cover all important cases?
  • Docs
    • Are docs added/updated as required, and consistent with the doc guide?
    • Are the docs understandable?
    • Do the docs show up correctly in the preview, including Jupyter notebooks?

@StanczakDominik
Copy link
Member

Going to run pre-commit.ci on this first...

pre-commit.ci autofix

@StanczakDominik StanczakDominik removed the request for review from rocco8773 December 11, 2022 19:32
@StanczakDominik StanczakDominik requested review from StanczakDominik and removed request for a team December 11, 2022 19:34
Copy link
Member

@StanczakDominik StanczakDominik left a comment

Choose a reason for hiding this comment

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

In theory, by parallelizing this step of the simulation we should see a significant increase in speed performance.

In theory, sure! I'm not sure this approach is going to accomplish that - happy to be convinced with data, though! Did you try to benchmark this before and after this change? What kind of speedup, if any, did you get?

This is not really a "reject" based on "needing changes to the code", rather on needing to prove that this works as intended!

@codecov
Copy link

codecov bot commented Dec 11, 2022

Codecov Report

Base: 98.35% // Head: 98.11% // Decreases project coverage by -0.23% ⚠️

Coverage data is based on head (2fac023) compared to base (f10eede).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1830      +/-   ##
==========================================
- Coverage   98.35%   98.11%   -0.24%     
==========================================
  Files          91       94       +3     
  Lines        8246     8351     +105     
==========================================
+ Hits         8110     8194      +84     
- Misses        136      157      +21     
Impacted Files Coverage Δ
...asmapy/diagnostics/charged_particle_radiography.py 100.00% <100.00%> (ø)
plasmapy/particles/particle_class.py 98.49% <0.00%> (-0.51%) ⬇️
plasmapy/formulary/lengths.py 100.00% <0.00%> (ø)
plasmapy/analysis/time_series/__init__.py 100.00% <0.00%> (ø)
plasmapy/__init__.py 33.33% <0.00%> (ø)
plasmapy/analysis/time_series/running_moments.py 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

…eskes/PlasmaPy into parallel-radiography-tracker

Merge changes between auto ci changes and typo change
@Sobeskes
Copy link
Contributor Author

Absolutely, I totally understand! Right now, when testing on extremely large test cases, there seems to be a modest increase of speed, but definitely not what you'd hope to see. My classes are finishing up right now, but when I get more free time I'd be very interested in coming back to see if dask would be the right solution for this. In the mean time, I made a minor typo change in order to include the CI tests in my final report.

@StanczakDominik
Copy link
Member

That makes sense!

Would you mind, then, if I converted this PR to draft for now? I'm trying to be better about reviewing/merging stuff in a timely manner and it helps to keep that effort focused 😉

@StanczakDominik
Copy link
Member

I'm going to take that as a yes, we can always revert the draftiness 😉

@StanczakDominik StanczakDominik marked this pull request as draft December 13, 2022 19:57
@Sobeskes
Copy link
Contributor Author

Absolutely! Sorry for being slow with replying., finals season has been eventful.

@StanczakDominik
Copy link
Member

No worries whatsoever. Good luck with the finals! :)

@namurphy namurphy added the plasmapy.diagnostics Related to the plasmapy.diagnostics subpackage label Mar 29, 2023
@namurphy namurphy added this to the Future milestone Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plasmapy.diagnostics Related to the plasmapy.diagnostics subpackage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants