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

Spectrum refactor #2689

Merged
merged 20 commits into from
Jul 22, 2024
Merged

Conversation

andrewfullard
Copy link
Contributor

@andrewfullard andrewfullard commented Jul 1, 2024

📝 Description

Type: ☣️ breaking change

This PR moves as much of the spectrum out of the transport state as possible without also factoring out virtual packets.

🚦 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

Note: If you are not allowed to perform any of these actions, ping (@) a contributor.

@andrewfullard
Copy link
Contributor Author

Current issue: need to move and regenerate reference/regression data.

@andrewfullard
Copy link
Contributor Author

Test failures are expected until tardis-sn/tardis-refdata#85 and tardis-sn/tardis-regression-data#8 are merged.


hdf_name = "spectrum"

def __init__(self, transport_state, spectrum_frequency):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Consider renaming spectrum_frequency

Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps frequency_grid? I like names that imply a type if we're not going to annotate


class SpectrumSolver(HDFWriterMixin):
hdf_properties = [
"montecarlo_virtual_luminosity",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we be outputting this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see why not, might at least be useful for debugging

tardis/spectrum/base.py Outdated Show resolved Hide resolved
tardis/spectrum/base.py Outdated Show resolved Hide resolved
tardis/spectrum/base.py Outdated Show resolved Hide resolved
@tardis-bot
Copy link
Contributor

tardis-bot commented Jul 8, 2024

*beep* *bop*

Hi, human.

The docs workflow has succeeded ✔️

Click here to see your results.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

Attention: Patch coverage is 44.31138% with 93 lines in your changes missing coverage. Please review.

Project coverage is 36.61%. Comparing base (c107f27) to head (72c8220).
Report is 6 commits behind head on master.

Files Patch % Lines
tardis/spectrum/tests/test_spectrum_solver.py 35.29% 33 Missing ⚠️
tardis/spectrum/base.py 50.00% 31 Missing ⚠️
tardis/simulation/base.py 20.00% 12 Missing ⚠️
tardis/tests/test_tardis_full.py 44.44% 5 Missing ⚠️
tardis/tests/test_tardis_full_formal_integral.py 57.14% 3 Missing ⚠️
...ardis/transport/montecarlo/montecarlo_main_loop.py 0.00% 3 Missing ⚠️
tardis/spectrum/tests/test_cuda_formal_integral.py 71.42% 2 Missing ⚠️
tardis/transport/montecarlo/base.py 0.00% 2 Missing ⚠️
tardis/transport/montecarlo/packet_collections.py 0.00% 1 Missing ⚠️
tardis/visualization/widgets/line_info.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2689      +/-   ##
==========================================
+ Coverage   36.47%   36.61%   +0.14%     
==========================================
  Files         183      186       +3     
  Lines       14664    14837     +173     
==========================================
+ Hits         5348     5433      +85     
- Misses       9316     9404      +88     

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

@andrewfullard andrewfullard requested a review from Rodot- July 22, 2024 17:42
Rodot-
Rodot- previously approved these changes Jul 22, 2024
Copy link
Contributor

@Rodot- Rodot- left a comment

Choose a reason for hiding this comment

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

This looks good to me overall.


class SpectrumSolver(HDFWriterMixin):
hdf_properties = [
"montecarlo_virtual_luminosity",
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see why not, might at least be useful for debugging


hdf_name = "spectrum"

def __init__(self, transport_state, spectrum_frequency):
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps frequency_grid? I like names that imply a type if we're not going to annotate

@andrewfullard andrewfullard merged commit 33b5ad9 into tardis-sn:master Jul 22, 2024
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants