@@ -454,7 +454,7 @@ def analyse(work_dir, estimator="MBAR", method="alchemlyb", **kwargs):
454454 if data and engine == "AMBER" :
455455 if method != "ALCHEMLYB" :
456456 raise _AnalysisError (
457- f "AMBER can only use the 'alchemlyb' analysis method."
457+ "AMBER can only use the 'alchemlyb' analysis method."
458458 )
459459 if data and engine == "SOMD" and estimator == "TI" and method == "native" :
460460 raise _AnalysisError (
@@ -463,7 +463,7 @@ def analyse(work_dir, estimator="MBAR", method="alchemlyb", **kwargs):
463463 if data and engine == "SOMD2" :
464464 if method != "ALCHEMLYB" :
465465 raise _AnalysisError (
466- f "SOMD2 can only use the 'alchemlyb' analysis method."
466+ "SOMD2 can only use the 'alchemlyb' analysis method."
467467 )
468468 if data and engine == "GROMACS" and method == "native" :
469469 _warnings .warn (
@@ -694,15 +694,15 @@ def _get_data(files, temperatures, engine, estimator):
694694 if not isinstance (engine , str ):
695695 raise TypeError ("'engine' must be of type 'str'." )
696696 engine = engine .replace (" " , "" ).upper ()
697- if not engine in Relative ._engines_analysis :
697+ if engine not in Relative ._engines_analysis :
698698 raise ValueError (
699699 f"Unsupported engine '{ engine } '. Options are: { ', ' .join (Relative ._engines_analysis )} "
700700 )
701701
702702 if not isinstance (estimator , str ):
703703 raise TypeError ("'estimator' must be of type 'str'." )
704704 estimator = estimator .replace (" " , "" ).upper ()
705- if not estimator in ["MBAR" , "TI" ]:
705+ if estimator not in ["MBAR" , "TI" ]:
706706 raise ValueError ("'estimator' must be either 'MBAR' or 'TI'." )
707707
708708 if estimator == "MBAR" :
@@ -1154,7 +1154,7 @@ def _preprocess_data(data, estimator, **kwargs):
11541154
11551155 if not isinstance (estimator , str ):
11561156 raise TypeError ("'estimator' must be of type 'str'." )
1157- if not estimator .replace (" " , "" ).upper () in ["MBAR" , "TI" ]:
1157+ if estimator .replace (" " , "" ).upper () not in ["MBAR" , "TI" ]:
11581158 raise ValueError ("'estimator' must be either 'MBAR' or 'TI'." )
11591159
11601160 # Assign defaults in case not passed via kwargs.
@@ -1307,15 +1307,15 @@ def _analyse_internal(files, temperatures, lambdas, engine, estimator, **kwargs)
13071307
13081308 if not isinstance (engine , str ):
13091309 raise TypeError ("'engine' must be of type 'str'." )
1310- if not engine .replace (" " , "" ).upper () in Relative ._engines_analysis :
1310+ if engine .replace (" " , "" ).upper () not in Relative ._engines_analysis :
13111311 raise ValueError (
13121312 f"Unsupported engine '{ engine } '. Options are: { ', ' .join (Relative ._engines_analysis )} "
13131313 )
13141314
13151315 if not isinstance (estimator , str ):
13161316 raise TypeError ("'estimator' must be of type 'str'." )
13171317 estimator = estimator .replace (" " , "" ).upper ()
1318- if not estimator in ["MBAR" , "TI" ]:
1318+ if estimator not in ["MBAR" , "TI" ]:
13191319 raise ValueError ("'estimator' must be either 'MBAR' or 'TI'." )
13201320
13211321 if estimator == "MBAR" :
@@ -1544,7 +1544,7 @@ def _analyse_gromacs(work_dir=None, estimator="MBAR", method="alchemlyb", **kwar
15441544
15451545 if not isinstance (estimator , str ):
15461546 raise TypeError ("'estimator' must be of type 'str'." )
1547- if not estimator .replace (" " , "" ).upper () in ["MBAR" , "TI" ]:
1547+ if estimator .replace (" " , "" ).upper () not in ["MBAR" , "TI" ]:
15481548 raise ValueError ("'estimator' must be either 'MBAR' or 'TI'." )
15491549
15501550 if not isinstance (method , str ):
@@ -1735,7 +1735,7 @@ def _analyse_somd(work_dir=None, estimator="MBAR", method="alchemlyb", **kwargs)
17351735 if not isinstance (method , str ):
17361736 raise TypeError ("'method' must be of type 'str'." )
17371737 method = method .replace (" " , "" ).upper ()
1738- if not method in ["ALCHEMLYB" , "NATIVE" ]:
1738+ if method not in ["ALCHEMLYB" , "NATIVE" ]:
17391739 raise ValueError ("'method' must be either 'alchemlyb' or 'native'." )
17401740
17411741 if method == "ALCHEMLYB" :
0 commit comments