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

graph line continuation on boolean #4404

Merged
merged 15 commits into from
Sep 24, 2021

Conversation

wxtim
Copy link
Member

@wxtim wxtim commented Sep 10, 2021

These changes close #4390

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).
  • Appropriate tests are included (unit and/or functional).
  • Additionally refactored unittest test to pytest.
  • Appropriate change log entry included.
  • (master branch) I have opened a documentation PR at document graph line continuation on boolean cylc-doc#296.

I have left commits separate to make changes to the test easier to understand. If merging please squash.

@wxtim wxtim self-assigned this Sep 10, 2021
@wxtim wxtim added could be better Not exactly a bug, but not ideal. small labels Sep 10, 2021
@wxtim wxtim added this to the cylc-8.0.0 milestone Sep 10, 2021
@wxtim wxtim force-pushed the feature.graph-join-on-and-or branch from c1524ad to 3162307 Compare September 10, 2021 11:41
@wxtim wxtim marked this pull request as draft September 10, 2021 13:15
cylc/flow/graph_parser.py Outdated Show resolved Hide resolved
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.

(The one test that's failing should be an easy fix: tests/f/validate/62-null-task-name.t)

cylc/flow/graph_parser.py Outdated Show resolved Hide resolved
@hjoliver
Copy link
Member

(Oops, didn't notice this was still a draft PR, so maybe you handn't finished 😬 )

@wxtim
Copy link
Member Author

wxtim commented Sep 17, 2021

Only because that test broken and I'm holiday

Removed broken functional test of trailing &, which is now legal.
Added unit test for error if last line ends with a permitted continuation.
@wxtim wxtim marked this pull request as ready for review September 20, 2021 15:15
@wxtim wxtim force-pushed the feature.graph-join-on-and-or branch from 04e04b9 to 09533ee Compare September 21, 2021 08:43
@wxtim wxtim force-pushed the feature.graph-join-on-and-or branch from 09533ee to a36a1ae Compare September 21, 2021 09:01
@wxtim
Copy link
Member Author

wxtim commented Sep 21, 2021

@hjoliver can you pay particular attention to whether my merge with your recent master changes is OK?

@wxtim wxtim changed the title Feature.graph join on and or graph line continuation on boolean Sep 21, 2021
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.

Still not getting consistent treatment of the three continuation items.

# OK:
 a =>  # GraphParseError: Trailing continuation sequence (=>):a=>

# OK, but use consistent terminology)
 => a  # GraphParseError: Leading arrow: =>a

# OK:
 a &  # GraphParseError: Trailing continuation sequence (&):a&
 a |  # GraphParseError: Trailing continuation sequence (|):a|

# Not OK:
 & a  # valid
 | a  # valid

# OK:
 => a => b  # GraphParseError: Leading arrow: =>a=>b

# Not OK:
 & a => b  # GraphParseError: Null task name in graph: &a => b
 | a => b  # WorkflowConfigError: ERROR: bad trigger

cylc/flow/graph_parser.py Outdated Show resolved Hide resolved
wxtim and others added 4 commits September 22, 2021 07:49
Co-authored-by: Hilary James Oliver <hilary.j.oliver@gmail.com>
Co-authored-by: Hilary James Oliver <hilary.j.oliver@gmail.com>
…n-on-and-or

* upstream/master:
  Update cylc/flow/cfgspec/workflow.py
  clean up interim obselete message
  fix flake8-simplify failures caused by recently added checks. (cylc#4420)
@wxtim wxtim requested a review from hjoliver September 22, 2021 10:18
@wxtim
Copy link
Member Author

wxtim commented Sep 22, 2021

Still not getting consistent treatment of the three continuation items.

I there was 1 remaining case (leading continuation symbol) where the code was checking for => rather than the whole list. I think that I've fixed this now.

@@ -49,17 +50,42 @@ def test_parse_graph_fails_null_task_name(graph):
assert "Null task name in graph:" in str(cm.value)


@pytest.mark.parametrize('seq', ('&', '|', '=>'))
Copy link
Member Author

Choose a reason for hiding this comment

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

Factored out of the original test to allow this double parametrization.

Copy link
Member

Choose a reason for hiding this comment

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

Nice.

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.

All working well now 👍 Just one code simplification suggestion.

cylc/flow/graph_parser.py Outdated Show resolved Hide resolved
@@ -49,17 +50,42 @@ def test_parse_graph_fails_null_task_name(graph):
assert "Null task name in graph:" in str(cm.value)


@pytest.mark.parametrize('seq', ('&', '|', '=>'))
Copy link
Member

Choose a reason for hiding this comment

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

Nice.

wxtim and others added 2 commits September 23, 2021 07:16
Co-authored-by: Hilary James Oliver <hilary.j.oliver@gmail.com>
cylc/flow/graph_parser.py Outdated Show resolved Hide resolved
Co-authored-by: Hilary James Oliver <hilary.j.oliver@gmail.com>
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.

Thanks @wxtim all good 🎉

One review will do for this because: "time is of the essense" right now, plust it is somewhat peripheral functionality, and I've tested the hell out of it.

@hjoliver hjoliver merged commit 0d69823 into cylc:master Sep 24, 2021
@hjoliver hjoliver modified the milestones: cylc-8.0rc1, cylc-8.0b3 Sep 24, 2021
@wxtim wxtim deleted the feature.graph-join-on-and-or branch September 24, 2021 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
could be better Not exactly a bug, but not ideal. small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow graph line splitting on AND and OR?
3 participants