Skip to content

Commit

Permalink
Update tutorials from cylc-flow (#2816)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] authored Oct 21, 2024
1 parent 1a673c8 commit afbcede
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,18 @@ def __call__(self, grid_x, grid_y):
return z_val


def parse_domain(domain):
bbox = list(map(float, domain.split(',')))
def parse_domain(domain: str):
lng1, lat1, lng2, lat2 = list(map(float, domain.split(',')))
msg = "Invalid domain '{}' ({} {} >= {})"
if lng1 >= lng2:
raise ValueError(msg.format(domain, 'longitude', lng1, lng2))
if lat1 >= lat2:
raise ValueError(msg.format(domain, 'latitude', lat1, lat2))
return {
'lng1': bbox[0],
'lat1': bbox[1],
'lng2': bbox[2],
'lat2': bbox[3]
'lng1': lng1,
'lat1': lat1,
'lng2': lng2,
'lat2': lat2,
}


Expand Down

0 comments on commit afbcede

Please sign in to comment.