Skip to content

Payu general command wrapper for warning and exceptions formats#709

Draft
jo-basevi wants to merge 5 commits intopayu-org:masterfrom
ACCESS-NRI:673-add-wrapper-cmd-for-logs-warn-errors
Draft

Payu general command wrapper for warning and exceptions formats#709
jo-basevi wants to merge 5 commits intopayu-org:masterfrom
ACCESS-NRI:673-add-wrapper-cmd-for-logs-warn-errors

Conversation

@jo-basevi
Copy link
Copy Markdown
Collaborator

This PR:

  • Removes payu-branch, payu-clone, payu-checkout runscript commands (I think I mistakingly added these..)
  • Adds a wrapper script for running the runscript commands (e.g. payu-run, payu-sync, etc) and moved the parsing logic out of the subcommand modules.
  • Add another wrapper function to format logs, warnings, and catch exceptions. This is used by above wrapper and the general parse() method (used by payu setup, payu run)
  • Add --stacktrace flag for enabling stacktraces with exceptions and warnings (--verbose name for a flag was already taken by another payu command)
  • Add --log-level flag for enabling different level of logs.

I've only done a couple tests so far - which are mostly just manually adding random logger.debug, raise ValueError and warnings.warn() lines to methods to trigger errors.

Related to #673

@jo-basevi
Copy link
Copy Markdown
Collaborator Author

Stacktrace and log level arguments will need to be passed along to PBS Jobs. So they might need to be passed along and set as environment variables in the various runcmd() functions that generate a PBS job submission script (e.g. payu run, payu sync). These are typically set in this function:

def set_env_vars(init_run=None, n_runs=None, lab_path=None, dir_path=None,

Environment variables for stack-trace/log_level will also need to be checked in cli.py's _run_command().

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.

1 participant