Skip to content

Commit

Permalink
removed try/except
Browse files Browse the repository at this point in the history
  • Loading branch information
ledm committed Mar 26, 2024
1 parent 769f61d commit a622f61
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bgcval2/bgcvaltools/makeMask.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from calendar import month_name
from shelve import open as shOpen
import os
from glob import glob
from bgcval2.Paths.paths import paths
from netCDF4 import Dataset
import bgcval2.bgcvaltools.bv2tools as bvt
Expand Down Expand Up @@ -483,11 +484,11 @@ def makeMask(name, newSlice, xt, xz, xy, xx, xd, debug=False):

shelveFn = bvt.folder(os.path.join(paths.shelvedir, "MatchingMasks/"))+ newSlice+"_diag_maskMask.shelve"

try:
if len(glob(shelveFn+'*')):
# Shelve already exists:
with shOpen(shelveFn) as sh:
lldict = sh['lldict']

except:
else:
lldict = {}

print("Bathy mask: before mask:", newSlice, nmask.sum(), 'of',
Expand Down

0 comments on commit a622f61

Please sign in to comment.