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

parsec: add help for coercers (data types) #3439

Merged
merged 1 commit into from
Nov 29, 2019

Conversation

oliver-sanders
Copy link
Member

@oliver-sanders oliver-sanders commented Nov 15, 2019

Document the parsec "types" from within Pasec for use by autodocumentation systems.

  • add doctests for each coercer
  • make all coercers classmethods
  • document coercers
  • test examples in documentation

Trying for the simplest, least hassle way of doing this, in the long run we will want to refactor things somewhat. At Cylc9 we may well brush this code aside entirely.

This documentation will be used to generate reference material like this:

Screenshot from 2019-11-15 12-56-33

These changes partially address #3253, cylc/cylc-doc#101

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).
  • No change log entry required (invisible to users).
  • Documentation branch will follow at a later date, see autodocument cylc configurations cylc-doc#101

* add doctests for each coercer
* make all coercers classmethods
* document coercers
* test examples in documentation
@oliver-sanders oliver-sanders added the doc Documentation label Nov 15, 2019
@oliver-sanders oliver-sanders added this to the cylc-8.0a2 milestone Nov 15, 2019
@oliver-sanders oliver-sanders self-assigned this Nov 15, 2019
},
[
('std:term', 'cycle point'),
('std:term', 'ISO8601 duration')
Copy link
Member Author

Choose a reason for hiding this comment

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

These are reference-able items in the Cylc documentation.

@@ -550,9 +801,16 @@ def coerce_cycle_point_time_zone(cls, value, keys):
'cycle point time zone format', keys, value)
return value

def coerce_interval(self, value, keys):
"""Coerce an ISO 8601 interval (or number: back-comp) into seconds."""
Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like this back-comp documentation is out of date?

Have removed.

@@ -155,3 +155,12 @@ def get_signature(self):
args = self.func_args + [
"%s=%s" % (i, self.func_kwargs[i]) for i in skeys]
return "%s(%s)" % (self.func_name, ", ".join([str(a) for a in args]))

def __str__(self):
Copy link
Member Author

Choose a reason for hiding this comment

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

Represents a sub proc context thinggy like this:

func(arg):interval

Tested in coerce_xtrigger.

@hjoliver hjoliver merged commit dec9e30 into cylc:master Nov 29, 2019
@oliver-sanders oliver-sanders deleted the parsec-type-help branch November 29, 2019 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants