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

Conf tree #3559

Merged
merged 23 commits into from
May 19, 2020
Merged

Conf tree #3559

merged 23 commits into from
May 19, 2020

Conversation

oliver-sanders
Copy link
Member

@oliver-sanders oliver-sanders commented Apr 8, 2020

These changes close #3253

Sibling PRs:

Highlights:

  • Define the "specification" for the suite and global configurations using "context nodes".
  • Copy documentation in from cylc-doc (documentation will require review at a later date).

Other Stuff:

  • Port some functional tests to pytest.
  • Port some unittest to pytest.
  • Remove some unnecessary escape chars from the old RST docs.

Todo:

  • Add metavars for __MANY__ items.
  • Open a cylc-doc PR to autodocument this.

Future work:

  • Consider changing the options list to a dictionary.
  • Refactor the deprecation mechanism around the new configuration nodes.
  • Review all documentation and configurations!!!
  • Build examples into the parsec validator types.
    • Saves us having a PT1H example in every config which takes a duration as an arugment.
  • Use SPEC items for retrieving config values (e.g. self.config(SPEC['scheduling']['initial cycle point'])
    • Allows us to detect when we are still relying on deprecated configs in Cylc.
    • Allows us to add hyperlinks to the reference material in error messages.
  • Update all references configurations in the docs to use the :cylc:conf'[a][b]c' syntax.
    • Allows integrity checking of the documentation.
    • Gives you hyperlinks to the relevant sections.
    • Allows referencing of Cylc configurations from other Sphinx project (e.g. Rose).

Context Node Fun:

>>> from cylc.flow.cfgspec.suite import SPEC

>>> print(SPEC.tree())
    [meta]
        description
        group
        title
        URL
        __MANY__
    [cylc]
        UTC mode
        cycle point format
        cycle point num expanded year digits
...

>>> for conf in SPEC['scheduling']: print(repr(conf))
[scheduling]initial cycle point
[scheduling]final cycle point
[scheduling]initial cycle point constraints
...

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).
  • Appropriate change log entry included.
  • (master branch) I have opened a documentation PR at Conf tree cylc-doc#121

@oliver-sanders oliver-sanders added this to the cylc-8.0.0 milestone Apr 8, 2020
@oliver-sanders oliver-sanders self-assigned this Apr 8, 2020
@oliver-sanders
Copy link
Member Author

oliver-sanders commented Apr 9, 2020

An early example of what the built documentation will look like (using the default Sphinx theme)

Untitled2

And more:

Untitled3

With the Read The Docs theme it will look more like the rose API.

http://metomi.github.io/rose/doc/html/api/configuration/application.html#rose:file:rose-app.conf

@wxtim
Copy link
Member

wxtim commented Apr 14, 2020

An early example of what the built documentation will look like (using the default Sphinx theme)

Is this example based on the code in this branch? If so, how?

@oliver-sanders oliver-sanders force-pushed the conf-tree branch 4 times, most recently from 4b2eacf to fac95f2 Compare April 22, 2020 10:11
@oliver-sanders oliver-sanders marked this pull request as ready for review April 29, 2020 10:27
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.

An early example of what the built documentation will look like (using the default Sphinx theme)

Is this example based on the code in this branch? If so, how?

Once built, this snippet can be found in Docs » Reference » Configuration » Suite Configuration

cylc/flow/tests/parsec/test_types.py Outdated Show resolved Hide resolved
cylc/flow/tests/parsec/test_types.py Outdated Show resolved Hide resolved
cylc/flow/tests/parsec/test_types.py Outdated Show resolved Hide resolved
cylc/flow/tests/parsec/test_types.py Outdated Show resolved Hide resolved
cylc/flow/tests/parsec/__init__.py Outdated Show resolved Hide resolved
cylc/flow/tests/parsec/test_types.py Outdated Show resolved Hide resolved
cylc/flow/cfgspec/suite.py Outdated Show resolved Hide resolved
''')
Conf('max active cycle points', VDR.V_INTEGER, 3, desc='''
Runahead limiting prevents the fastest tasks in a suite from
getting too far ahead of the slowest ones, as documented in
Copy link
Contributor

Choose a reason for hiding this comment

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

Run ahead limit already documented a couple of lines up (line 252)

Copy link
Member Author

Choose a reason for hiding this comment

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

Configs gets alphabetically sorted before rendering the output in Sphinx so these two won't appear next to each other in the final docs.

directory paths involving the registration name in ``$PATH``
variables). They may not contain the "." character (it will be
interpreted as the namespace hierarchy delimiter, separating
groups and names -huh?).
Copy link
Contributor

Choose a reason for hiding this comment

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

-huh? ...is that supposed to be there?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably not! Unless it was special emphasis.

cylc/flow/cfgspec/suite.py Outdated Show resolved Hide resolved
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.

I have now built the docs, looks great. Minor suggestions across the 3 prs.

Co-authored-by: Melanie Hall <37735232+datamel@users.noreply.github.com>
@oliver-sanders
Copy link
Member Author

Thanks for putting up the typos as suggestions, made things much easier :)

@oliver-sanders oliver-sanders requested a review from kinow May 18, 2020 15:03
Copy link
Member

@kinow kinow left a comment

Choose a reason for hiding this comment

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

Tested with the cylc-doc PR.

@kinow kinow merged commit 5dc25e6 into cylc:master May 19, 2020
@oliver-sanders oliver-sanders deleted the conf-tree branch May 20, 2020 09:29
@dpmatthews dpmatthews modified the milestones: cylc-8.0.0, cylc-8.0a2 May 29, 2020
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.

build documentation into cylc.flow.cfgspec modules
5 participants