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

add a test to line info #2947

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

Conversation

karthik11135
Copy link

📝 Description

get middle half edges test is added

@tardis-bot
Copy link
Contributor

tardis-bot commented Jan 13, 2025

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

28	W291  	[*] Trailing whitespace
14	E999  	[ ] SyntaxError: Expected ',', found ':'
10	E902  	[ ] No such file or directory (os error 2)
5	G004  	[ ] Logging statement uses f-string
5	I001  	[*] Import block is un-sorted or un-formatted
5	E712  	[*] Avoid equality comparisons to `False`; use `if not ...:` for false checks
5	W293  	[*] Blank line contains whitespace
5	F401  	[ ] `tardis.plasma.equilibrium.rates.collision_strengths.UpsilonCMFGENSolver` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
4	RET505	[ ] Unnecessary `else` after `return` statement
3	W292  	[*] No newline at end of file
2	PTH117	[ ] `os.path.isabs()` should be replaced by `Path.is_absolute()`
2	W605  	[*] Invalid escape sequence: `\A`
1	ANN204	[ ] Missing return type annotation for special method `__getitem__`
1	INP001	[ ] File `tardis/opacities/tests/test_opacity_state_numba.py` is part of an implicit namespace package. Add an `__init__.py`.
1	RET506	[ ] Unnecessary `else` after `raise` statement
1	D202  	[*] No blank lines allowed after function docstring (found 1)
1	D406  	[*] Section name should end with a newline ("Returns")
1	D407  	[*] Missing dashed underline after section ("Returns")
1	F541  	[*] f-string without any placeholders
1	F811  	[ ] Redefinition of unused `monkeysession` from line 7

Complete output(might be large):

.github/actions/setup_env/action.yml:4:8: E999 SyntaxError: Expected an expression
.github/actions/setup_env/action.yml:17:1: W293 [*] Blank line contains whitespace
.github/actions/setup_env/action.yml:19:15: W291 [*] Trailing whitespace
.github/actions/setup_env/action.yml:24:1: W293 [*] Blank line contains whitespace
.github/actions/setup_lfs/action.yml:5:8: E999 SyntaxError: Expected an expression
.github/workflows/benchmarks.yml:3:4: E999 SyntaxError: Expected an expression
.github/workflows/benchmarks.yml:20:5: W291 [*] Trailing whitespace
.github/workflows/benchmarks.yml:87:49: W291 [*] Trailing whitespace
.github/workflows/benchmarks.yml:117:81: W291 [*] Trailing whitespace
.github/workflows/benchmarks.yml:118:54: W291 [*] Trailing whitespace
.github/workflows/benchmarks.yml:205:1: W293 [*] Blank line contains whitespace
.github/workflows/benchmarks.yml:224:22: W291 [*] Trailing whitespace
.github/workflows/benchmarks.yml:225:170: W291 [*] Trailing whitespace
.github/workflows/benchmarks.yml:227:84: W291 [*] Trailing whitespace
.github/workflows/benchmarks.yml:244:1: W293 [*] Blank line contains whitespace
.github/workflows/build-docs.yml:7:4: E999 SyntaxError: Expected an expression
.github/workflows/lfs-cache.yml:1:1: E902 No such file or directory (os error 2)
.github/workflows/tests.yml:7:4: E999 SyntaxError: Expected an expression
.mailmap:1:38: E999 SyntaxError: Expected an expression
.mailmap:294:39: W292 [*] No newline at end of file
CHANGELOG.md:4:15: E999 SyntaxError: Expected ',', found ':'
CITATION.cff:3:1: E999 SyntaxError: Invalid annotated assignment target
README.rst:1:1: E999 SyntaxError: Expected a statement
docs/contributing/development/benchmarks.rst:1:1: E999 SyntaxError: Expected a statement
docs/contributing/development/continuous_integration.rst:1:1: E999 SyntaxError: Expected a statement
docs/contributing/development/continuous_integration.rst:16:76: W291 [*] Trailing whitespace
docs/contributing/development/continuous_integration.rst:18:68: W291 [*] Trailing whitespace
docs/contributing/development/continuous_integration.rst:21:92: W291 [*] Trailing whitespace
docs/contributing/development/continuous_integration.rst:22:86: W291 [*] Trailing whitespace
docs/contributing/development/continuous_integration.rst:48:1: W293 [*] Blank line contains whitespace
docs/contributing/development/continuous_integration.rst:82:70: W291 [*] Trailing whitespace
docs/contributing/development/continuous_integration.rst:97:78: W291 [*] Trailing whitespace
docs/contributing/development/continuous_integration.rst:98:94: W291 [*] Trailing whitespace
docs/contributing/development/continuous_integration.rst:99:83: W291 [*] Trailing whitespace
docs/contributing/development/continuous_integration.rst:100:96: W291 [*] Trailing whitespace
docs/contributing/development/continuous_integration.rst:102:97: W291 [*] Trailing whitespace
docs/contributing/development/continuous_integration.rst:103:62: W291 [*] Trailing whitespace
docs/contributing/development/continuous_integration.rst:110:90: W291 [*] Trailing whitespace
docs/contributing/development/continuous_integration.rst:111:19: W292 [*] No newline at end of file
docs/contributing/development/running_tests.rst:1:1: E999 SyntaxError: Expected a statement
docs/contributing/development/running_tests.rst:59:112: W291 [*] Trailing whitespace
docs/contributing/development/running_tests.rst:60:124: W291 [*] Trailing whitespace
docs/contributing/development/running_tests.rst:64:92: W291 [*] Trailing whitespace
docs/contributing/development/running_tests.rst:65:107: W291 [*] Trailing whitespace
docs/contributing/development/running_tests.rst:75:62: W291 [*] Trailing whitespace
docs/contributing/development/running_tests.rst:76:85: W292 [*] No newline at end of file
docs/io/output/how_to_rpacket_tracking.ipynb:cell 12:1:62: W291 [*] Trailing whitespace
docs/physics/plasma/equilibrium/tardis_solver_cmfgen.ipynb:1:1: E902 No such file or directory (os error 2)
docs/physics/setup/model.ipynb:cell 2:2:1: I001 [*] Import block is un-sorted or un-formatted
docs/physics/setup/model.ipynb:cell 25:19:12: F541 [*] f-string without any placeholders
docs/quickstart.ipynb:cell 12:1:39: W291 [*] Trailing whitespace
docs/quickstart.ipynb:cell 12:5:35: W291 [*] Trailing whitespace
docs/quickstart.ipynb:cell 16:10:26: W605 [*] Invalid escape sequence: `\A`
docs/quickstart.ipynb:cell 16:11:40: W605 [*] Invalid escape sequence: `\A`
docs/resources/credits.rst:1:1: E999 SyntaxError: Expected a statement
docs/workflows/v_inner_solver_workflow.ipynb:1:1: E902 No such file or directory (os error 2)
tardis/io/configuration/config_reader.py:53:29: G004 Logging statement uses f-string
tardis/io/configuration/config_reader.py:117:9: RET505 Unnecessary `else` after `return` statement
tardis/io/configuration/config_reader.py:141:13: RET505 Unnecessary `else` after `return` statement
tardis/io/configuration/config_reader.py:218:29: G004 Logging statement uses f-string
tardis/io/configuration/schemas/montecarlo_definitions.yml:1:13: E999 SyntaxError: Expected an expression
tardis/io/model/parse_geometry_configuration.py:50:12: PTH117 `os.path.isabs()` should be replaced by `Path.is_absolute()`
tardis/model/base.py:340:12: PTH117 `os.path.isabs()` should be replaced by `Path.is_absolute()`
tardis/model/base.py:375:21: G004 Logging statement uses f-string
tardis/opacities/macro_atom/macroatom_state.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/opacities/opacity_state.py:210:9: ANN204 Missing return type annotation for special method `__getitem__`
tardis/opacities/opacity_state.py:216:9: D407 [*] Missing dashed underline after section ("Returns")
tardis/opacities/opacity_state.py:216:9: D406 [*] Section name should end with a newline ("Returns")
tardis/opacities/opacity_state.py:251:5: D202 [*] No blank lines allowed after function docstring (found 1)
tardis/opacities/tests/__init__.py:1:1: E902 No such file or directory (os error 2)
tardis/opacities/tests/test_opacity_state_numba.py:1:1: INP001 File `tardis/opacities/tests/test_opacity_state_numba.py` is part of an implicit namespace package. Add an `__init__.py`.
tardis/opacities/tests/test_opacity_state_numba.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/plasma/equilibrium/rates/__init__.py:2:5: F401 `tardis.plasma.equilibrium.rates.collision_strengths.UpsilonCMFGENSolver` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
tardis/plasma/equilibrium/rates/__init__.py:3:5: F401 `tardis.plasma.equilibrium.rates.collision_strengths.UpsilonRegemorterSolver` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
tardis/plasma/equilibrium/rates/__init__.py:6:5: F401 `tardis.plasma.equilibrium.rates.collisional_rates.ThermalCollisionalRateSolver` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
tardis/plasma/equilibrium/rates/__init__.py:9:5: F401 `tardis.plasma.equilibrium.rates.radiative_rates.RadiativeRatesSolver` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
tardis/plasma/equilibrium/rates/collisional_ionization_rates.py:1:1: E902 No such file or directory (os error 2)
tardis/plasma/equilibrium/rates/collisional_ionization_strengths.py:1:1: E902 No such file or directory (os error 2)
tardis/plasma/equilibrium/rates/photoionization_rates.py:1:1: E902 No such file or directory (os error 2)
tardis/plasma/equilibrium/rates/photoionization_strengths.py:1:1: E902 No such file or directory (os error 2)
tardis/spectrum/formal_integral.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/spectrum/formal_integral.py:358:13: RET506 Unnecessary `else` after `raise` statement
tardis/spectrum/formal_integral.py:698:5: RET505 Unnecessary `else` after `return` statement
tardis/spectrum/formal_integral.py:734:5: RET505 Unnecessary `else` after `return` statement
tardis/visualization/widgets/tests/test_line_info.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/visualization/widgets/tests/test_line_info.py:7:36: F401 [*] `tardis.tests.test_util.monkeysession` imported but unused
tardis/visualization/widgets/tests/test_line_info.py:43:20: E712 Avoid equality comparisons to `False`; use `if not species_interactions_df.all(axis=None):` for false checks
tardis/visualization/widgets/tests/test_line_info.py:73:12: E712 Avoid equality comparisons to `False`; use `if not species_interactions_df.all(axis=None):` for false checks
tardis/visualization/widgets/tests/test_line_info.py:96:20: E712 Avoid equality comparisons to `False`; use `if not last_line_counts_df.all(axis=None):` for false checks
tardis/visualization/widgets/tests/test_line_info.py:152:66: F811 Redefinition of unused `monkeysession` from line 7
tardis/visualization/widgets/tests/test_line_info.py:296:16: E712 Avoid equality comparisons to `False`; use `if not bool(selected_species):` for false checks
tardis/visualization/widgets/tests/test_line_info.py:342:12: E712 Avoid equality comparisons to `False`; use `if not ...:` for false checks
tardis/workflows/simple_tardis_workflow.py:230:17: G004 Logging statement uses f-string
tardis/workflows/simple_tardis_workflow.py:449:17: G004 Logging statement uses f-string
tardis/workflows/util.py:1:1: E902 No such file or directory (os error 2)
tardis/workflows/v_inner_solver.py:1:1: E902 No such file or directory (os error 2)
Found 96 errors.
[*] 48 fixable with the `--fix` option (5 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 (b4bc6ac) and the latest commit (1d21097).
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 [b4bc6ac3] <master>   | After [1d210971]    | Ratio   | Benchmark (Parameter)                                                                                                               |
|----------|------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
|          | 2.83±0.3μs                   | 3.35±0.3μs          | ~1.18   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket                                       |
|          | 53.5±40μs                    | 46.9±40μs           | ~0.88   | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter                                          |
|          | 28.1±8μs                     | 24.7±7μs            | ~0.88   | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list |
|          | 3.82±0.7μs                   | 3.22±0.5μs          | ~0.84   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell                              |
|          | 2.87±0.01ms                  | 3.09±0.05ms         | 1.08    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter')                                     |
|          | 2.05±2μs                     | 2.21±1μs            | 1.08    | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators       |
|          | 6.21±1μs                     | 6.72±0.9μs          | 1.08    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket                                           |
|          | 531±100ns                    | 551±100ns           | 1.04    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation                                      |
|          | 1.44±0.4μs                   | 1.48±0.3μs          | 1.03    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line                    |
|          | 541±200ns                    | 550±100ns           | 1.02    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation                                |
|          | 1.06±0m                      | 1.07±0m             | 1.01    | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking                                                                      |
|          | 205±0ns                      | 207±0.04ns          | 1.01    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body                                       |
|          | 38.6±0.2μs                   | 39.0±0.1μs          | 1.01    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list                  |
|          | 2.11±0m                      | 2.10±0m             | 1.00    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions                                 |
|          | 63.6±0.5ms                   | 63.4±0.1ms          | 1.00    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe                  |
|          | 1.21±0.01μs                  | 1.20±0μs            | 0.99    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary                |
|          | 39.6±0.2s                    | 38.8±0.05s          | 0.98    | run_tardis.BenchmarkRunTardis.time_run_tardis                                                                                       |
|          | 2.93±0.6ms                   | 2.87±0.4ms          | 0.98    | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop                        |
|          | 41.8±20μs                    | 39.7±30μs           | 0.95    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission                                         |
|          | 761±2ns                      | 722±0.5ns           | 0.95    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter                                       |
|          | 671±100ns                    | 631±100ns           | 0.94    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation                              |
|          | 1.79±0.01ms                  | 1.67±0.01ms         | 0.94    | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop                             |
|          | 4.27±0.01ms                  | 3.99±0.01ms         | 0.93    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom')                                   |
|          | 8.07±2μs                     | 7.44±2μs            | 0.92    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley                                    |

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

@andrewfullard
Copy link
Contributor

Hello! Are you planning to apply to Google Summer of Code?

@karthik11135
Copy link
Author

Hello! Are you planning to apply to Google Summer of Code?

Yes, I'm planning to. As of now I'm familiarizing myself with the codebase, so that I can make meaningful contributions.

@andrewfullard
Copy link
Contributor

Hello! Are you planning to apply to Google Summer of Code?

Yes, I'm planning to. As of now I'm familiarizing myself with the codebase, so that I can make meaningful contributions.

Great! I think we have seen enough of your capabilities with the number of contributions you have made. Please respond to reviews and comments on your existing PRs before writing more. Thanks!

@@ -53,6 +53,13 @@ def test_get_species_interactions(
)
assert species_interactions_df.shape == (expected_df_length, 1)

def test_get_middle_half_edges(self, wavelength_range, filter_mode):
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this is a particularly useful test. It is probably better than nothing, but executes the exact same code of the get_middle_half_edges() function. Maybe instead devise a test using the existing LineInfoWidget fixture that appears earlier in this file.

Copy link
Author

Choose a reason for hiding this comment

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

Made use of existing fixture lineinfowidget. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

4 participants