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

Refactor: Rename 'expected' to 'expected_fh' for clarity as file handler #2957

Closed
wants to merge 3 commits into from

Conversation

rudrakshnalbalwar
Copy link

@rudrakshnalbalwar rudrakshnalbalwar commented Jan 24, 2025

📝 Description

Type: 📝 documentation

In this pull request, I have refactored the code to improve clarity by renaming the variable expected to expected_fh wherever it was used as a file handler. This helps make the code more readable and better reflects the role of the variable.
This PR closes issue #2864

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

@rudrakshnalbalwar rudrakshnalbalwar marked this pull request as draft January 24, 2025 20:19
@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.

@rudrakshnalbalwar rudrakshnalbalwar marked this pull request as ready for review January 24, 2025 20:20
@tardis-bot
Copy link
Contributor

tardis-bot commented Jan 24, 2025

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

5	E902  	[ ] No such file or directory (os error 2)
4	I001  	[*] Import block is un-sorted or un-formatted
4	F401  	[ ] `tardis.plasma.equilibrium.rates.collision_strengths.UpsilonCMFGENSolver` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
2	ISC003	[ ] Explicitly concatenated string should be implicitly concatenated
2	RET505	[ ] Unnecessary `else` after `return` statement
2	D202  	[*] No blank lines allowed after function docstring (found 1)
1	ANN204	[ ] Missing return type annotation for special method `__getitem__`
1	RET506	[ ] Unnecessary `else` after `raise` statement
1	N999  	[ ] Invalid module name: 'test_HDFWriter'
1	E999  	[ ] SyntaxError: Expected an expression
1	D406  	[*] Section name should end with a newline ("Returns")
1	D407  	[*] Missing dashed underline after section ("Returns")
1	F811  	[ ] Redefinition of unused `test_generate_plot_mpl` from line 293
1	F821  	[ ] Undefined name `expected`

Complete output(might be large):

.mailmap:1:38: E999 SyntaxError: Expected an expression
docs/physics/plasma/equilibrium/tardis_solver_cmfgen.ipynb:1:1: E902 No such file or directory (os error 2)
tardis/io/tests/test_HDFWriter.py:1:1: N999 Invalid module name: 'test_HDFWriter'
tardis/io/tests/test_HDFWriter.py:77:45: F821 Undefined name `expected`
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/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:423:9: D202 [*] No blank lines allowed after function docstring (found 1)
tardis/spectrum/formal_integral.py:716:5: RET505 Unnecessary `else` after `return` statement
tardis/spectrum/formal_integral.py:752:5: RET505 Unnecessary `else` after `return` statement
tardis/visualization/tools/tests/test_liv_plot.py:1:1: I001 [*] Import block is un-sorted or un-formatted
tardis/visualization/tools/tests/test_liv_plot.py:352:29: ISC003 Explicitly concatenated string should be implicitly concatenated
tardis/visualization/tools/tests/test_sdec_plot.py:2:1: I001 [*] Import block is un-sorted or un-formatted
tardis/visualization/tools/tests/test_sdec_plot.py:327:29: ISC003 Explicitly concatenated string should be implicitly concatenated
tardis/visualization/tools/tests/test_sdec_plot.py:383:9: F811 Redefinition of unused `test_generate_plot_mpl` from line 293
Found 27 errors.
[*] 8 fixable with the `--fix` option.

@rudrakshnalbalwar
Copy link
Author

hi @atharva-2001 , @andrewfullard , @wkerzendorf
Could you please take a look at it and provide any feedback or suggestions? I’d greatly appreciate your review and guidance on this.

Thank you in advance for your time and support!

@wkerzendorf
Copy link
Member

Thanks for the PR! That gives us a little bit of an overview of your git proficiency but not yet much of your coding proficiency. We close most GSoC PRs (regardless of quality) but it has been registered that you have submitted a PR.

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.

3 participants