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 codespell workflow #2807

Merged
merged 9 commits into from
Aug 30, 2024

Conversation

KasukabeDefenceForce
Copy link
Contributor

📝 Description

Type: 🪲 bugfix | 🚀 feature | ☣️ breaking change | 🚦 testing | 📝 documentation | 🎢 infrastructure

This PR aims at adding codespell to TARDIS which will help in fixing the alphabetical mistakes in docs.

Also, link issues affected by this pull request by using the keywords: close, closes, closed, fix, fixes, fixed, resolve, resolves or resolved.

📌 Resources

Examples, notebooks, and links to useful references.

🚦 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.

@tardis-bot
Copy link
Contributor

tardis-bot commented Aug 20, 2024

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

5	E999  	[ ] SyntaxError: Expected ',', found ':'
4	G004  	[ ] Logging statement uses f-string
4	I001  	[*] Import block is un-sorted or un-formatted
3	F405  	[ ] `deepcopy` may be undefined, or defined from star imports
2	RET505	[ ] Unnecessary `else` after `return` statement
2	W292  	[*] No newline at end of file
2	D202  	[*] No blank lines allowed after function docstring (found 1)
1	B018  	[ ] Found useless expression. Either assign it to a variable or remove it.
1	G001  	[ ] Logging statement uses `str.format`
1	PT020 	[ ] `@pytest.yield_fixture` is deprecated, use `@pytest.fixture`
1	RET506	[ ] Unnecessary `elif` after `raise` statement
1	E701  	[ ] Multiple statements on one line (colon)
1	E902  	[ ] No such file or directory (os error 2)
1	W291  	[*] Trailing whitespace
1	F401  	[*] `astropy.units` imported but unused
1	F403  	[ ] `from tardis.tests.fixtures.atom_data import *` used; unable to detect undefined names
1	F821  	[ ] Undefined name `pytest_report_header`
1	PGH004	[ ] Use specific rule codes when using `noqa`
1	UP030 	[*] Use implicit references for positional format fields

Complete output(might be large):

.github/workflows/codespell.yml:3:4: E999 SyntaxError: Expected an expression
.github/workflows/codespell.yml:18:11: E701 Multiple statements on one line (colon)
.github/workflows/codespell.yml:39:26: W292 [*] No newline at end of file
.zenodo.json:1:1: B018 Found useless expression. Either assign it to a variable or remove it.
.zenodo.json:357:2: 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/io/output/how_to_rpacket_tracking.ipynb:cell 12:1:62: W291 [*] Trailing whitespace
docs/resources/credits.rst:1:1: E999 SyntaxError: Expected a statement
tardis/conftest.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/conftest.py:11:1: F403 `from tardis.tests.fixtures.atom_data import *` used; unable to detect undefined names
tardis/conftest.py:30:49: PGH004 Use specific rule codes when using `noqa`
tardis/conftest.py:32:9: F821 Undefined name `pytest_report_header`
tardis/conftest.py:145:5: RET505 Unnecessary `else` after `return` statement
tardis/conftest.py:169:1: PT020 `@pytest.yield_fixture` is deprecated, use `@pytest.fixture`
tardis/conftest.py:240:19: F405 `deepcopy` may be undefined, or defined from star imports
tardis/conftest.py:249:19: F405 `deepcopy` may be undefined, or defined from star imports
tardis/conftest.py:278:19: F405 `deepcopy` may be undefined, or defined from star imports
tardis/gui/tests/test_gui.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/gui/tests/test_gui.py:5:25: F401 [*] `astropy.units` imported but unused
tardis/gui/tests/test_gui.py:8:1: I001 [*] Import block is un-sorted or un-formatted
tardis/io/atom_data/base.py:182:34: G004 Logging statement uses f-string
tardis/io/atom_data/base.py:236:17: G004 Logging statement uses f-string
tardis/io/atom_data/base.py:240:21: UP030 Use implicit references for positional format fields
tardis/io/atom_data/base.py:240:21: G001 Logging statement uses `str.format`
tardis/io/atom_data/base.py:670:17: G004 Logging statement uses f-string
tardis/tests/test_tardis_full_formal_integral.py:61:9: RET505 Unnecessary `else` after `return` statement
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:247:17: G004 Logging statement uses f-string
tardis/visualization/tools/liv_plot.py:357:13: RET506 Unnecessary `elif` after `raise` statement
tardis/visualization/tools/tests/test_liv_plot.py:1:1: E902 No such file or directory (os error 2)
Found 34 errors.
[*] 10 fixable with the `--fix` option (1 hidden fix can be enabled with the `--unsafe-fixes` option).

Copy link

codecov bot commented Aug 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.79%. Comparing base (5fe6806) to head (3dc7823).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2807      +/-   ##
==========================================
+ Coverage   69.88%   70.79%   +0.91%     
==========================================
  Files         208      209       +1     
  Lines       15453    15638     +185     
==========================================
+ Hits        10799    11071     +272     
+ Misses       4654     4567      -87     

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

@KasukabeDefenceForce KasukabeDefenceForce marked this pull request as ready for review August 30, 2024 12:19
@tardis-bot
Copy link
Contributor

*beep* *bop*
Hi human,
I ran benchmarks as you asked comparing master (5fe6806) and the latest commit (3dc7823).
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 [b79b61ed] <master>   | After [3dc78232]    | Ratio   | Benchmark (Parameter)                                                                                                               |
|----------|------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
|          | 500±100ns                    | 561±200ns           | ~1.12   | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation                                      |
|          | 2.99±0ms                     | 2.65±0.01ms         | ~0.89   | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter')                                     |
|          | 6.73±0.3μs                   | 5.74±1μs            | ~0.85   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket                                           |
|          | 3.35±0.7μs                   | 2.74±0.7μs          | ~0.82   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket                                       |
|          | 1.77±0.3μs                   | 1.37±0.5μs          | ~0.77   | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line                    |
|          | 511±200ns                    | 551±200ns           | 1.08    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation                                |
|          | 611±200ns                    | 622±100ns           | 1.02    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation                              |
|          | 203±0.05ns                   | 207±0.1ns           | 1.02    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body                                       |
|          | 1.20±0μs                     | 1.21±0μs            | 1.01    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary                |
|          | 3.80±0.01ms                  | 3.78±0.01ms         | 1.00    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom')                                   |
|          | 1.06±0m                      | 1.06±0m             | 1.00    | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking                                                                      |
|          | 2.07±0m                      | 2.07±0m             | 1.00    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions                                 |
|          | 1.70±0.01ms                  | 1.70±0.02ms         | 1.00    | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop                             |
|          | 30.2±0.1μs                   | 30.3±0.01μs         | 1.00    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list                  |
|          | 63.8±0.1ms                   | 63.7±0.2ms          | 1.00    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe                  |
|          | 39.7±0.01s                   | 39.4±0.1s           | 0.99    | run_tardis.BenchmarkRunTardis.time_run_tardis                                                                                       |
|          | 2.53±0.4ms                   | 2.51±0.5ms          | 0.99    | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop                        |
|          | 2.28±1μs                     | 2.24±1μs            | 0.98    | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators       |
|          | 47.6±20μs                    | 45.9±30μs           | 0.96    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter                                          |
|          | 746±0.9ns                    | 716±0.4ns           | 0.96    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter                                       |
|          | 7.30±2μs                     | 7.03±1μs            | 0.96    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley                                    |
|          | 3.36±0.5μs                   | 3.23±0.3μs          | 0.96    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell                              |
|          | 47.3±20μs                    | 44.5±20μs           | 0.94    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission                                         |
|          | 27.2±7μs                     | 25.0±7μs            | 0.92    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list |

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

@KasukabeDefenceForce
Copy link
Contributor Author

@Knights-Templars Knights-Templars merged commit be4ec9a into tardis-sn:master Aug 30, 2024
21 checks passed
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.

4 participants