8000 Add optional keywords to SyntheticRadiograph to directly control detector orientation & source particle orientation by pheuer · Pull Request #2968 · PlasmaPy/PlasmaPy · GitHub
[go: up one dir, main page]

Skip to content

Add optional keywords to SyntheticRadiograph to directly control detector orientation & source particle orientation#2968

Merged
pheuer merged 6 commits intoPlasmaPy:mainfrom
pheuer:synthetic_radiography_detailed_setup_keywords
Mar 13, 2025
Merged

Add optional keywords to SyntheticRadiograph to directly control detector orientation & source particle orientation#2968
pheuer merged 6 commits intoPlasmaPy:mainfrom
pheuer:synthetic_radiography_detailed_setup_keywords

Conversation

@pheuer
Copy link
Member
@pheuer pheuer commented Mar 13, 2025

The SyntheticRadiography module tracks particles (usually randomly generated by the create_particles method) through a grid onto a detector plane (defined by two perpendicular vectors and a center point). The initial particle velocities are distributed around the source-detector axis.

In the current version, these vectors are set up automatically in a reasonable way (e.g. assuming the detector is looking at the origin, particles go along the source-detector axis). However, experimental setups are sometimes non-ideal, and in those cases the user might want direct control over the orientation of the detector and the initial velocity vector.

This PR just adds a couple keywords to explicitly set the detector_vdir (a keyword already existed for detector_hdir) and the vector around which the velocities of particles in create_particles are centered. Both keywords are optional and default to the previous behavior, so this a non-breaking feature.

Also, corrected a bug in the docs where the default detector_hdir was incorrectly described as (source-detector X Z-axis) when in reality it was (origin-detector X Z-axis).

@pheuer pheuer requested a review from namurphy March 13, 2025 14:04
@github-actions
Copy link

Thank you for submitting this pull request (PR)! ✨ PlasmaPy depends on contributors like you, so we deeply appreciate it!

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! 🌸 We invite you to our weekly community meeting (2 pm ET on most Tuesdays) and office hours (3 pm ET on most Thursdays).

After this PR is marked as ready for review, someone should stop by to provide a code review and offer suggestions soon. 👥 If we don't provide a review within a few days, please feel free to send us a reminder. 🎗

PlasmaPy's contributor guide has information on:

Tip

📚 For a documentation preview, click on Details next to docs/readthedocs.org:plasmapy. For cryptic documentation errors, see the documentation troubleshooting guide.

Tip

🧹 Automatically fix most pre-commit.ci failures by commenting pre-commit.ci autofix below. For other failures, please see the pre-commit troubleshooting guide.

We thank you once again! 🌌

@github-actions github-actions bot added testing plasmapy.diagnostics Related to the plasmapy.diagnostics subpackage python Pull requests that update Python code labels Mar 13, 2025
@codecov
Copy link
codecov bot commented Mar 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.61%. Comparing base (71a4ca9) to head (e4302c9).
Report is 328 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2968      +/-   ##
==========================================
- Coverage   95.40%   94.61%   -0.79%     
==========================================
  Files         107      107              
  Lines        9662     9664       +2     
  Branches     1462     1464       +2     
==========================================
- Hits         9218     9144      -74     
- Misses        257      327      +70     
- Partials      187      193       +6     

☔ 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.

@pheuer pheuer requested a review from a team as a code owner March 13, 2025 14:14
@github-actions github-actions bot added the feature For new functionality, excluding breaking changes label Mar 13, 2025
@pheuer
Copy link
Member Author
pheuer commented Mar 13, 2025

@namurphy I'm sure you probably dread seeing a new CPR PR pop up, but this one should be quick and easy to review! :)

@namurphy
Copy link
Member

@namurphy I'm sure you probably dread seeing a new CPR PR pop up, but this one should be quick and easy to review! :)

In contrast, it brightens my day to see new PRs to PlasmaPy!

Copy link
Member
@namurphy namurphy left a comment

Choose a reason for hiding this comment

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

Thank you for doing this! I have a few suggestions but it looks pretty close to ready to merge.

Copy link
Member
@namurphy namurphy left a comment

Choose a reason for hiding this comment

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

Thank you for the clarifications! Happy to approve this.

To approximately quote Grand Moff Tarkin: "You may [merge] when ready."

@pheuer
Copy link
Member Author
pheuer commented Mar 13, 2025

Thanks!

@pheuer pheuer merged commit 431c351 into PlasmaPy:main Mar 13, 2025
19 checks passed
@pheuer pheuer deleted the synthetic_radiography_detailed_setup_keywords branch January 15, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature For new functionality, excluding breaking changes plasmapy.diagnostics Related to the plasmapy.diagnostics subpackage python Pull requests that update Python code testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0