Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore iternums which only have pickup files #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion xmitgcm/mds_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ def _concat_dicts(list_of_dicts):


def _get_all_iternums(data_dir, file_prefixes=None,
file_format='*.??????????.data'):
file_format='*.??????????.data', ignore_pickup=True):
"""Scan a directory for all iteration number suffixes."""
iternums = set()
all_datafiles = glob(os.path.join(data_dir, file_format))
Expand All @@ -759,6 +759,9 @@ def _get_all_iternums(data_dir, file_prefixes=None,
for f in all_datafiles:
iternum = int(f[istart:iend])
prefix = os.path.split(f[:istart-1])[-1]
# Only process iternums which have something more than pickups
if ignore_pickup and _is_pickup_prefix(prefix):
continue
if file_prefixes is None:
iternums.add(iternum)
else:
Expand Down