Skip to content

Commit

Permalink
bugfixed presets prediction time
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelduranfrigola committed Nov 19, 2022
1 parent dc29c22 commit 33ab8ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 4 additions & 5 deletions zairachem/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,10 @@ def is_train(self):
def is_lazy(self):
output_dir = self.get_output_dir()
model_dir = self.get_trained_dir()
with open(os.path.join(output_dir, DATA_SUBFOLDER, PRESETS_FILENAME), "r") as f:
data = json.load(f)
if data["is_lazy"]:
return True
with open(os.path.join(model_dir, DATA_SUBFOLDER, PRESETS_FILENAME), "r") as f:
file_name = os.path.join(output_dir, DATA_SUBFOLDER, PRESETS_FILENAME)
if not os.path.exists(file_name):
file_name = os.path.join(model_dir, DATA_SUBFOLDER, PRESETS_FILENAME)
with open(file_name, "r") as f:
data = json.load(f)
if data["is_lazy"]:
return True
Expand Down
4 changes: 3 additions & 1 deletion zairachem/estimators/from_molmap/estimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def __init__(self, path):
self.get_output_dir(), ESTIMATORS_SUBFOLDER, ESTIMATORS_FAMILY_SUBFOLDER
)
if _USE_AUGMENTED:
if os.path.exists(self.path, DATA_SUBFOLDER, DATA_AUGMENTED_FILENAME):
if os.path.exists(
os.path.join(self.path, DATA_SUBFOLDER, DATA_AUGMENTED_FILENAME)
):
self._data_filename = DATA_AUGMENTED_FILENAME
else:
self._data_filename = DATA_FILENAME
Expand Down

0 comments on commit 33ab8ea

Please sign in to comment.