Skip to content

Commit 99cef0d

Browse files
committed
Autoformat. [ci skip]
1 parent fbf972a commit 99cef0d

33 files changed

Lines changed: 68 additions & 85 deletions

File tree

src/BioSimSpace/Align/_align.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,14 +1447,14 @@ def _roiMatch(
14471447
after_roi_atom_idx_molecule1 = []
14481448
else:
14491449
after_roi_molecule0 = molecule0.search(
1450-
f"residue[{res_idx+1}:{roi[i+1]}]"
1450+
f"residue[{res_idx + 1}:{roi[i + 1]}]"
14511451
)
14521452
after_roi_atom_idx_molecule0 = [
14531453
a.index() for a in after_roi_molecule0.atoms()
14541454
]
14551455

14561456
after_roi_molecule1 = molecule1.search(
1457-
f"residue[{res_idx+1}:{roi[i+1]}]"
1457+
f"residue[{res_idx + 1}:{roi[i + 1]}]"
14581458
)
14591459
after_roi_atom_idx_molecule1 = [
14601460
b.index() for b in after_roi_molecule1.atoms()
@@ -1476,12 +1476,12 @@ def _roiMatch(
14761476
}
14771477
else:
14781478
# Get all of the remaining atoms after the last ROI
1479-
after_roi_molecule0 = molecule0.search(f"residue[{res_idx+1}:]")
1479+
after_roi_molecule0 = molecule0.search(f"residue[{res_idx + 1}:]")
14801480
after_roi_atom_idx_molecule0 = [
14811481
a.index() for a in after_roi_molecule0.atoms()
14821482
]
14831483

1484-
after_roi_molecule1 = molecule1.search(f"residue[{res_idx+1}:]")
1484+
after_roi_molecule1 = molecule1.search(f"residue[{res_idx + 1}:]")
14851485
after_roi_atom_idx_molecule1 = [
14861486
b.index() for b in after_roi_molecule1.atoms()
14871487
]

src/BioSimSpace/Gateway/_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def __call__(self, parser, namespace, values, option_string=None):
119119
output_type = type(value)
120120
if output_type not in [_File, _FileSet]:
121121
raise TypeError(
122-
"We currently only support File and " "FileSet outputs with CWL."
122+
"We currently only support File and FileSet outputs with CWL."
123123
)
124124

125125
# Store the absolute path of the Python interpreter used to run the node.

src/BioSimSpace/Metadynamics/CollectiveVariable/_distance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def _validate(self):
652652
if self._weights0 is not None:
653653
if not isinstance(self._atom0, list):
654654
raise ValueError(
655-
"'weights0' only valid when 'atom0' is a " "list of atom indices."
655+
"'weights0' only valid when 'atom0' is a list of atom indices."
656656
)
657657
elif len(self._weights0) != len(self._atom0):
658658
raise ValueError(
@@ -664,7 +664,7 @@ def _validate(self):
664664
if self._weights1 is not None:
665665
if not isinstance(self._atom1, list):
666666
raise ValueError(
667-
"'weights1' only valid when 'atom1' is a " "list of atom indices."
667+
"'weights1' only valid when 'atom1' is a list of atom indices."
668668
)
669669
elif len(self._weights1) != len(self._atom1):
670670
raise ValueError(

src/BioSimSpace/Process/_amber.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,7 @@ def _setup(self, **kwargs):
265265
# Check that the system contains a perturbable molecule.
266266
if self._system.nPerturbableMolecules() == 0:
267267
raise ValueError(
268-
"'BioSimSpace.Protocol.FreeEnergy' requires a "
269-
"perturbable molecule!"
268+
"'BioSimSpace.Protocol.FreeEnergy' requires a perturbable molecule!"
270269
)
271270

272271
# Make sure the protocol is valid.

src/BioSimSpace/Process/_atm_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ def createLoopWithReporting(
610610
output = ""
611611
output += "# Reporting for MBAR:\n"
612612
# round master lambda to 4 d.p. to avoid floating point errors
613-
output += f"master_lambda_list = {[round(i,4) for i in self.protocol._get_lambda_values()]}\n"
613+
output += f"master_lambda_list = {[round(i, 4) for i in self.protocol._get_lambda_values()]}\n"
614614
output += "master_lambda = master_lambda_list[window_index]\n"
615615

616616
output += "if is_restart:\n"
@@ -810,7 +810,7 @@ def createReportingBoth(
810810

811811
output += "# Reporting for MBAR:\n"
812812
# round master lambda to 4 d.p. to avoid floating point errors
813-
output += f"master_lambda_list = {[round(i,4) for i in self.protocol._get_lambda_values()]}\n"
813+
output += f"master_lambda_list = {[round(i, 4) for i in self.protocol._get_lambda_values()]}\n"
814814
output += "master_lambda = master_lambda_list[window_index]\n"
815815
output += "if is_restart:\n"
816816
output += " try:\n"
@@ -945,7 +945,7 @@ def createSinglePointTest(
945945
"""Create a single point test for the ATM force"""
946946
output = ""
947947
output += "# Create the dictionary which will hold the energies\n"
948-
output += f"master_lambda_list = {[round(i,4) for i in self.protocol._get_lambda_values()]}\n"
948+
output += f"master_lambda_list = {[round(i, 4) for i in self.protocol._get_lambda_values()]}\n"
949949
output += "energies = {}\n"
950950
output += f"for i in master_lambda_list[:{inflex_point}]:\n"
951951
output += " energies[i] = []\n"

src/BioSimSpace/Process/_gromacs.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,7 @@ def _setup(self, **kwargs):
232232
# Check that the system contains a perturbable molecule.
233233
if self._system.nPerturbableMolecules() == 0:
234234
raise ValueError(
235-
"'BioSimSpace.Protocol.FreeEnergy' requires a "
236-
"perturbable molecule!"
235+
"'BioSimSpace.Protocol.FreeEnergy' requires a perturbable molecule!"
237236
)
238237

239238
# Check that the perturbation type is supported..
@@ -2201,7 +2200,7 @@ def _add_position_restraints(self):
22012200
# Write restraints for each atom.
22022201
for atom_idx in restrained_atoms:
22032202
file.write(
2204-
f"{atom_idx+1:4} 1 {force_constant} {force_constant} {force_constant} {force_constant} {force_constant} {force_constant}\n"
2203+
f"{atom_idx + 1:4} 1 {force_constant} {force_constant} {force_constant} {force_constant} {force_constant} {force_constant}\n"
22052204
)
22062205

22072206
else:
@@ -2214,7 +2213,7 @@ def _add_position_restraints(self):
22142213
# Write restraints for each atom.
22152214
for atom_idx in restrained_atoms:
22162215
file.write(
2217-
f"{atom_idx+1:4} 1 {force_constant} {force_constant} {force_constant}\n"
2216+
f"{atom_idx + 1:4} 1 {force_constant} {force_constant} {force_constant}\n"
22182217
)
22192218

22202219
# Work out the offset.
@@ -2300,7 +2299,7 @@ def _add_position_restraints(self):
23002299
# Write restraints for each atom.
23012300
for atom_idx in atom_idxs:
23022301
file.write(
2303-
f"{atom_idx+1:4} 1 {force_constant} {force_constant} {force_constant}\n"
2302+
f"{atom_idx + 1:4} 1 {force_constant} {force_constant} {force_constant}\n"
23042303
)
23052304

23062305
# Work out the offset.
@@ -2671,8 +2670,7 @@ def _getFinalFrame(self):
26712670
# Locate the coordinate file.
26722671
if not _os.path.isfile(self._crd_file):
26732672
_warnings.warn(
2674-
"Invalid coordinate file! "
2675-
"%s gro file not found." % (self._crd_file)
2673+
"Invalid coordinate file! %s gro file not found." % (self._crd_file)
26762674
)
26772675
return None
26782676

src/BioSimSpace/Process/_openmm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ def _generate_config(self):
894894
lower_wall = colvar.getLowerBound().getValue().nanometers().value()
895895
upper_wall = colvar.getUpperBound().getValue().nanometers().value()
896896
self.addToConfig(
897-
f"proj = BiasVariable(projection, {lower_wall-0.2}, {upper_wall+0.2}, {sigma_proj}, False, gridWidth=200)"
897+
f"proj = BiasVariable(projection, {lower_wall - 0.2}, {upper_wall + 0.2}, {sigma_proj}, False, gridWidth=200)"
898898
)
899899

900900
sigma_ext = colvar.getHillWidth()[1].nanometers().value()

src/BioSimSpace/Process/_plumed.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,8 +1513,7 @@ def getFreeEnergy(self, index=None, stride=None, kt=_Types.Energy(1.0, "kt")):
15131513

15141514
if proc.returncode != 0:
15151515
raise RuntimeError(
1516-
"Failed to generate free energy estimate.\n"
1517-
"Error: %s" % proc.stderr
1516+
"Failed to generate free energy estimate.\nError: %s" % proc.stderr
15181517
)
15191518

15201519
# Get a sorted list of all the fes*.dat files.

src/BioSimSpace/Process/_process_runner.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def removeProcess(self, index):
269269

270270
if index < -num_processes or index > num_processes - 1:
271271
raise IndexError(
272-
f"'index' is out of range: [-{num_processes}:{num_processes-1}]"
272+
f"'index' is out of range: [-{num_processes}:{num_processes - 1}]"
273273
)
274274

275275
# Map negative indices back into positive range.
@@ -503,7 +503,7 @@ def start(self, index):
503503

504504
if index < -num_processes or index > num_processes - 1:
505505
raise IndexError(
506-
f"'index' is out of range: [-{num_processes}:{num_processes-1}]"
506+
f"'index' is out of range: [-{num_processes}:{num_processes - 1}]"
507507
)
508508

509509
# Map negative indices back into positive range.
@@ -766,7 +766,7 @@ def kill(self, index):
766766

767767
if index < -num_processes or index > num_processes - 1:
768768
raise IndexError(
769-
f"'index' is out of range: [-{num_processes}:{num_processes-1}]"
769+
f"'index' is out of range: [-{num_processes}:{num_processes - 1}]"
770770
)
771771

772772
# Map negative indices back into positive range.

src/BioSimSpace/Process/_somd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1711,7 +1711,7 @@ def sort_bonds(bonds, idx):
17111711
# Cannot have a bond with a dummy in both states.
17121712
if initial_dummy and final_dummy:
17131713
raise _IncompatibleError(
1714-
"Dummy atoms are present in both the initial " "and final bond?"
1714+
"Dummy atoms are present in both the initial and final bond?"
17151715
)
17161716

17171717
# Set the bond parameters of the dummy state to those of the non-dummy end state.

0 commit comments

Comments
 (0)