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

Tidy & homogenise usage of CylcOptionParser #4809

Merged
merged 1 commit into from
Apr 20, 2022

Conversation

MetRonnie
Copy link
Member

  • Centralise common ID arg (name, description) tuples
  • Add docstring to CylcOptionParser.__init__()
  • Remove CylcOptionParser's prep argument

This is a small change with no associated Issue. But would be a useful thing to get in before #4676

Requirements check-list

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg and conda-environment.yml.
  • Already covered by existing tests.
  • No change log entry required (invisible to users).
  • No documentation update required.

@MetRonnie MetRonnie added this to the cylc-8.0rc3 milestone Apr 7, 2022
@MetRonnie MetRonnie self-assigned this Apr 7, 2022
@MetRonnie MetRonnie force-pushed the opt-parse-refactor branch 2 times, most recently from 74dcbe6 to 0bb5441 Compare April 7, 2022 17:41
@hjoliver
Copy link
Member

hjoliver commented Apr 8, 2022

Remove CylcOptionParser's prep argument

👍 I just started making near-identical changes while looking at #4810, but fortunately saw this PR in time 😁

@MetRonnie
Copy link
Member Author

I have actually had this branch going for months, good thing I finally got round to opening a PR for it 😅

Copy link
Contributor

@datamel datamel left a comment

Choose a reason for hiding this comment

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

Great change, much nicer. Working well for me. I have manually tested and run unit tests locally, no problems found.

cylc/flow/option_parsers.py Outdated Show resolved Hide resolved
cylc/flow/option_parsers.py Outdated Show resolved Hide resolved
Comment on lines +491 to +495
@staticmethod
def optional(arg: Tuple[str, str]) -> Tuple[str, str]:
"""Make an argdoc tuple display as an optional arg with
square brackets."""
name, doc = arg
return (f'[{name}]', doc)
Copy link
Member

Choose a reason for hiding this comment

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

Not sure this is actually helpful but don't mind it that much.

@MetRonnie MetRonnie force-pushed the opt-parse-refactor branch 2 times, most recently from b88c079 to 8e1c103 Compare April 19, 2022 16:49
- Centralise common ID arg (name, description) tuples
- Add docstring to CylcOptionParser `__init__()`
- Remove CylcOptionParser's 'prep' argument
@hjoliver
Copy link
Member

But would be a useful thing to get in before #4676

Sorry, I didn't see this comment before merging that PR.

Copy link
Member

@hjoliver hjoliver left a comment

Choose a reason for hiding this comment

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

Nice tidy-up. Tests all pass on re-run, no issues found. Oliver's comment was addressed.

@hjoliver hjoliver merged commit 6fc565a into cylc:master Apr 20, 2022
@MetRonnie MetRonnie deleted the opt-parse-refactor branch April 20, 2022 09:12
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.

4 participants