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

stop after cycle point: support offsets #5943

Merged
merged 4 commits into from
Feb 9, 2024
Merged

Conversation

oliver-sanders
Copy link
Member

@oliver-sanders oliver-sanders commented Jan 29, 2024

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 if present).
  • Tests are included (or explain why tests are not needed).
  • CHANGES.md entry included if this is a change that can affect users
  • Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@oliver-sanders oliver-sanders added this to the cylc-8.3.0 milestone Jan 29, 2024
@oliver-sanders oliver-sanders self-assigned this Jan 29, 2024
@@ -699,6 +700,30 @@ class CylcConfigValidator(ParsecValidator):
'-0830': 'UTC minus 8 hours and 30 minutes.'
}
),
V_CYCLE_POINT_WITH_OFFSETS: (
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a new parsec validator type which does the same thing as V_STRING.

It exists purely for documentation purposes.

@@ -993,6 +993,7 @@ def command_stop(
point = TaskID.get_standardised_point(cycle_point)
if point is not None and self.pool.set_stop_point(point):
self.options.stopcp = str(point)
self.config.stop_point = point
Copy link
Member Author

Choose a reason for hiding this comment

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

Spotted during testing, the config stop_point isn't updated when it is modified via the CLI, but the config hold_point is.

Copy link
Member

@wxtim wxtim left a comment

Choose a reason for hiding this comment

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

You have test failures - should be trivial fixes, as I think both are caused by a change in error message which reflects this PR being OK.

* Closes cylc#5939
* Support offsets (measured from the ICP) for the `stop after cycle point`
  to mirror the behaviour of the `final cycle point`.
* Add integration test to lock-down `stop after cycle point`
  interactions.
cylc/flow/cfgspec/workflow.py Outdated Show resolved Hide resolved
cylc/flow/cfgspec/workflow.py Outdated Show resolved Hide resolved
cylc/flow/parsec/validate.py Outdated Show resolved Hide resolved
cylc/flow/parsec/validate.py Outdated Show resolved Hide resolved
cylc/flow/parsec/validate.py Outdated Show resolved Hide resolved
cylc/flow/parsec/validate.py Outdated Show resolved Hide resolved
tests/unit/test_config.py Outdated Show resolved Hide resolved
Comment on lines -699 to +713
id="From config by default"
id="stopcp"
),
pytest.param(
'1993', '1066', '1066', '1066', None,
id="From options"
id="stop-cp-and-cli-option"
),
pytest.param(
'1993', 'reload', '1993', None, None,
id="From cfg if --stopcp=reload on restart"
id="stop-cp-and-cli-reload-option"
Copy link
Member

Choose a reason for hiding this comment

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

I think the previous ids were more descriptive

Copy link
Member Author

Choose a reason for hiding this comment

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

fair enough, I changed them to something more CLI friendly, suggestions welcome.

Copy link
Member

Choose a reason for hiding this comment

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

Having a short id plus a more descriptive comment would be reasonable IMO

Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
tests/unit/test_config.py Outdated Show resolved Hide resolved
tests/unit/test_config.py Outdated Show resolved Hide resolved
tests/unit/test_config.py Outdated Show resolved Hide resolved
tests/unit/test_config.py Outdated Show resolved Hide resolved
tests/unit/test_config.py Outdated Show resolved Hide resolved
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
tests/unit/test_config.py Outdated Show resolved Hide resolved
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
@wxtim wxtim merged commit 14711c9 into cylc:master Feb 9, 2024
27 checks passed
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.

config: support offsets in hold and stop after cycle points
3 participants