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 duplicate code #4

Merged
merged 6 commits into from Jul 22, 2022
Merged

Refactor duplicate code #4

merged 6 commits into from Jul 22, 2022

Conversation

vandalt
Copy link
Contributor

@vandalt vandalt commented Jul 22, 2022

This reorganizes the code so that:

  • Functions used to calculate specific quantities are all grouped in a separate file
  • The main code to run the ETC (which was in the two scripts) is in a separate "driver" file, inside a function, and called by the scripts. This fixes Reorganize duplicate code in NIRPS_ETC.pyand NIRPS_ETC_script.py #2.
  • Some formatting updates (spaces around comments, equal signs, commas, line spacing, and other minor formatting changes)
  • Plots can now be saved even when running the script in a loop, but the option is off by default.

This is mainly to make the code easier to edit and debug. The changes seemed to improve a bit execution time (but just by ~ 0.1 s). The results with the default settings seem to be the same as in the main branch.

@ngrieves let me know if you have comments or suggestions.

@ngrieves ngrieves merged commit e78d114 into ngrieves:main Jul 22, 2022
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.

Reorganize duplicate code in NIRPS_ETC.pyand NIRPS_ETC_script.py
2 participants