-
Notifications
You must be signed in to change notification settings - Fork 94
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
example: cycle on irregular intervals #6349
Conversation
(Code blocks currently render as errors due to a shortcoming in the Cylc lexer) |
Now sorted. |
@wxtim, this should now build correctly. Please can you give it a whirl and a once-over. |
|
||
.. tip:: | ||
|
||
You can see the result of this Jinja2 code by running the ``cylc view -p`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason why -p
(which expands everything), not -j
which just expands the jinja2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think -p
intelligently decides whether to use Jinja2 or EmPy pre-processing which makes it a little more generic / flexible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-p
and -j
are otherwise equivalent:
cylc-flow/cylc/flow/scripts/view.py
Lines 126 to 143 in a722b26
for line in read_and_proc( | |
flow_file, | |
get_template_vars(options), | |
viewcfg={ | |
'mark': options.mark, | |
'single': options.single, | |
'label': options.label, | |
'empy': options.empy or options.process, | |
'jinja2': options.jinja2 or options.process, | |
'contin': options.cat or options.process, | |
'inline': ( | |
options.jinja2 or options.empy or | |
options.inline or options.process | |
), | |
}, | |
opts=options, | |
): | |
print(line) |
# run this graph every year | ||
P1Y = """ | ||
install[^] => prep | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this item illustrates in this example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It demonstrates how to tie together bits of your workflow that follow regular cycling with bits that follow irregular cycling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all irregular cycling workflows are going to need this, but some will, so I added some text explaining the strftime
and loop.first
thinggies to help users with more advanced problems.
Just waiting on the upstream PR... |
Done. |
Closes #6336
Requires cylc/cylc-doc#759
Not perfect, but it saves us duping this support.
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).?.?.x
branch.