Skip to content

Commit 10187b3

Browse files
committed
Allow user to disable data preprocessing.
1 parent 93fc038 commit 10187b3

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

python/BioSimSpace/FreeEnergy/_relative.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,10 +1312,21 @@ def _analyse_internal(files, temperatures, lambdas, engine, estimator, **kwargs)
13121312

13131313
# Preprocess the data.
13141314
try:
1315-
processed_data = Relative._preprocess_data(data, estimator, **kwargs)
1316-
processed_data = _alchemlyb.concat(processed_data)
1317-
except:
1318-
_warnings.warn("Could not preprocess the data!")
1315+
preprocess = kwargs.pop("preprocess", True)
1316+
except KeyError:
1317+
preprocess = True
1318+
1319+
if not isinstance(preprocess, bool):
1320+
raise TypeError("'preprocess' must be of type 'bool'.")
1321+
1322+
if preprocess:
1323+
try:
1324+
processed_data = Relative._preprocess_data(data, estimator, **kwargs)
1325+
processed_data = _alchemlyb.concat(processed_data)
1326+
except:
1327+
_warnings.warn("Could not preprocess the data!")
1328+
processed_data = _alchemlyb.concat(data)
1329+
else:
13191330
processed_data = _alchemlyb.concat(data)
13201331

13211332
mbar_method = None

0 commit comments

Comments
 (0)