cylc / cylc-doc

Documentation (User Guide, Cheat Sheets, etc.) for the Cylc Workflow Engine.
https://cylc.github.io/cylc-doc/
GNU General Public License v3.0
9 stars 19 forks source link

Docs: "Splitting Up Long Graph Lines" is misleading #766

Open elliotfontaine opened 1 week ago

elliotfontaine commented 1 week ago

Description

Splitting Up Long Graph Lines

It is not necessary to use the fragile line continuation marker \ to split long graph lines. You can break at dependency arrows (=>) and operators (&, |), or split long chains into smaller ones. This graph:

R1 = "A & B => C"

is equivalent to this:

R1 = """
    A & B =>
    C
"""

and also to this:

R1 = """
    A &
    B => C
"""

The docs imply that you need to have the symbol at the end of the first line, for line continuation to work. However, this works too:

R1 = """
    A & B
    => C
"""

Reproducible Example

https://github.com/cylc/cylc-flow/blob/master/tests/functional/ext-trigger/00-satellite/flow.cylc , cylc graph is the same for the following 3 permutations:

P1 = """
            # Processing chain for each dataset
            get_data => proc1 => proc2 => products
            # As one dataset is retrieved, start waiting on another.
            get_data[-P1] => get_data
        """
P1 = """
            # Processing chain for each dataset
            get_data => proc1 => proc2 => 
            products
            # As one dataset is retrieved, start waiting on another.
            get_data[-P1] => get_data
        """
P1 = """
            # Processing chain for each dataset
            get_data => proc1 => proc2
            => products
            # As one dataset is retrieved, start waiting on another.
            get_data[-P1] => get_data
        """

Expected Behaviour

For it to be documented.

elliotfontaine commented 1 week ago

This should probably be an issue for https://github.com/cylc/cylc-doc. But I wasn't 100% of it being expected behavior.

I'll close and repost it on the docs repo if needed.

hjoliver commented 4 days ago

Thanks @elliotfontaine - fair point. No need to close and repost, I can move the issue to cylc-doc.