Skip to content

Commit

Permalink
try utils.DATA_PATH in verify_params
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrammer committed Oct 25, 2024
1 parent c2ce7db commit 292302a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions eazy/param.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import collections
import numpy as np

from . import utils

__all__ = ["EazyParam", "TranslateFile", "read_param_file"]

def read_param_file(param_file=None, verbose=True):
Expand Down Expand Up @@ -157,8 +159,14 @@ def verify_params(self):
for k in ['TEMPLATES_FILE', 'TEMP_ERR_FILE', 'CATALOG_FILE',
'FILTERS_RES']:
if isinstance(self[k], str):
if not os.path.exists(self[k]):
raise FileNotFoundError(f'{k} ({self[k]}) not found')
file_path = self[k]
if not os.path.exists(file_path):
file_path = os.path.join(utils.DATA_PATH, file_path)

if not os.path.exists(file_path):
raise FileNotFoundError(
f'{k} ({self[k]}) not found in ./ or {utils.DATA_PATH}'
)

assert(int(self['ARRAY_NBITS']) in [32,64])

Expand Down

0 comments on commit 292302a

Please sign in to comment.