Skip to content

Commit

Permalink
Backwards compatability for args starting with data/
Browse files Browse the repository at this point in the history
  • Loading branch information
KSGulin committed Mar 2, 2023
1 parent ba97120 commit 88aea22
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ def check_file(file, suffix=''):
yaml_name = os.path.join(*file.split(os.sep)[1:])
files.extend(glob.glob(str(ROOT / "models_v5.0" / '**' / yaml_name), recursive=True))

if file.startswith("data"):
file = os.path.join(*file.split(os.sep)[1:])

for d in 'data', 'models', 'utils': # search directories
files.extend(glob.glob(str(ROOT / d / '**' / file), recursive=True)) # find file
assert len(files), f'File not found: {file}' # assert file was found
Expand Down

0 comments on commit 88aea22

Please sign in to comment.