Skip to content

Commit

Permalink
doc: improve the warning messages and fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
CompRhys committed Sep 25, 2024
1 parent 15134fc commit 6719849
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mace/calculators/mace.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
###########################################################################################


import logging
from glob import glob
from pathlib import Path
from typing import Union
Expand Down Expand Up @@ -64,12 +65,15 @@ def __init__(
Calculator.__init__(self, **kwargs)

if "model_path" in kwargs:
deprecation_message = (
"'model_path' argument is deprecated, please use 'model_paths'"
)
if model_paths is None:
print("model_path argument deprecated, use model_paths")
logging.warning(f"{deprecation_message} in the future.")
model_paths = kwargs["model_path"]
else:
raise ValueError(
"both 'model_path' and 'model_paths' argument give, please only pass model_paths"
f"both 'model_path' and 'model_paths' given, {deprecation_message} only."
)

if (model_paths is None) == (models is None):
Expand Down

0 comments on commit 6719849

Please sign in to comment.