Commit b04db7f4 authored by Jan Klaus Rieck's avatar Jan Klaus Rieck

Merge branch 'use-stricter-flake' into 'master'

Use image with stricter flake8

See merge request !16
parents a3f75098 3f3fafe5
Pipeline #3648 passed with stage
in 1 minute and 36 seconds
image: git.geomar.de:11411/python/xorca_docker:v1.3.0
image: git.geomar.de:11411/python/xorca_docker:v2.0.0
pytest_and_coverage:
stage: test
......
......@@ -232,8 +232,7 @@ def construct_ef(ds_sel):
return e1f, e2f, e3f
def getbox(dataset, time=['1980-01-01', '1980-12-31'], depth=[100],
y=[30, 50], x=[-50, -80], surf=False):
def getbox(dataset, time=None, depth=None, y=None, x=None, surf=False):
""" extract 4-dimensional box from NEMO output on an ORCA grid, including
coordinates and data from mask- and mesh-files.
......@@ -274,9 +273,10 @@ def getbox(dataset, time=['1980-01-01', '1980-12-31'], depth=[100],
does not necessarily correspond to a rectangular box on the grid, that
is why there is NaNs in `data`!).
"""
x = np.array(x)
y = np.array(y)
time = time if time else ['1980-01-01', '1980-12-31']
depth = depth if depth else [100]
y = np.array(y) if y else np.array([30, 50])
x = np.array(x) if x else np.array([-50, -80])
# make sure the halo points of the global ORCA grid are dropped
ds = dataset.isel(x_c=slice(1, len(dataset['x_c']) - 1),
......@@ -615,7 +615,7 @@ def getlevs(var):
Levels of bins in `var`.
"""
levs = np.array([])
for val, arr in var:
for val, _arr in var:
levs = np.append(levs, val)
return levs
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment