Skip to content

Commit

Permalink
Fix Tutorials (#2633)
Browse files Browse the repository at this point in the history
Fix tutorials
* Update .gitignore
* Fix tutorials
Co-authored-by: Oliver Sanders <[email protected]>
  • Loading branch information
MetRonnie authored Oct 26, 2022
1 parent 58dce23 commit 861b8ac
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 41 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ htmlcov/
*.egg-info
.vscode/
.pytest_cache/
node_modules/
1 change: 1 addition & 0 deletions etc/tutorial/consolidation-tutorial/etc
6 changes: 3 additions & 3 deletions etc/tutorial/consolidation-tutorial/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[[[PT3H]]]
# Repeat every three hours starting at the initial cycle point.
graph = """
get_observations_belmullet => consolidate_observations
get_observations_aldergrove => consolidate_observations
get_observations_camborne => consolidate_observations
get_observations_heathrow => consolidate_observations
get_observations_shetland => consolidate_observations
Expand All @@ -31,10 +31,10 @@
forecast[-PT6H] => forecast
"""
[runtime]
[[get_observations_belmullet]]
[[get_observations_aldergrove]]
script = get-observations
[[[environment]]]
SITE_ID = 3976
SITE_ID = 3917
API_KEY = DATAPOINT_API_KEY
[[get_observations_camborne]]
script = get-observations
Expand Down
6 changes: 3 additions & 3 deletions etc/tutorial/cylc-forecasting-suite/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
UTC mode = True
[[parameters]]
# A list of the weather stations we will be fetching observations from.
station = camborne, heathrow, shetland, belmullet
station = camborne, heathrow, shetland, aldergrove
# A list of the sites we will be generating forecasts for.
site = exeter

Expand Down Expand Up @@ -52,9 +52,9 @@
# To use archived data comment this line out.
API_KEY = DATAPOINT_API_KEY

[[get_observations<station=belmullet>]]
[[get_observations<station=aldergrove>]]
[[[environment]]]
SITE_ID = 3976
SITE_ID = 3917
[[get_observations<station=camborne>]]
[[[environment]]]
SITE_ID = 3808
Expand Down
1 change: 1 addition & 0 deletions etc/tutorial/rose-suite-tutorial/etc
1 change: 1 addition & 0 deletions etc/tutorial/rose-weather-forecasting-suite/etc
4 changes: 2 additions & 2 deletions etc/tutorial/runtime-introduction/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
get_observations_camborne => consolidate_observations
get_observations_heathrow => consolidate_observations
get_observations_shetland => consolidate_observations
get_observations_belmullet => consolidate_observations
get_observations_aldergrove => consolidate_observations
"""
[[[T06/PT6H]]]
graph = """
Expand All @@ -25,7 +25,7 @@
"""

[runtime]
[[get_observations_belmullet]]
[[get_observations_aldergrove]]
script = get-observations

[[get_observations_camborne]]
Expand Down
1 change: 1 addition & 0 deletions etc/tutorial/runtime-tutorial/etc
2 changes: 1 addition & 1 deletion etc/tutorial/runtime-tutorial/suite.rc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[[[PT3H]]]
# Repeat every three hours starting at the initial cycle point.
graph = """
get_observations_belmullet => consolidate_observations
get_observations_aldergrove => consolidate_observations
get_observations_camborne => consolidate_observations
get_observations_heathrow => consolidate_observations
get_observations_shetland => consolidate_observations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ Runtime
inherit = GET_OBSERVATIONS
[[[environment]]]
SITE_ID = 3005
[[get_observations_belmullet]]
[[get_observations_aldergrove]]
inherit = GET_OBSERVATIONS
[[[environment]]]
SITE_ID = 3976
SITE_ID = 3917
Graphing
Expand All @@ -132,7 +132,7 @@ Graphing
get_observations_heathrow => consolidate_observations
get_observations_camborne => consolidate_observations
get_observations_shetland => consolidate_observations
get_observations_belmullet => consolidate_observations
get_observations_aldergrove => consolidate_observations
.. ifnotslides::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ Consolidating Configuration
[[[environment]]]
SITE_ID = 3005
API_KEY = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
[[get_observations_belmullet]]
[[get_observations_aldergrove]]
script = get-observations
[[[environment]]]
SITE_ID = 3976
SITE_ID = 3917
API_KEY = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
.. ifnotslides::
Expand Down Expand Up @@ -68,7 +68,7 @@ Consolidating Configuration
[[dependencies]]
[[[T00/PT3H]]]
graph = """
get_observations_belmullet => consolidate_observations
get_observations_aldergrove => consolidate_observations
get_observations_camborne => consolidate_observations
get_observations_heathrow => consolidate_observations
get_observations_shetland => consolidate_observations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ define a dictionary of station and ID pairs:

.. code-block:: css+jinja

{% set stations = {'belmullet': 3976,
{% set stations = {'aldergrove': 3917,
'camborne': 3808,
'heathrow': 3772,
'shetland': 3005} %}
Expand All @@ -97,7 +97,7 @@ After processing, this would result in:

.. code-block:: none
belmullet
aldergrove
camborne
heathrow
shetland
Expand All @@ -116,7 +116,7 @@ This would result in:

.. code-block:: none
belmullet - 3976
aldergrove - 3917
camborne - 3808
heathrow - 3772
shetland - 3005
Expand All @@ -132,7 +132,7 @@ This would result in:
#!Jinja2
{% set stations = {'belmullet': 3976,
{% set stations = {'aldergrove': 3917,
'camborne': 3808,
'heathrow': 3772,
'shetland': 3005} %}
Expand Down Expand Up @@ -217,10 +217,10 @@ This would result in:
SITE_ID = 3005
- API_KEY = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ API_KEY = {{ API_KEY }}
[[get_observations_belmullet]]
[[get_observations_aldergrove]]
script = get-observations
[[[environment]]]
SITE_ID = 3976
SITE_ID = 3917
- API_KEY = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
+ API_KEY = {{ API_KEY }}
[[get_rainfall]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ Parameters can be either words or integers:
[[[environment]]]
API_KEY = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
[[get_observations<station=belmullet>]]
[[get_observations<station=aldergrove>]]
[[[environment]]]
SITE_ID = 3976
SITE_ID = 3917
[[get_observations<station=camborne>]]
[[[environment]]]
SITE_ID = 3808
Expand Down Expand Up @@ -214,7 +214,7 @@ Parameters can be either words or integers:
[cylc]
UTC mode = True
+ [[parameters]]
+ station = belmullet, camborne, heathrow, shetland
+ station = aldergrove, camborne, heathrow, shetland
Remove the four ``get_observations`` tasks and insert the following code
in their place:
Expand Down Expand Up @@ -248,7 +248,7 @@ Parameters can be either words or integers:

The relevant IDs are:

* Belmullet - ``3976``
* Aldergrove - ``3917``
* Camborne - ``3808``
* Heathrow - ``3772``
* Shetland - ``3005``
Expand All @@ -257,9 +257,9 @@ Parameters can be either words or integers:

.. code-block:: cylc
[[get_observations<station=belmullet>]]
[[get_observations<station=aldergrove>]]
[[[environment]]]
SITE_ID = 3976
SITE_ID = 3917
[[get_observations<station=camborne>]]
[[[environment]]]
SITE_ID = 3808
Expand All @@ -286,7 +286,7 @@ Parameters can be either words or integers:
[[[PT3H]]]
# Repeat every three hours starting at the initial cycle point.
graph = """
- get_observations_belmullet => consolidate_observations
- get_observations_aldergrove => consolidate_observations
- get_observations_camborne => consolidate_observations
- get_observations_heathrow => consolidate_observations
- get_observations_shetland => consolidate_observations
Expand Down Expand Up @@ -327,7 +327,7 @@ Parameters can be either words or integers:
[cylc]
UTC mode = True
[[parameters]]
station = belmullet, camborne, heathrow, shetland
station = aldergrove, camborne, heathrow, shetland
+ site = exeter, edinburgh
Next we parameterise the task in the graph:
Expand Down
9 changes: 4 additions & 5 deletions sphinx/tutorial/cylc/runtime/runtime-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ Start, Stop, Restart

* Camborne - ``3808``
* Shetland - ``3005``
* Belmullet - ``3976``
* Aldergrove - ``3917``

.. spoiler:: Solution warning

Expand All @@ -356,10 +356,10 @@ Start, Stop, Restart
[[[environment]]]
SITE_ID = 3005
API_KEY = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
[[get_observations_belmullet]]
[[get_observations_aldergrove]]
script = get-observations
[[[environment]]]
SITE_ID = 3976
SITE_ID = 3917
API_KEY = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Check the ``suite.rc`` file is valid by running the command:
Expand Down Expand Up @@ -449,7 +449,7 @@ Start, Stop, Restart
cylc gui runtime-tutorial &
Run the suite either by:

* Pressing the play button in the Cylc GUI. Then, ensuring that
"Cold Start" is selected within the dialogue window, pressing the
"Start" button.
Expand Down Expand Up @@ -500,4 +500,3 @@ Start, Stop, Restart
i.e. the final cycle point.
* ``task-name`` - set this to "forecast".
* ``submission-number`` - set this to "01".

8 changes: 4 additions & 4 deletions sphinx/tutorial/cylc/scheduling/datetime-cycling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ Putting It All Together
build a picture of the current weather. Our dummy weather forecast
will get wind observations from four weather stations:

* Belmullet
* Aldergrove
* Camborne
* Heathrow
* Shetland
Expand All @@ -341,13 +341,13 @@ Putting It All Together

size = "7,4"

get_observations_belmullet -> consolidate_observations
get_observations_aldergrove -> consolidate_observations
get_observations_camborne -> consolidate_observations
get_observations_heathrow -> consolidate_observations
get_observations_shetland -> consolidate_observations

hidden [style="invis"]
get_observations_belmullet -> hidden [style="invis"]
get_observations_aldergrove -> hidden [style="invis"]
get_observations_camborne -> hidden [style="invis"]
hidden -> consolidate_observations [style="invis"]

Expand Down Expand Up @@ -532,7 +532,7 @@ Putting It All Together
[[dependencies]]
[[[PT3H]]]
graph = """
get_observations_belmullet => consolidate_observations
get_observations_aldergrove => consolidate_observations
get_observations_camborne => consolidate_observations
get_observations_heathrow => consolidate_observations
get_observations_shetland => consolidate_observations
Expand Down
6 changes: 3 additions & 3 deletions sphinx/tutorial/rose/suites.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ See the :ref:`Cheat Sheet` for more information.
.. code-block:: rose
[jinja2:suite.rc]
station="camborne", "heathrow", "shetland", "belmullet"
station="camborne", "heathrow", "shetland", "aldergrove"
[env]
RESOLUTION=0.2
Expand Down Expand Up @@ -411,7 +411,7 @@ See the :ref:`Cheat Sheet` for more information.
UTC mode = True
[[parameters]]
# A list of the weather stations we will be fetching observations from.
- station = camborne, heathrow, shetland, belmullet
- station = camborne, heathrow, shetland, aldergrove
+ station = {{ station | join(", ") }}
# A list of the sites we will be generating forecasts for.
site = exeter
Expand Down Expand Up @@ -719,6 +719,6 @@ Rose Bush
to least recent. Near the top you should see an entry for the
``forecast`` task. On the right-hand side of the screen click
:guilabel:`job-map.html`.

As this file has a ``.html`` extension Rose Bush will render it.
The raw text would be displayed otherwise.

0 comments on commit 861b8ac

Please sign in to comment.