-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
Moves non-physical input check outsode I/O module #2923
Conversation
*beep* *bop* 2 I001 [*] Import block is un-sorted or un-formatted
1 G004 [ ] Logging statement uses f-string
1 INP001 [ ] File `tardis/radiation_field/validate_radiation_field.py` is part of an implicit namespace package. Add an `__init__.py`.
1 E999 [ ] SyntaxError: Expected an expression
1 W292 [*] No newline at end of file
Complete output(might be large): .mailmap:1:38: E999 SyntaxError: Expected an expression
.mailmap:292:39: W292 [*] No newline at end of file
tardis/io/model/parse_radiation_field_configuration.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/radiation_field/validate_radiation_field.py:1:1: INP001 File `tardis/radiation_field/validate_radiation_field.py` is part of an implicit namespace package. Add an `__init__.py`.
tardis/radiation_field/validate_radiation_field.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/radiation_field/validate_radiation_field.py:25:13: G004 Logging statement uses f-string
Found 6 errors.
[*] 3 fixable with the `--fix` option.
|
*beep* *bop* Significantly changed benchmarks: All benchmarks: Benchmarks that have stayed the same:
| Change | Before [7e37d5fe] <master> | After [0fdc3fbf] | Ratio | Benchmark (Parameter) |
|----------|------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
| | 1.32±0.3μs | 1.65±0.4μs | ~1.25 | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line |
| | 531±200ns | 652±100ns | ~1.23 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation |
| | 3.44±0.8μs | 3.09±0.3μs | ~0.90 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket |
| | 2.16±2μs | 1.88±2μs | ~0.87 | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators |
| | 45.9±20μs | 50.4±20μs | 1.10 | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission |
| | 2.56±0.5ms | 2.71±0.5ms | 1.06 | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop |
| | 571±200ns | 601±300ns | 1.05 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation |
| | 1.17±0μs | 1.22±0μs | 1.04 | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary |
| | 6.03±0.9μs | 6.29±0.7μs | 1.04 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket |
| | 1.65±0.1ms | 1.68±0ms | 1.02 | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop |
| | 64.6±0.2ms | 65.1±1ms | 1.01 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe |
| | 3.42±0.4μs | 3.46±0.5μs | 1.01 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell |
| | 2.83±0.02ms | 2.84±0.03ms | 1.00 | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter') |
| | 1.05±0m | 1.04±0m | 1.00 | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking |
| | 2.08±0m | 2.08±0m | 1.00 | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions |
| | 48.9±20μs | 49.0±30μs | 1.00 | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter |
| | 3.76±0.02ms | 3.70±0.02ms | 0.99 | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom') |
| | 38.6±0.06s | 38.2±0.08s | 0.99 | run_tardis.BenchmarkRunTardis.time_run_tardis |
| | 20.2±5μs | 20.1±5μs | 0.99 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list |
| | 7.36±2μs | 7.29±1μs | 0.99 | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley |
| | 541±100ns | 531±200ns | 0.98 | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation |
| | 740±0.8ns | 726±2ns | 0.98 | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter |
| | 208±0.01ns | 203±0.1ns | 0.97 | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body |
| | 38.9±0.03μs | 37.8±0.1μs | 0.97 | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list |
If you want to see the graph of the results, you can check it here |
Hi @wkerzendorf @Knights-Templars @atharva-2001 @andrewfullard @epassaro , |
pyproject.toml
Outdated
@@ -190,5 +190,5 @@ owner = "tardis-sn" | |||
repo = "tardis" | |||
|
|||
[tool.codespell] | |||
skip = "*.png,*.ggb,*.jpg,*.gif,*.ico,docs/contributing/CHANGELOG.md,docs/tardis.bib" | |||
skip = "*.ipynb,*.png,*.ggb,*.jpg,*.gif,*.ico,docs/contributing/CHANGELOG.md,docs/tardis.bib,docs/resources/research_done_using_TARDIS/research_papers.rst" |
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.
Why is this change included?
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.
To avoid codespell job failure like it is mentioned in #2908 but it is not merged yet, hence included in 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.
A PR should ideally have only one purpose, and this will lead to merge conflicts that must be resolved once #2908 is merged
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.
Sorry, I got your point, will make sure this does not repeat.
tardis/physics/radiation_field.py
Outdated
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.
Why should validation be in a directory called "physics"?
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.
I understood the title of #2681, 'Move ... to a physics module,' as meaning to move it to a physics directory (module). Sorry if I misunderstood.
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.
I see. The term was meant generically, because most of TARDIS consists of modules that calculate physics. Thus these checks should be placed in the most relevant pre-existing module.
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.
Okay understood, I'll make the necessary changes.
@andrewfullard |
Also @andrewfullard , |
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.
I think "validate_radiation_field" would be a better name
@andrewfullard , |
Hi @andrewfullard @jvshields , |
📝 Description
Type: 🎢
infrastructure
Created a module named
physics
for storing theradiation_field.py
(validation) separately outside I/O module and modified necessary few lines ofparse_radiation_field_configuration.py
Closes #2681
📌 Resources
Examples, notebooks, and links to useful references.
🚦 Testing
How did you test these changes?
☑️ Checklist
build_docs
label