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

Improvements for gain selection automation #293

Merged
merged 86 commits into from
Oct 24, 2024
Merged

Conversation

marialainez
Copy link
Collaborator

@marialainez marialainez commented Jun 12, 2024

Main changes that have been made in this PR:

  • Write history files for each subrun (apart from the log files) + update them every time the gain selection script is launched
  • Allow launching the gain selection script several times without launching the jobs that are already running again (if the history file exists and is empty for a given subrun, it means that the job is running for that run, so it doesn't launch it again)
  • Change the check option so that it is done looking at the history files and not at the log files
  • Add simulate option to the gain selection script
  • Once the gain selection finishes correctly for all runs, the gain selection script is launched with the check option to see if there is any run missing that needs to be copied to R0G.

@marialainez marialainez marked this pull request as draft June 12, 2024 13:26
src/osa/job.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
Copy link
Member

@morcuended morcuended left a comment

Choose a reason for hiding this comment

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

Here are some more comments. Looks good overall. IMO some parts are too nested, but I understand that there are different cases you have to cope with

src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Show resolved Hide resolved
src/osa/scripts/gain_selection.py Show resolved Hide resolved
@morcuended
Copy link
Member

@marialainez, this would allow running the gain selection launcher several times and just re-doing jobs that did not previously succeed, right?

@marialainez
Copy link
Collaborator Author

@marialainez, this would allow running the gain selection launcher several times and just re-doing jobs that did not previously succeed, right?

yes, we have been testing it for the last days and it works as expected

Copy link
Member

@morcuended morcuended left a comment

Choose a reason for hiding this comment

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

looks good overall, if you have tested it in the cluster for a couple of days I'd say it's good to go

src/osa/scripts/datasequence.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/datasequence.py Outdated Show resolved Hide resolved
src/osa/scripts/datasequence.py Outdated Show resolved Hide resolved
Copy link
Member

@morcuended morcuended left a comment

Choose a reason for hiding this comment

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

some changes in the log messages, to make following the logs easier. I would just leave some log info messages for general actions happening and maybe just give info at run level.

src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/sequencer.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
src/osa/scripts/gain_selection.py Outdated Show resolved Hide resolved
@marialainez marialainez marked this pull request as ready for review August 6, 2024 13:24
Copy link
Member

@morcuended morcuended left a comment

Choose a reason for hiding this comment

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

Find some more comments inline. Test it in the next period for several days and if works smoothly I'd say it's ready to go

src/osa/scripts/sequencer.py Outdated Show resolved Hide resolved
src/osa/scripts/sequencer.py Outdated Show resolved Hide resolved
log.info(f"Sequencer is still running for date {date_to_iso(options.date)}. Try again later.")
sys.exit(0)

elif sequencer_finished(options.date) and not options.force:
Copy link
Member

Choose a reason for hiding this comment

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

when do you foresee using the force option?

Copy link
Member

@morcuended morcuended left a comment

Choose a reason for hiding this comment

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

Some more comments (I hope the last ones)

src/osa/job.py Outdated Show resolved Hide resolved
src/osa/job.py Outdated Show resolved Hide resolved
src/osa/utils/cliopts.py Outdated Show resolved Hide resolved
src/osa/scripts/sequencer.py Outdated Show resolved Hide resolved
src/osa/scripts/sequencer.py Outdated Show resolved Hide resolved
src/osa/scripts/sequencer.py Outdated Show resolved Hide resolved
@morcuended
Copy link
Member

A problem with the mamba setup step in CI makes tests fail. Please relaunch the tests after #303.

@morcuended
Copy link
Member

@marialainez please rebase the branch with main to make the tests run again

marialainez and others added 26 commits October 24, 2024 11:41
Co-authored-by: Daniel Morcuende <dmorcuende@iaa.es>
Co-authored-by: Daniel Morcuende <dmorcuende@iaa.es>
Co-authored-by: Daniel Morcuende <dmorcuende@iaa.es>
Co-authored-by: Daniel Morcuende <dmorcuende@iaa.es>
Copy link
Member

@morcuended morcuended left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for all the work

@morcuended morcuended merged commit fd8174e into main Oct 24, 2024
5 checks passed
@morcuended morcuended deleted the gainsel_automation branch October 24, 2024 10:20
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