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

tests: config validator is now tested properly #2926

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

karthik11135
Copy link

📝 Description

Tests for the new configuration validator are written (TODO task)

Apart from this, current pr also closes #2917

@andrewfullard kindly take a look. Thanks.

@tardis-bot
Copy link
Contributor

*beep* *bop*

Hi, human.

I'm the @tardis-bot and couldn't find your records in my database. I think we don't know each other, or you changed your credentials recently.

Please add your name and email to .mailmap in your current branch and push the changes to this pull request.

In case you need to map an existing alias, follow this example.

@tardis-bot
Copy link
Contributor

tardis-bot commented Jan 6, 2025

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

5	W291  	[*] Trailing whitespace
2	G004  	[ ] Logging statement uses f-string
2	E712  	[*] Avoid equality comparisons to `False`; use `if not is_quantity(None, quantity_val_2):` for false checks
1	B017  	[ ] `pytest.raises(Exception)` should be considered evil
1	INP001	[ ] File `tardis/io/configuration/tests/test_config_validator.py` is part of an implicit namespace package. Add an `__init__.py`.
1	I001  	[*] Import block is un-sorted or un-formatted
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/configuration/tests/test_config_validator.py:1:1: INP001 File `tardis/io/configuration/tests/test_config_validator.py` is part of an implicit namespace package. Add an `__init__.py`.
tardis/io/configuration/tests/test_config_validator.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/io/configuration/tests/test_config_validator.py:1:14: W291 [*] Trailing whitespace
tardis/io/configuration/tests/test_config_validator.py:8:19: W291 [*] Trailing whitespace
tardis/io/configuration/tests/test_config_validator.py:9:19: W291 [*] Trailing whitespace
tardis/io/configuration/tests/test_config_validator.py:10:19: W291 [*] Trailing whitespace
tardis/io/configuration/tests/test_config_validator.py:23:10: B017 `pytest.raises(Exception)` should be considered evil
tardis/io/configuration/tests/test_config_validator.py:34:12: E712 Avoid equality comparisons to `False`; use `if not is_quantity(None, quantity_val_2):` for false checks
tardis/io/configuration/tests/test_config_validator.py:35:12: E712 Avoid equality comparisons to `True`; use `if is_quantity(None, quantity_val_1):` for truth checks
tardis/io/configuration/tests/test_config_validator.py:69:77: W291 [*] Trailing whitespace
tardis/workflows/standard_tardis_workflow.py:172:13: G004 Logging statement uses f-string
tardis/workflows/standard_tardis_workflow.py:212:17: G004 Logging statement uses f-string
Found 14 errors.
[*] 7 fixable with the `--fix` option (2 hidden fixes can be enabled with the `--unsafe-fixes` option).

@tardis-bot
Copy link
Contributor

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

Significantly changed benchmarks:

All benchmarks:

Benchmarks that have stayed the same:

| Change   | Before [7e37d5fe] <master>   | After [a10f3015]    | Ratio   | Benchmark (Parameter)                                                                                                               |
|----------|------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
|          | 571±100ns                    | 511±200ns           | ~0.89   | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation                                      |
|          | 3.82±0.7μs                   | 3.35±0.6μs          | ~0.88   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell                              |
|          | 2.32±2μs                     | 1.98±2μs            | ~0.85   | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators       |
|          | 63.6±30μs                    | 49.6±30μs           | ~0.78   | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter                                          |
|          | 1.67±0ms                     | 1.78±0.01ms         | 1.07    | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop                             |
|          | 611±100ns                    | 641±200ns           | 1.05    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation                              |
|          | 41.2±20μs                    | 43.3±20μs           | 1.05    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission                                         |
|          | 38.5±0.07s                   | 38.7±0.1s           | 1.01    | run_tardis.BenchmarkRunTardis.time_run_tardis                                                                                       |
|          | 209±0.1ns                    | 210±0ns             | 1.01    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body                                       |
|          | 7.02±2μs                     | 7.11±1μs            | 1.01    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley                                    |
|          | 2.08±0m                      | 2.08±0m             | 1.00    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions                                 |
|          | 1.05±0m                      | 1.04±0m             | 0.99    | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking                                                                      |
|          | 3.48±0.4μs                   | 3.45±0.5μs          | 0.99    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket                                       |
|          | 592±100ns                    | 581±200ns           | 0.98    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation                                |
|          | 1.21±0μs                     | 1.19±0μs            | 0.98    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary                |
|          | 2.74±0.5ms                   | 2.70±0.5ms          | 0.98    | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop                        |
|          | 3.84±0.01ms                  | 3.71±0.03ms         | 0.97    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom')                                   |
|          | 748±2ns                      | 728±0.4ns           | 0.97    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter                                       |
|          | 40.6±0.07μs                  | 39.0±0.08μs         | 0.96    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list                  |
|          | 65.4±0.03ms                  | 62.1±0.5ms          | 0.95    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe                  |
|          | 2.84±0.02ms                  | 2.66±0.01ms         | 0.94    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter')                                     |
|          | 1.46±0.3μs                   | 1.37±0.3μs          | 0.94    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line                    |
|          | 22.3±5μs                     | 21.0±5μs            | 0.94    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list |
|          | 6.50±0.7μs                   | 6.02±1μs            | 0.93    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket                                           |

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

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.

Cannot disable convergence plots
2 participants