Skip to content

Commit 2d1c9fc

Browse files
committed
fixing minor release-related hiccups
1 parent 49d7bbc commit 2d1c9fc

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

megadetector/detection/run_detector.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@
9797
'v4.1':'v4.1.0',
9898
'v5a.0.0':'v5a.0.1',
9999
'v5b.0.0':'v5b.0.1',
100+
'v5a.0.1':'v5a.0.1',
101+
'v5b.0.1':'v5b.0.1',
100102

101103
'md1000-redwood':'v1000.0.0-redwood',
102104
'md1000-cedar':'v1000.0.0-cedar',
@@ -405,12 +407,17 @@ def get_detector_version_from_model_file(detector_filename,verbose=False):
405407
(version_string_based_on_model_file is not None):
406408

407409
if version_string_based_on_filename != version_string_based_on_model_file:
408-
print(
409-
'Warning: model version string in file:' + \
410-
'\n\n{}\n\n...is:\n\n{}\n\n...but the filename implies:\n\n{}'.format(
411-
os.path.basename(detector_filename),
412-
version_string_based_on_model_file,
413-
version_string_based_on_filename))
410+
# This is a one-off special case where models were re-released with different filenames
411+
if (version_string_based_on_filename in ('v5a.0.1','v5b.0.1')) and \
412+
(version_string_based_on_model_file in ('v5a.0.0','v5b.0.0')):
413+
pass
414+
else:
415+
print(
416+
'Warning: model version string in file:' + \
417+
'\n\n{}\n\n...is:\n\n{}\n\n...but the filename implies:\n\n{}'.format(
418+
os.path.basename(detector_filename),
419+
version_string_based_on_model_file,
420+
version_string_based_on_filename))
414421

415422
return version_string_based_on_model_file
416423

notebooks/manage_local_batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@
408408
os.makedirs(chunk_file_base,exist_ok=True)
409409

410410
chunk_files = os.listdir(chunk_file_base)
411-
pattern = re.compile('chunk\d+.json')
411+
pattern = re.compile(r'chunk\d+.json')
412412
chunk_files = [fn for fn in chunk_files if pattern.match(fn)]
413413

414414
if (not force_enumeration) and (len(chunk_files) > 0):

0 commit comments

Comments
 (0)