Skip to content

Commit

Permalink
fixed issues hihglighted by flake
Browse files Browse the repository at this point in the history
  • Loading branch information
paolap committed Jul 10, 2024
1 parent 21d5ecf commit 7998353
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/mopper-conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
jobs:
build-linux:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
max-parallel: 5

Expand Down
2 changes: 1 addition & 1 deletion src/mopdb/mopdb_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ def read_map(fname, alias):
notes = row[16]
else:
notes = row[15]
if alias is '':
if alias == '':
alias = fname.replace(".csv","")
var_list.append(row[:11] + [notes, alias])
return var_list
Expand Down
5 changes: 3 additions & 2 deletions src/mopper/calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ def tos_3hr(var, landfrac):
vout : Xarray dataset
"""

v = tos_degC(var)
v = K_degC(var)

vout = xr.zeros_like(var)
t = len(var.time)
Expand Down Expand Up @@ -1346,6 +1346,7 @@ def get_basin_mask(ctx, lat, lon):
basin_mask: DataArray
basin_mask(lat,lon)
"""
var_log = logging.getLogger(ctx.obj['var_log'])
coords = ['t', 't']
if 'xu' in lon:
coords[0] = 'u'
Expand Down Expand Up @@ -1443,6 +1444,6 @@ def calc_depositions(ctx, var, weight=None):
varlist.append(v0)
if weight is None:
weight = 0.05844
deps = sum_vars(varlist) * mole_weight
deps = sum_vars(varlist) * weight
return deps

8 changes: 4 additions & 4 deletions src/mopper/setup_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
from json.decoder import JSONDecodeError

from mopdb.mopdb_utils import query
from mopdb.cmip_utils import fix_years


def write_var_map(outpath, table, matches):
Expand Down Expand Up @@ -166,7 +167,7 @@ def find_custom_tables(ctx):
mop_log = logging.getLogger('mop_log')
tables = []
path = ctx.obj['tables_path']
tables = ctx.obj['tables_path'].rglob("*_*.json")
table_files = ctx.obj['tables_path'].rglob("*_*.json")
for f in table_files:
f = str(f).replace(".json", "")
tables.append(f)
Expand Down Expand Up @@ -626,9 +627,8 @@ def define_files(ctx, cursor, opts, mp):
if mp['years'] != 'all' and ctx.obj['dreq_years']:
exp_start, exp_end = fix_years(mp['years'], exp_start[:4], exp_end[:4])
if exp_start is None:
mop_log.info("Years requested for variable are outside specified")
mop_log.info((f"period: {table_id}, {var},",
f"{match['tstart']}, {match['tend']}"))
mop_log.info(f"""Years requested for variable are outside
specified period: {mp['years']}""")
return
tstep_dict = {'10min': ['minutes=10', 'minutes=5'],
'30min': ['minutes=30', 'minutes=15'],
Expand Down

0 comments on commit 7998353

Please sign in to comment.