diff --git a/.github/workflows/mopper-conda.yaml b/.github/workflows/mopper-conda.yaml index a8d26a6..f776b8f 100644 --- a/.github/workflows/mopper-conda.yaml +++ b/.github/workflows/mopper-conda.yaml @@ -14,6 +14,7 @@ on: jobs: build-linux: runs-on: ubuntu-latest + timeout-minutes: 60 strategy: max-parallel: 5 diff --git a/src/mopdb/mopdb_utils.py b/src/mopdb/mopdb_utils.py index b9875c7..32ceb81 100644 --- a/src/mopdb/mopdb_utils.py +++ b/src/mopdb/mopdb_utils.py @@ -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 diff --git a/src/mopper/calculations.py b/src/mopper/calculations.py index 1adf216..c87213a 100644 --- a/src/mopper/calculations.py +++ b/src/mopper/calculations.py @@ -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) @@ -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' @@ -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 diff --git a/src/mopper/setup_utils.py b/src/mopper/setup_utils.py index e0341fa..192f642 100755 --- a/src/mopper/setup_utils.py +++ b/src/mopper/setup_utils.py @@ -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): @@ -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) @@ -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'],