Skip to content

Conversation

@MetRonnie
Copy link
Member

@MetRonnie MetRonnie commented Oct 9, 2025

E.g. cylc play --startcp 'previous(T00)'

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).
  • No dependency changes
  • Tests are included (or explain why tests are not needed).
  • Changelog entry included if this is a change that can affect users
  • Docs updated
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@MetRonnie MetRonnie added this to the 8.6.1 milestone Oct 9, 2025
@MetRonnie MetRonnie self-assigned this Oct 9, 2025
@MetRonnie MetRonnie added the small label Oct 9, 2025
@oliver-sanders
Copy link
Member

Ensure next/prev syntax works for --startcp option

Is this not adding support for the next/prev syntax here?

@MetRonnie
Copy link
Member Author

Yes, it seems to be an odd omission seeing as it works for the initial cycle point option

@oliver-sanders
Copy link
Member

Er, it was only ever intended / documented to work at the ICP, but I can see why it might be useful for the start cycle (though I don't think opps would want to specify the warm cycle point implicitly like this?). Plz can you change from "fix" to "feat".

@MetRonnie
Copy link
Member Author

though I don't think opps would want to specify the warm cycle point implicitly like this?

Warm start from 00Z, 12Z etc? This is why I implemented it!

"Set the start cycle point, which may be after"
" the initial cycle point. If the specified start point is"
" not in the sequence, the next on-sequence point will"
" be used. (Not to be confused with the initial cycle 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.

(I notice leading spaces have crept into the codebase - not sure what the motivation is, as this is not how we write paragraphs ordinarily. Perhaps we should specify the style to follow to avoid inconsistency?)

Copy link
Member

@oliver-sanders oliver-sanders Oct 23, 2025

Choose a reason for hiding this comment

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

???

Whether the space goes at the start or end of the line is arbitrary, neither is "how we write paragraphs ordinarily" since we don't write this whitespace in plain text. So neither way is right or wrong, natural or unnatural, it's just a style choice like any other.

Leading spaces are preferable because it is much easier to spot when a space has been omitted as they are all aligned in the first column (we have had several cases where tailing spaces were omitted) and with this arrangement commenting out or removing a line will never leave an erroneous space.

It's exactly the same reason why placing operators at the start rather than end of the line is considered preferable (PEP8, flake8, black, ruff, prettier).

FYI: There are no linting rules for strings, so style cannot be enforced.

Copy link
Member

Choose a reason for hiding this comment

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

I agree with @oliver-sanders

Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

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

LGTM but can't test ATM.

@@ -0,0 +1 @@
Ensure `next()/previous()` syntax works for the `cylc play --startcp` option.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Ensure `next()/previous()` syntax works for the `cylc play --startcp` option.
Add support for the `next()/previous()` syntax with the `cylc play --startcp` option.

"Set the start cycle point, which may be after"
" the initial cycle point. If the specified start point is"
" not in the sequence, the next on-sequence point will"
" be used. (Not to be confused with the initial cycle point)"),
Copy link
Member

@oliver-sanders oliver-sanders Oct 23, 2025

Choose a reason for hiding this comment

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

???

Whether the space goes at the start or end of the line is arbitrary, neither is "how we write paragraphs ordinarily" since we don't write this whitespace in plain text. So neither way is right or wrong, natural or unnatural, it's just a style choice like any other.

Leading spaces are preferable because it is much easier to spot when a space has been omitted as they are all aligned in the first column (we have had several cases where tailing spaces were omitted) and with this arrangement commenting out or removing a line will never leave an erroneous space.

It's exactly the same reason why placing operators at the start rather than end of the line is considered preferable (PEP8, flake8, black, ruff, prettier).

FYI: There are no linting rules for strings, so style cannot be enforced.

Comment on lines +126 to +130
"Set the initial cycle point. "
"Required if not defined in flow.cylc.\n"
"Can be an absolute point or an offset relative to the "
"current time - see "
f"{SHORTLINK_TO_ICP_DOCS} (Cylc documentation link)."
Copy link
Member

Choose a reason for hiding this comment

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

Why change this?

Copy link
Member Author

Choose a reason for hiding this comment

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

For clarity

Comment on lines +176 to +182
"Set the start cycle point, which may be after "
"the initial cycle point. "
"If the specified start point is not in the sequence, the next "
"on-sequence point will be used.\n"
"Can be an absolute point or an offset relative to the "
"current time, like the --initial-cycle-point option - see "
f"{SHORTLINK_TO_ICP_DOCS} (Cylc documentation link)."
Copy link
Member

Choose a reason for hiding this comment

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

Why change this?

@oliver-sanders oliver-sanders requested a review from wxtim October 23, 2025 12:47
@wxtim
Copy link
Member

wxtim commented Oct 24, 2025

Looks LGTM, and seemed to work when I tried it out, apart from a bug where Cylc VIP or Play seems to freeze if the startcp >> icp because checking whether it is in the sequence(s) can take a long time if there are lots of items in the sequence.

@oliver-sanders
Copy link
Member

(unrelated issue)

@MetRonnie
Copy link
Member Author

@wxtim are you going to approve?

"Set the start cycle point, which may be after"
" the initial cycle point. If the specified start point is"
" not in the sequence, the next on-sequence point will"
" be used. (Not to be confused with the initial cycle point)"),
Copy link
Member

Choose a reason for hiding this comment

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

I agree with @oliver-sanders

@wxtim
Copy link
Member

wxtim commented Nov 5, 2025

@wxtim are you going to approve?

Sort of - I failed to spot that I had pending comments - I agree with Oliver about where spacing goes, and even if I didn't I'd rather not have changes like that in this PR.

Technically, I think it works. 👍🏼

@MetRonnie
Copy link
Member Author

MetRonnie commented Nov 5, 2025

I haven't changed the whitespace just for the sake of it, it was along with a bit of a rewrite for clarity. Happy to change the whitespace back although it sounded like there was no consensus on it (and I can't say I am compelled by the argument for leading whitespace within strings like that, I find it a bit more difficult to read that way).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants