Skip to content

Commit

Permalink
fixes #72
Browse files Browse the repository at this point in the history
  • Loading branch information
josejimenezluna committed Oct 22, 2021
1 parent aa45c36 commit 895de93
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion delfta/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(
progress=True,
return_optmols=False,
models=None,
ignore_checks=False
) -> None:
"""Main calculator class for predicting DFT observables.
Expand Down Expand Up @@ -72,6 +73,9 @@ def __init__(
passed models. See delfta.utils.MODELS for naming convention. Need to agree with choice of
'delta'.
Normalization values are not modified.
ignore_checks: bool, optional
Whether to ignore sanity checks (e.g. 3d or hydrogen presence) when
processing molecules. Use at your own risk.
"""
if (
tasks is not None and models is not None
Expand All @@ -94,6 +98,7 @@ def __init__(
self.verbose = verbose
self.progress = progress
self.return_optmols = return_optmols
self.ignore_checks = ignore_checks
self.batch_mode = False
self.offset_idx = 0

Expand Down Expand Up @@ -499,7 +504,10 @@ def predict(self, input_, batch_size=32):
return self.predict([input_])

elif isinstance(input_, list):
mols, fatal = self._preprocess(input_)
if self.ignore_checks:
mols, fatal = input_, []
else:
mols, fatal = self._preprocess(input_)

elif isinstance(input_, types.GeneratorType):
if self.return_optmols:
Expand Down

0 comments on commit 895de93

Please sign in to comment.