Skip to content

Commit

Permalink
Merge pull request #67 from MetRonnie/tutorial
Browse files Browse the repository at this point in the history
Tutorial stuff
  • Loading branch information
oliver-sanders committed Apr 4, 2024
2 parents 86c57b4 + 0211929 commit 5e91a6f
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ from glob import glob
import math
import os
import sys
import time

import util

Expand Down Expand Up @@ -116,5 +115,5 @@ def main():


if __name__ == '__main__':
time.sleep(2) # make the tutorial run a little slower
util.sleep()
main()
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Environment Variables:
import os
from subprocess import Popen, PIPE
import sys
import time

import util

Expand Down Expand Up @@ -243,7 +242,7 @@ def main(forecast_interval, forecast_iterations):


if __name__ == '__main__':
time.sleep(4) # make the tutorial run a little slower
util.sleep()
try:
args = [int(sys.argv[1]), int(sys.argv[2])]
except IndexError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ from datetime import datetime
import json
import os
import re
import time

import requests

import util


BASE_URL = ('http://datapoint.metoffice.gov.uk/public/data/'
'val/wxobs/all/json/{site_id}'
Expand Down Expand Up @@ -216,6 +217,6 @@ def main(site_id, api_key=None):


if __name__ == '__main__':
time.sleep(2) # make the tutorial run a little slower
util.sleep()
main(os.environ['SITE_ID'],
os.environ.get('API_KEY'))
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ from datetime import datetime
import math
import os
import shutil
import time

import requests

Expand Down Expand Up @@ -196,5 +195,5 @@ def main():


if __name__ == '__main__':
time.sleep(2) # make the tutorial run a little slower
util.sleep(2) # make the tutorial run a little slower
main()
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Environment Variables:
from datetime import datetime, timedelta
import os
import sys
import time

import util

Expand Down Expand Up @@ -102,7 +101,7 @@ def main(site_name, time):


if __name__ == '__main__':
time.sleep(2) # make the tutorial run a little slower
util.sleep()
try:
args = (sys.argv[1].lower(), int(sys.argv[2]))
except IndexError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
from copy import copy
from contextlib import suppress
import math
import jinja2
import os
import sys
import time

import jinja2

R_0 = 6371. # Radius of the Earth (km).

Expand Down Expand Up @@ -301,3 +303,12 @@ def generate_html_map(filename, template_file, data, domain, resolution):
lat2=domain['lat2'],
data=data
))


def sleep(secs=4):
"""Make the tutorials run a little slower so users can follow along.
(Only if not running in CI).
"""
if 'CI' not in os.environ:
time.sleep(secs)
1 change: 1 addition & 0 deletions cylc/flow/etc/tutorial/runtime-tutorial/flow.cylc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!jinja2
[scheduler]
UTC mode = True
allow implicit tasks = True # TODO: remove at end of exercise

[scheduling]
# TODO: Set initial cycle point
Expand Down

0 comments on commit 5e91a6f

Please sign in to comment.