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

Remove deprecated setup.py #2798

Merged
merged 7 commits into from
Aug 19, 2024

Conversation

KasukabeDefenceForce
Copy link
Contributor

📝 Description

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

This PR aims at removing setup.py from the codebase as it is deprecated.

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 15, 2024

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

77	W191   	[ ] Indentation contains tabs
17	W291   	[*] Trailing whitespace
9	E999   	[ ] SyntaxError: Expected ',', found ':'
6	W293   	[*] Blank line contains whitespace
5	F405   	[ ] `exclude_patterns` may be undefined, or defined from star imports
4	E101   	[ ] Indentation contains mixed spaces and tabs
3	F631   	[ ] Assert test is a non-empty tuple, which is always `True`
3	UP015  	[*] Unnecessary open mode parameters
2	B018   	[ ] Found useless expression. Either assign it to a variable or remove it.
2	E402   	[ ] Module level import not at top of file
1	ANN205 	[ ] Missing return type annotation for staticmethod `get_relative_path`
1	COM818 	[ ] Trailing comma on bare tuple prohibited
1	RET506 	[ ] Unnecessary `else` after `raise` statement
1	I001   	[*] Import block is un-sorted or un-formatted
1	E712   	[*] Avoid equality comparisons to `True`; use `if toml_config_tool_dict["tardis"]['edit_on_github']:` for truth checks
1	E902   	[ ] No such file or directory (os error 2)
1	W292   	[*] No newline at end of file
1	F401   	[*] `tardis` imported but unused
1	PGH004 	[ ] Use specific rule codes when using `noqa`
1	PLW0127	[ ] Self-assignment of variable `observed_spectrum`
1	UP009  	[*] UTF-8 encoding declaration is unnecessary
1	UP030  	[*] Use implicit references for positional format fields
1	UP032  	[*] Use f-string instead of `format` call

Complete output(might be large):

.zenodo.json:1:1: B018 Found useless expression. Either assign it to a variable or remove it.
.zenodo.json:354: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
asv.conf.json:1:1: B018 Found useless expression. Either assign it to a variable or remove it.
benchmarks/benchmark_base.py:29:9: ANN205 Missing return type annotation for staticmethod `get_relative_path`
benchmarks/benchmark_base.py:75:9: RET506 Unnecessary `else` after `raise` statement
docs/Makefile:5:16: E999 SyntaxError: Expected an expression
docs/Makefile:22:1: W191 Indentation contains tabs
docs/Makefile:23:1: W191 Indentation contains tabs
docs/Makefile:24:1: W191 Indentation contains tabs
docs/Makefile:25:1: W191 Indentation contains tabs
docs/Makefile:26:1: W191 Indentation contains tabs
docs/Makefile:27:1: W191 Indentation contains tabs
docs/Makefile:28:1: W191 Indentation contains tabs
docs/Makefile:29:1: W191 Indentation contains tabs
docs/Makefile:30:1: W191 Indentation contains tabs
docs/Makefile:31:1: W191 Indentation contains tabs
docs/Makefile:32:1: W191 Indentation contains tabs
docs/Makefile:33:1: W191 Indentation contains tabs
docs/Makefile:34:1: W191 Indentation contains tabs
docs/Makefile:35:1: W191 Indentation contains tabs
docs/Makefile:36:1: W191 Indentation contains tabs
docs/Makefile:37:1: W191 Indentation contains tabs
docs/Makefile:40:1: W191 Indentation contains tabs
docs/Makefile:41:1: W191 Indentation contains tabs
docs/Makefile:42:1: W191 Indentation contains tabs
docs/Makefile:45:1: W191 Indentation contains tabs
docs/Makefile:46:1: W191 Indentation contains tabs
docs/Makefile:47:1: W191 Indentation contains tabs
docs/Makefile:50:1: W191 Indentation contains tabs
docs/Makefile:51:1: W191 Indentation contains tabs
docs/Makefile:52:1: W191 Indentation contains tabs
docs/Makefile:55:1: W191 Indentation contains tabs
docs/Makefile:56:1: W191 Indentation contains tabs
docs/Makefile:57:1: W191 Indentation contains tabs
docs/Makefile:60:1: W191 Indentation contains tabs
docs/Makefile:61:1: W191 Indentation contains tabs
docs/Makefile:62:1: W191 Indentation contains tabs
docs/Makefile:65:1: W191 Indentation contains tabs
docs/Makefile:66:1: W191 Indentation contains tabs
docs/Makefile:67:1: W191 Indentation contains tabs
docs/Makefile:70:1: W191 Indentation contains tabs
docs/Makefile:71:1: W191 Indentation contains tabs
docs/Makefile:72:1: W191 Indentation contains tabs
docs/Makefile:73:1: W191 Indentation contains tabs
docs/Makefile:73:1: E101 Indentation contains mixed spaces and tabs
docs/Makefile:76:1: W191 Indentation contains tabs
docs/Makefile:77:1: W191 Indentation contains tabs
docs/Makefile:78:1: W191 Indentation contains tabs
docs/Makefile:79:1: W191 Indentation contains tabs
docs/Makefile:79:1: E101 Indentation contains mixed spaces and tabs
docs/Makefile:80:1: W191 Indentation contains tabs
docs/Makefile:81:1: W191 Indentation contains tabs
docs/Makefile:82:1: W191 Indentation contains tabs
docs/Makefile:85:1: W191 Indentation contains tabs
docs/Makefile:86:1: W191 Indentation contains tabs
docs/Makefile:87:1: W191 Indentation contains tabs
docs/Makefile:88:1: W191 Indentation contains tabs
docs/Makefile:89:1: W191 Indentation contains tabs
docs/Makefile:90:1: W191 Indentation contains tabs
docs/Makefile:91:1: W191 Indentation contains tabs
docs/Makefile:94:1: W191 Indentation contains tabs
docs/Makefile:95:1: W191 Indentation contains tabs
docs/Makefile:96:1: W191 Indentation contains tabs
docs/Makefile:99:1: W191 Indentation contains tabs
docs/Makefile:100:1: W191 Indentation contains tabs
docs/Makefile:101:1: W191 Indentation contains tabs
docs/Makefile:102:1: W191 Indentation contains tabs
docs/Makefile:103:1: W191 Indentation contains tabs
docs/Makefile:103:1: E101 Indentation contains mixed spaces and tabs
docs/Makefile:106:1: W191 Indentation contains tabs
docs/Makefile:107:1: W191 Indentation contains tabs
docs/Makefile:108:1: W191 Indentation contains tabs
docs/Makefile:109:1: W191 Indentation contains tabs
docs/Makefile:112:1: W191 Indentation contains tabs
docs/Makefile:113:1: W191 Indentation contains tabs
docs/Makefile:114:1: W191 Indentation contains tabs
docs/Makefile:117:1: W191 Indentation contains tabs
docs/Makefile:118:1: W191 Indentation contains tabs
docs/Makefile:119:1: W191 Indentation contains tabs
docs/Makefile:122:1: W191 Indentation contains tabs
docs/Makefile:123:1: W191 Indentation contains tabs
docs/Makefile:124:1: W191 Indentation contains tabs
docs/Makefile:127:1: W191 Indentation contains tabs
docs/Makefile:128:1: W191 Indentation contains tabs
docs/Makefile:129:1: W191 Indentation contains tabs
docs/Makefile:130:1: W191 Indentation contains tabs
docs/Makefile:130:1: E101 Indentation contains mixed spaces and tabs
docs/conf.py:1:1: UP009 [*] UTF-8 encoding declaration is unnecessary
docs/conf.py:27:1: I001 [*] Import block is un-sorted or un-formatted
docs/conf.py:30:8: F401 [*] `tardis` imported but unused
docs/conf.py:36:43: PGH004 Use specific rule codes when using `noqa`
docs/conf.py:46:6: UP015 [*] Unnecessary open mode parameters
docs/conf.py:67:1: F405 `exclude_patterns` may be undefined, or defined from star imports
docs/conf.py:68:1: F405 `exclude_patterns` may be undefined, or defined from star imports
docs/conf.py:69:1: F405 `exclude_patterns` may be undefined, or defined from star imports
docs/conf.py:70:1: F405 `exclude_patterns` may be undefined, or defined from star imports
docs/conf.py:71:1: F405 `exclude_patterns` may be undefined, or defined from star imports
docs/conf.py:138:1: W293 Blank line contains whitespace
docs/conf.py:173:1: W293 Blank line contains whitespace
docs/conf.py:190:13: UP030 Use implicit references for positional format fields
docs/conf.py:190:13: UP032 [*] Use f-string instead of `format` call
docs/conf.py:217:1: E402 Module level import not at top of file
docs/conf.py:290:4: E712 Avoid equality comparisons to `True`; use `if toml_config_tool_dict["tardis"]['edit_on_github']:` for truth checks
docs/conf.py:351:1: E402 Module level import not at top of file
docs/conf.py:366:10: UP015 [*] Unnecessary open mode parameters, use ""w""
docs/conf.py:381:10: UP015 [*] Unnecessary open mode parameters, use ""w""
docs/contributing/development/documentation_guidelines.rst:1:1: E999 SyntaxError: Expected a statement
docs/contributing/development/documentation_guidelines.rst:44:1: W293 [*] Blank line contains whitespace
docs/contributing/development/documentation_guidelines.rst:58:10: W291 [*] Trailing whitespace
docs/contributing/development/git_workflow.rst:1:1: E999 SyntaxError: Expected a statement
docs/contributing/development/running_tests.rst:1:1: E999 SyntaxError: Expected a statement
docs/contributing/development/running_tests.rst:8:90: COM818 Trailing comma on bare tuple prohibited
docs/contributing/development/running_tests.rst:41:42: W291 [*] Trailing whitespace
docs/contributing/development/running_tests.rst:64:112: W291 [*] Trailing whitespace
docs/contributing/development/running_tests.rst:65:124: W291 [*] Trailing whitespace
docs/contributing/development/running_tests.rst:69:92: W291 [*] Trailing whitespace
docs/contributing/development/running_tests.rst:70:107: W291 [*] Trailing whitespace
docs/contributing/development/running_tests.rst:76:102: W291 [*] Trailing whitespace
docs/contributing/development/running_tests.rst:78:116: W291 [*] Trailing whitespace
docs/contributing/development/running_tests.rst:80:124: W291 [*] Trailing whitespace
docs/contributing/development/running_tests.rst:92:62: W291 [*] Trailing whitespace
docs/installation.rst:1:1: E999 SyntaxError: Expected a statement
docs/installation.rst:9:1: W293 [*] Blank line contains whitespace
docs/installation.rst:10:84: W291 [*] Trailing whitespace
docs/installation.rst:11:109: W291 [*] Trailing whitespace
docs/installation.rst:14:116: W291 [*] Trailing whitespace
docs/installation.rst:15:133: W291 [*] Trailing whitespace
docs/installation.rst:27:67: W291 [*] Trailing whitespace
docs/installation.rst:59:1: W293 [*] Blank line contains whitespace
docs/installation.rst:66:19: W291 [*] Trailing whitespace
docs/installation.rst:69:1: W293 [*] Blank line contains whitespace
docs/installation.rst:86:102: W291 [*] Trailing whitespace
docs/resources/credits.rst:1:1: E999 SyntaxError: Expected a statement
setup.py:1:1: E902 No such file or directory (os error 2)
tardis/visualization/tools/tests/test_sdec_plot.py:343:17: F631 Assert test is a non-empty tuple, which is always `True`
tardis/visualization/tools/tests/test_sdec_plot.py:475:13: F631 Assert test is a non-empty tuple, which is always `True`
tardis/visualization/tools/tests/test_sdec_plot.py:557:13: PLW0127 Self-assignment of variable `observed_spectrum`
tardis/visualization/tools/tests/test_sdec_plot.py:618:13: F631 Assert test is a non-empty tuple, which is always `True`
Found 141 errors.
[*] 29 fixable with the `--fix` option (4 hidden fixes can be enabled with the `--unsafe-fixes` option).

Copy link

codecov bot commented Aug 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.37%. Comparing base (8a317dd) to head (c49bf26).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2798      +/-   ##
==========================================
- Coverage   69.91%   69.37%   -0.55%     
==========================================
  Files         206      206              
  Lines       15523    15518       -5     
==========================================
- Hits        10853    10765      -88     
- Misses       4670     4753      +83     

☔ 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 15, 2024 12:52
@tardis-bot
Copy link
Contributor

*beep* *bop*

Hi, human.

The docs workflow has succeeded ✔️

Click here to see your results.

@tardis-bot
Copy link
Contributor

tardis-bot commented Aug 15, 2024

*beep* *bop*
Hi human,
I ran benchmarks as you asked comparing master (8a317dd) and the latest commit (c49bf26).
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 [a054d743] <master>   | After [c49bf268]    | Ratio   | Benchmark (Parameter)                                                                                                               |
|----------|------------------------------|---------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
|          | 2.04±1μs                     | 2.28±1μs            | ~1.12   | transport_montecarlo_estimators_radfield_estimator_calcs.BenchmarkMontecarloMontecarloNumbaPacket.time_update_line_estimators       |
|          | 561±200ns                    | 501±100ns           | ~0.89   | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_compton_opacity_calculation                                      |
|          | 671±100ns                    | 571±100ns           | ~0.85   | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_pair_creation_opacity_calculation                                |
|          | 3.44±0.4μs                   | 2.80±0.8μs          | ~0.81   | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_bad_vpacket                                       |
|          | 44.5±30μs                    | 47.3±30μs           | 1.06    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_scatter                                          |
|          | 42.2±20μs                    | 43.7±20μs           | 1.04    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_line_emission                                         |
|          | 2.69±0.03ms                  | 2.75±0.01ms         | 1.02    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('scatter')                                     |
|          | 1.69±0.01ms                  | 1.72±0.01ms         | 1.02    | transport_montecarlo_main_loop.BenchmarkTransportMontecarloMontecarloMainLoop.time_montecarlo_main_loop                             |
|          | 31.1±0.02μs                  | 31.5±0.01μs         | 1.01    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_tracker_list                  |
|          | 2.86±0.5ms                   | 2.90±0.4ms          | 1.01    | transport_montecarlo_single_packet_loop.BenchmarkTransportMontecarloSinglePacketLoop.time_single_packet_loop                        |
|          | 7.33±2μs                     | 7.42±1μs            | 1.01    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_volley                                    |
|          | 39.3±0.07s                   | 39.4±0.04s          | 1.00    | run_tardis.BenchmarkRunTardis.time_run_tardis                                                                                       |
|          | 2.07±0m                      | 2.07±0m             | 1.00    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_FormalIntegrator_functions                                 |
|          | 1.05±0m                      | 1.05±0m             | 0.99    | run_tardis.BenchmarkRunTardis.time_run_tardis_rpacket_tracking                                                                      |
|          | 206±0.1ns                    | 203±0.05ns          | 0.99    | spectrum_formal_integral.BenchmarkTransportMontecarloFormalIntegral.time_intensity_black_body                                       |
|          | 1.53±0.5μs                   | 1.51±0.4μs          | 0.99    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_line                    |
|          | 64.5±0.1ms                   | 63.7±0.07ms         | 0.99    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_rpacket_trackers_to_dataframe                  |
|          | 571±200ns                    | 561±200ns           | 0.98    | opacities_opacity.BenchmarkMontecarloMontecarloNumbaOpacities.time_photoabsorption_opacity_calculation                              |
|          | 1.23±0μs                     | 1.21±0μs            | 0.98    | transport_geometry_calculate_distances.BenchmarkTransportGeometryCalculateDistances.time_calculate_distance_boundary                |
|          | 764±0.7ns                    | 731±0.4ns           | 0.96    | transport_montecarlo_interaction.BenchmarkTransportMontecarloInteraction.time_thomson_scatter                                       |
|          | 3.89±0.01ms                  | 3.62±0.02ms         | 0.93    | opacities_opacity_state.BenchmarkOpacitiesOpacityState.time_opacity_state_initialize('macroatom')                                   |
|          | 3.47±0.3μs                   | 3.23±0.4μs          | 0.93    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket_within_shell                              |
|          | 24.9±7μs                     | 22.8±6μs            | 0.92    | transport_montecarlo_packet_trackers.BenchmarkTransportMontecarloPacketTrackers.time_generate_rpacket_last_interaction_tracker_list |
|          | 6.94±0.4μs                   | 6.35±0.7μs          | 0.91    | transport_montecarlo_vpacket.BenchmarkMontecarloMontecarloNumbaVpacket.time_trace_vpacket                                           |

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

@@ -281,7 +281,7 @@ In more detail
If you have `Sphinx <https://www.sphinx-doc.org/en/master/>`_ installed, you can also check that the documentation
builds and looks correct::

python setup.py build_sphinx
make html
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
make html
cd docs && make html

jvshields
jvshields previously approved these changes Aug 16, 2024
atharva-2001
atharva-2001 previously approved these changes Aug 16, 2024
Copy link
Member

@atharva-2001 atharva-2001 left a comment

Choose a reason for hiding this comment

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

Just a small suggestion but other than that looks nice to me.

jvshields
jvshields previously approved these changes Aug 16, 2024
atharva-2001
atharva-2001 previously approved these changes Aug 16, 2024
@atharva-2001 atharva-2001 enabled auto-merge (squash) August 16, 2024 14:20
Copy link
Contributor

Choose a reason for hiding this comment

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

This file has a black format issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed this in commit c49bf26

@atharva-2001 atharva-2001 merged commit 47c8350 into tardis-sn:master Aug 19, 2024
15 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants