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

Weighted Packet Sampler #2718

Merged
merged 19 commits into from
Jul 27, 2024
Merged

Conversation

Rodot-
Copy link
Contributor

@Rodot- Rodot- commented Jul 18, 2024

📝 Description

Type: 🚀 feature

Creates a basic weighted packet sampler. This sampler samples packets uniformly in frequency and then assigns energy weights based on the corresponding black body intensity at each frequency.

🚦 Testing

How did you test these changes?

  • Testing pipeline
  • Other method (describe)
  • My changes can't be tested (explain why)

☑️ Checklist

  • I requested two reviewers for this pull request
  • I updated the documentation according to my changes
  • I built the documentation by applying the build_docs label

…formly in frequency space then assigns energy to each packet based on their black body amplitude
@Rodot- Rodot- marked this pull request as draft July 18, 2024 13:58
@Rodot- Rodot- self-assigned this Jul 18, 2024
Copy link

codecov bot commented Jul 18, 2024

Codecov Report

Attention: Patch coverage is 97.59036% with 2 lines in your changes missing coverage. Please review.

Project coverage is 69.27%. Comparing base (c107f27) to head (40e14c2).
Report is 20 commits behind head on master.

Files Patch % Lines
...dis/transport/montecarlo/weighted_packet_source.py 92.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2718       +/-   ##
===========================================
+ Coverage   36.47%   69.27%   +32.79%     
===========================================
  Files         183      191        +8     
  Lines       14664    15018      +354     
===========================================
+ Hits         5348    10403     +5055     
+ Misses       9316     4615     -4701     

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

…gainst the regression data for the montecarlo_main_loop with the default packet source
@tardis-bot
Copy link
Contributor

tardis-bot commented Jul 19, 2024

*beep* *bop*
Hi human,
I ran benchmarks as you asked comparing master (bdf2df3) and the latest commit (40e14c2).
Here are the logs produced by ASV.
Results can also be downloaded as artifacts here.

Significantly changed benchmarks:

· Did not find results for commit 40e14c23b82ea280288e39838aadda0b880dcebb

All benchmarks:

· Did not find results for commit 40e14c23b82ea280288e39838aadda0b880dcebb

If you want to see the graph of the results, you can check it here

@Rodot- Rodot- marked this pull request as ready for review July 22, 2024 14:53
andrewfullard
andrewfullard previously approved these changes Jul 22, 2024
Copy link
Contributor

@andrewfullard andrewfullard left a comment

Choose a reason for hiding this comment

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

Approved pending regression data changes

andrewfullard
andrewfullard previously approved these changes Jul 22, 2024
npt.assert_allclose(
actual_nu_bar_estimator, expected_nu_bar_estimator, rtol=1e-2
)
npt.assert_allclose(actual_j_estimator, expected_j_estimator, rtol=1e-2)
Copy link
Member

Choose a reason for hiding this comment

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

Why are you using rtol upto two decimal places?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it is checking consistency with the default sampler rather than with itself. It is to make sure we're getting approximately the same solution

Copy link
Member

Choose a reason for hiding this comment

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

I am happy to approve if the tests passes.

wkerzendorf
wkerzendorf previously approved these changes Jul 25, 2024
@andrewfullard
Copy link
Contributor

Tests are failing because the classes aren't inheriting properly it seems.

@tardis-bot
Copy link
Contributor

tardis-bot commented Jul 26, 2024

*beep* *bop*
Hi human,
I ran ruff on the latest commit (40e14c2).
Here are the outputs produced.
Results can also be downloaded as artifacts here.
Summarised output:

Complete output(might be large):

@andrewfullard
Copy link
Contributor

It would be nice to have a demonstrative notebook

@Rodot- Rodot- closed this Jul 26, 2024
@Rodot- Rodot- reopened this Jul 26, 2024
@Rodot-
Copy link
Contributor Author

Rodot- commented Jul 26, 2024

It would be nice to have a demonstrative notebook

Since there's already a notebook for using custom samplers, it might be better to wait until we have a workflow that can demonstrate it

@andrewfullard andrewfullard enabled auto-merge (squash) July 26, 2024 16:25
@Rodot- Rodot- requested a review from wkerzendorf July 26, 2024 16:47
@andrewfullard andrewfullard merged commit 4514036 into tardis-sn:master Jul 27, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants