Skip to content

Only update opacities when needed#12

Open
psheehan wants to merge 33 commits into
mainfrom
only_update_opacities_when_needed
Open

Only update opacities when needed#12
psheehan wants to merge 33 commits into
mainfrom
only_update_opacities_when_needed

Conversation

@psheehan
Copy link
Copy Markdown
Owner

Prior to this PR, opacities are updated on every step, but this is only actually needed if the dust properties change or the photon frequency changes. Additionally, the opacity update happens twice for photons that interact, which is also unneeded. This PR adds tracking of whether a photon needs to have its opacities updated, and only updates them if so.

psheehan added 30 commits April 15, 2026 03:39
- Adding a new `IsotropicDust`, `HenyeyGreensteinDust`, and `GeneralDust` classes to handle different types of dust scattering.
- Move functionality to update opactities for photons/the grid to the *Dust clases so they can each provide the relevant info.
- Pass the camera orientation through the raytracing process to calculate the relevant scattering angles.
…ksca directly as the training data, rather than interpolating to create samples. Also gets more than two constituent species (i.e. greater than 1 abundances array) working.
… of input dust properties, add a helper function to suggest sampling, and add tests.
…acities that are formatted in the new style of providing opacities.
… a better idea of how the model reproduces unseen values.
… tests), and also make test plots go to a non-gui backend for tests.
…t to prevent excessive run times. random_nu samples are prepared in batches to prevent overflowing memory. Get random_nu_ml working again. Update diana_wice dust to the new format, along with the accompanying notebook.
…ties because they are needed for sources. Also only add source intensity if sources are included. For mom0 test do not include sources, and also update test values now that NaNs are fixed.
…ds another place where we need to make sure arctanh(ksi) does not go infinite.
psheehan added 3 commits May 29, 2026 02:34
…perties change; also don't update opacities after frequency change AND after cell properties change - only do once.
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 88.09202% with 88 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.34%. Comparing base (1299f78) to head (e00d0b3).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pinballrt/dust.py 86.34% 80 Missing ⚠️
pinballrt/grids.py 88.00% 6 Missing ⚠️
pinballrt/camera.py 80.00% 1 Missing ⚠️
pinballrt/sources.py 80.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #12      +/-   ##
==========================================
- Coverage   88.82%   88.34%   -0.48%     
==========================================
  Files          11       11              
  Lines        2220     2635     +415     
==========================================
+ Hits         1972     2328     +356     
- Misses        248      307      +59     

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

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.

2 participants