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

Xtriggers: Doc Fixes #686

Merged
merged 17 commits into from
Apr 26, 2024
Merged

Xtriggers: Doc Fixes #686

merged 17 commits into from
Apr 26, 2024

Conversation

wxtim
Copy link
Member

@wxtim wxtim commented Feb 1, 2024

Companion to cylc/cylc-flow#5955.
Closes #106

Also contains some misc fixes.

  • Have make clean remove src/plugins/xtriggers.
  • Make the xtrigger plugins document the eponymous method rather than the module: i.e. xtrigger.xtrigger.__doc__ not xtrigger.__doc__, which has almost no information.
  • Note the existence of validation functions in src/user-guide/writing_workflows/external_triggers.
  • Give an example of a simple xtrigger validation function.

Requirements check-list

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.

- Make the extrigger plugins document the eponymous method rather than the module.
- Note the existence of	validation functions in	src/user-guide/writing_workflows/external_triggers.
- Give an example of a simple xtrigger validation function.
@wxtim wxtim requested a review from MetRonnie February 1, 2024 15:48
@wxtim wxtim self-assigned this Feb 1, 2024
@wxtim wxtim added this to the 8.3.0 milestone Feb 1, 2024
@wxtim wxtim mentioned this pull request Feb 1, 2024
8 tasks
Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

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

After my suggestions to cylc/cylc-flow#5955 are resolved:

src/user-guide/writing-workflows/external-triggers.rst Outdated Show resolved Hide resolved
src/user-guide/writing-workflows/external-triggers.rst Outdated Show resolved Hide resolved
src/user-guide/writing-workflows/external-triggers.rst Outdated Show resolved Hide resolved
src/user-guide/writing-workflows/external-triggers.rst Outdated Show resolved Hide resolved
Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

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

* Fix xtrigger entry point example

* Update xtrigger plugins docs
- Added	"secs" and "subprocess"	to dictionary.
@wxtim wxtim requested a review from MetRonnie February 22, 2024 08:59
@MetRonnie

This comment was marked as resolved.

@wxtim

This comment was marked as resolved.

@wxtim wxtim marked this pull request as draft February 23, 2024 11:46
@wxtim wxtim marked this pull request as ready for review February 23, 2024 13:57
@wxtim

This comment was marked as resolved.

@MetRonnie

This comment was marked as resolved.

@MetRonnie

This comment was marked as resolved.

@MetRonnie
Copy link
Member

Kicking tests

@MetRonnie
Copy link
Member

Ugh, still failing because apparently we run doctests here?

@@ -146,6 +148,7 @@ ret
retrigger
retriggered
retriggering
rmtree
Copy link
Member

@oliver-sanders oliver-sanders Feb 26, 2024

Choose a reason for hiding this comment

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

Manually adding every argument name to the dictionary is going to get painful.

Any ideas on excluding function signatures and argument lists from spellcheck?

Copy link
Member Author

Choose a reason for hiding this comment

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

@oliver-sanders I've worked up a proof of concept at https://github.com/cylc/cylc-doc/compare/master...wxtim:cylc-doc:custom_filter_for_Cylc_Words?expand=1 - but I'm not terribly happy with the methods at the top of cylc.doc.filters which are scraping the Cylc code.

@MetRonnie
Copy link
Member

MetRonnie commented Mar 22, 2024

@oliver-sanders Even if I add the required xtrigger imports in a .. testsetup:: block, the Sphinx doctest does not seem to obey the patching done in the xrandom doctest: https://github.com/cylc/cylc-flow/blob/2b2fc7721f4bc0c05c7384170ddc82278aad5875/cylc/flow/xtriggers/xrandom.py#L69-L75 so the doctest is flaky

There is apparently no way to exclude cylc/flow/ code from Sphinx doctest either.

So I think we will either have to remove the doctest extension from conf.py or remove the examples in the xrandom docstring?

@oliver-sanders
Copy link
Member

I don't think testsetup will help here?

Have you tried replacing __name__ with its expected value?

@MetRonnie
Copy link
Member

MetRonnie commented Apr 23, 2024

Would be good to get this in. Pending:

  • Small merge conflict
  • Decision on whether to remove the doctest extension from conf.py or remove the examples in the xrandom docstring

@oliver-sanders
Copy link
Member

oliver-sanders commented Apr 23, 2024

Fine, check that:

  • There aren't any doctests in the cylc-doc codebase.
  • Doctests are definitely run as part of regular tests in all the upstream repos.

If so, we can remove the doctest build from cylc-doc. This build predated our use of pytest which we now configure to run doctests on the source repos.

@MetRonnie
Copy link
Member

MetRonnie commented Apr 23, 2024

Checked; doctests (on master) currently only test cylc/flow/jinja/filters which is definitely already doctested in cylc-flow

PR opened at wxtim#8

Xtrigger docs: remove doctest
@oliver-sanders
Copy link
Member

Recommendation: wxtim#9

@MetRonnie MetRonnie mentioned this pull request Apr 25, 2024
@MetRonnie
Copy link
Member

Hopefully the last recommendation: wxtim#10

@oliver-sanders oliver-sanders self-requested a review April 25, 2024 15:13
Comment on lines +403 to +404
:members: xrandom, validate
:member-order: bysource
Copy link
Member

@oliver-sanders oliver-sanders Apr 25, 2024

Choose a reason for hiding this comment

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

It is not helpful to provide API reference for this internal interface as it has no valid external application.

Suggested change
:members: xrandom, validate
:member-order: bysource
:members: xrandom

Copy link
Member

Choose a reason for hiding this comment

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

True but it does provide a link to the source so it is not useless IMO

Copy link
Member

Choose a reason for hiding this comment

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

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.

Looks good 👍

@MetRonnie MetRonnie merged commit a5bf3d0 into cylc:master Apr 26, 2024
1 check 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.

document built-in xtriggers
4 participants