-
-
Notifications
You must be signed in to change notification settings - Fork 405
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
LIV Plot Tests #2723
LIV Plot Tests #2723
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2723 +/- ##
==========================================
+ Coverage 69.88% 70.74% +0.86%
==========================================
Files 208 209 +1
Lines 15453 15614 +161
==========================================
+ Hits 10799 11046 +247
+ Misses 4654 4568 -86 ☔ View full report in Codecov by Sentry. |
f06b8bd
to
417d978
Compare
e19df22
to
e8a3504
Compare
*beep* *bop* 2 I001 [*] Import block is un-sorted or un-formatted
2 D202 [*] No blank lines allowed after function docstring (found 1)
1 ISC003 [ ] Explicitly concatenated string should be implicitly concatenated
1 RET506 [ ] Unnecessary `elif` after `raise` statement
Complete output(might be large): tardis/visualization/tools/liv_plot.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/visualization/tools/liv_plot.py:25:9: D202 [*] No blank lines allowed after function docstring (found 1)
tardis/visualization/tools/liv_plot.py:48:9: D202 [*] No blank lines allowed after function docstring (found 1)
tardis/visualization/tools/liv_plot.py:341:13: RET506 Unnecessary `elif` after `raise` statement
tardis/visualization/tools/tests/test_liv_plot.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/visualization/tools/tests/test_liv_plot.py:352:29: ISC003 Explicitly concatenated string should be implicitly concatenated
Found 6 errors.
[*] 4 fixable with the `--fix` option.
|
e8a3504
to
ff8e5a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sarthak-dv this looks like a good start. I noted that tests are failing because we need refdata PR to be merged (I've left comment there).
It seems that you're adapting test_sdec like you did when writing module. But sdec tests are using reference data approach. There's a new fixture regression_data which is what you need to use. It looks to me you might be needing sync_hdf_store()
but you should assess how to use it - take a look at tests that are using it for inspiration.
db6cbb0
to
347ca69
Compare
847d07c
to
f068913
Compare
*beep* *bop* Significantly changed benchmarks: All benchmarks: Benchmarks that have stayed the same:
| Change | Before [5fe6806d] <master> | After [4e49e284] | Ratio | Benchmark (Parameter) |
|----------|------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
| | 35.7±10μs | 46.2±20μs | ~1.29 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list |
| | 2.97±0.5ms | 3.39±0.5ms | ~1.14 | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop |
| | 681±200ns | 602±100ns | ~0.88 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation |
| | 2.07±0.03ms | 1.79±0.03ms | ~0.87 | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop |
| | 8.67±2μs | 7.48±2μs | ~0.86 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley |
| | 4.44±0.3ms | 3.74±0.05ms | ~0.84 | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom') |
| | 3.92±0.3μs | 3.01±0.5μs | ~0.77 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket |
| | 1.69±0.4μs | 1.25±0.4μs | ~0.74 | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line |
| | 3.68±0.02ms | 2.69±0ms | ~0.73 | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter') |
| | 69.1±40μs | 46.7±30μs | ~0.68 | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter |
| | 6.76±0.8μs | 7.29±1μs | 1.08 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket |
| | 592±100ns | 601±100ns | 1.02 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation |
| | 730±0.4ns | 743±0.8ns | 1.02 | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter |
| | 65.9±0.2ms | 67.1±0.4ms | 1.02 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe |
| | 203±0.2ns | 204±0.2ns | 1.01 | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body |
| | 541±100ns | 541±100ns | 1.00 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation |
| | 40.8±0.2s | 40.7±0.02s | 1.00 | run_tardis.BenchmarkRunTardis.time_run_tardis |
| | 1.10±0m | 1.10±0m | 1.00 | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking |
| | 1.21±0μs | 1.20±0μs | 1.00 | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary |
| | 30.7±0.01μs | 30.8±0.02μs | 1.00 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list |
| | 2.13±0.01m | 2.09±0m | 0.98 | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions |
| | 45.5±30μs | 44.4±20μs | 0.98 | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission |
| | 2.43±1μs | 2.35±1μs | 0.97 | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators |
| | 3.66±0.3μs | 3.47±0.6μs | 0.95 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell |
If you want to see the graph of the results, you can check it here |
Looks like the data that were merged were not identical to the test outputs. |
Yeah, but if that is the case then macOS tests should also fail along with Ubuntu tests but they are passing. |
94545b0
to
1ee7466
Compare
5dede73
to
d16081b
Compare
Please check black and docstr-cov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for putting a lot of effort into this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for making this work, I know switching to regression data mid-way might be challenging for you @sarthak-dv.
Looks good to me! I see stardis-test failure is unrelated
regression_data = None | ||
species_list = [["Si II", "Ca II", "C", "Fe I-V"], None] | ||
packet_wvl_range = [[3000, 9000] * u.AA] | ||
nelements = [1, None] | ||
packets_mode = ["virtual", "real"] | ||
num_bins = [10] | ||
velocity_range = [(18000, 25000)] | ||
cmapname = ["jet"] | ||
|
||
combinations = list( | ||
product( | ||
species_list, | ||
packet_wvl_range, | ||
packets_mode, | ||
nelements, | ||
num_bins, | ||
velocity_range, | ||
cmapname, | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice use of itertools
Fantastic work @sarthak-dv -- really impressed with the effort you've put into this! |
📝 Description
Type: 🚦
testing
Tests for the Last Interaction Velocity (LIV) Plot.
Add regression data to tardis-regression-data first: tardis-sn/tardis-regression-data#16
📌 Resources
Examples, notebooks, and links to useful references.
🚦 Testing
How did you test these changes?
☑️ Checklist
build_docs
label