Skip to content

Commit

Permalink
Merge pull request #1216 from mosdef-hub/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
chrisjonesBSU authored Jan 19, 2025
2 parents 8b56995 + dabdf8c commit 8012f9c
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ci:
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.4
rev: v0.9.1
hooks:
# Run the linter.
- id: ruff
Expand Down
6 changes: 3 additions & 3 deletions mbuild/compound.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ def _particle_mass(particle):
def mass(self, value):
if self._contains_only_ports() is False:
raise MBuildError(
"Cannot set the mass of a Compound containing " "children compounds"
"Cannot set the mass of a Compound containing children compounds"
)

value = float(value)
Expand Down Expand Up @@ -1081,7 +1081,7 @@ def add_bond(self, particle_pair, bond_order=None):
"unspecified",
]:
raise ValueError(
"Invalid bond_order given. Available bond orders are: " "single",
"Invalid bond_order given. Available bond orders are: single",
"double",
"triple",
"aromatic",
Expand Down Expand Up @@ -1239,7 +1239,7 @@ def remove_bond(self, particle_pair):
bond_vector = particle_pair[0].pos - particle_pair[1].pos
if np.allclose(bond_vector, np.zeros(3)):
warn(
"Particles {} and {} overlap! Ports will not be added." "".format(
"Particles {} and {} overlap! Ports will not be added.".format(
*particle_pair
)
)
Expand Down
4 changes: 1 addition & 3 deletions mbuild/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -1782,9 +1782,7 @@ def to_smiles(compound, backend="pybel"):
if backend == "pybel":
mol = to_pybel(compound)

warn(
"The bond orders will be guessed using pybel" "OBMol.PerceviedBondOrders()"
)
warn("The bond orders will be guessed using pybelOBMol.PerceviedBondOrders()")
mol.OBMol.PerceiveBondOrders()
smiles_string = mol.write("smi").replace("\t", " ").split(" ")[0]

Expand Down
26 changes: 13 additions & 13 deletions mbuild/formats/cassandramcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def write_mcf(structure, filename, angle_style, dihedral_style, lj14=None, coul1
# Only will write MCF for Cassandra-supported options
if angle_style.casefold() != "fixed" and angle_style.casefold() != "harmonic":
raise ValueError(
"Invalid selection for angle_style. Please choose 'fixed' or " "'harmonic'"
"Invalid selection for angle_style. Please choose 'fixed' or 'harmonic'"
)

if len(structure.urey_bradleys) > 0:
Expand All @@ -75,7 +75,7 @@ def write_mcf(structure, filename, angle_style, dihedral_style, lj14=None, coul1
if dihedral_style.casefold() != "none":
if len(structure.rb_torsions) > 0 and dihedral_style.casefold() != "opls":
raise ValueError(
"Dihedral style declared as {} but RB torsions " "found.".format(
"Dihedral style declared as {} but RB torsions found.".format(
dihedral_style
)
)
Expand Down Expand Up @@ -131,15 +131,17 @@ def write_mcf(structure, filename, angle_style, dihedral_style, lj14=None, coul1
else:
lj14 = 0.0
warnings.warn(
"Unable to infer LJ 1-4 scaling factor. Setting to "
"{:.1f}".format(lj14)
"Unable to infer LJ 1-4 scaling factor. Setting to {:.1f}".format(
lj14
)
)
else:
lj14 = 0.0
if len(structure.dihedrals) > 0 or len(structure.rb_torsions) > 0:
warnings.warn(
"Unable to infer LJ 1-4 scaling factor. Setting to "
"{:.1f}".format(lj14)
"Unable to infer LJ 1-4 scaling factor. Setting to {:.1f}".format(
lj14
)
)

if coul14 < 0.0 or coul14 > 1.0:
Expand Down Expand Up @@ -353,8 +355,7 @@ def _write_atom_information(mcf_file, structure, in_ring, IG_CONSTANT_KCAL):
mcf_file.write("{:d}\n".format(len(structure.atoms)))
for i in range(len(structure.atoms)):
mcf_file.write(
"{:<4d} {:<6s} {:<2s} {:7.3f} {:12.8f} "
"{:3s} {:8.5f} {:8.5f}".format(
"{:<4d} {:<6s} {:<2s} {:7.3f} {:12.8f} {:3s} {:8.5f} {:8.5f}".format(
i + 1,
types[i],
elements[i],
Expand Down Expand Up @@ -422,7 +423,7 @@ def _write_angle_information(mcf_file, structure, angle_style, IG_CONSTANT_KCAL)
]
else:
raise ValueError(
"Only 'fixed' and 'harmonic' angle styles are supported by " "Cassandra"
"Only 'fixed' and 'harmonic' angle styles are supported by Cassandra"
)

header = (
Expand Down Expand Up @@ -529,7 +530,7 @@ def _write_dihedral_information(mcf_file, structure, dihedral_style, KCAL_TO_KJ)
dihedral_parms = ["" for dihedral in dihedrals]
else:
raise ValueError(
"Only 'OPLS', 'CHARMM', and 'none' dihedral styles are " "supported."
"Only 'OPLS', 'CHARMM', and 'none' dihedral styles are supported."
)

mcf_file.write("{:d}\n".format(len(dihedrals)))
Expand All @@ -539,7 +540,7 @@ def _write_dihedral_information(mcf_file, structure, dihedral_style, KCAL_TO_KJ)
# The atom order provided in the parmed.Structure
# is written to the MCF file.
mcf_file.write(
"{:<4d} {:<4d} {:<4d} {:<4d} {:<4d}" " {:s} {:s}\n".format(
"{:<4d} {:<4d} {:<4d} {:<4d} {:<4d} {:s} {:s}\n".format(
i + 1,
dihedral.atom1.idx + 1,
dihedral.atom2.idx + 1,
Expand Down Expand Up @@ -578,8 +579,7 @@ def _write_improper_information(mcf_file, structure, KCAL_TO_KJ):
improper_type = "harmonic"
for i, improper in enumerate(structure.impropers):
mcf_file.write(
"{:<4d} {:<4d} {:<4d} {:<4d} {:<4d}"
" {:s} {:8.3f} {:8.3f}\n".format(
"{:<4d} {:<4d} {:<4d} {:<4d} {:<4d} {:s} {:8.3f} {:8.3f}\n".format(
i + 1,
improper.atom1.idx + 1,
improper.atom2.idx + 1,
Expand Down
3 changes: 1 addition & 2 deletions mbuild/lib/recipes/polymer.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ def __init__(self, monomers=None, end_groups=None):
)
elif len(self._end_groups) != 2:
raise ValueError(
"Please provide two end groups; "
f"you provided {len(self._end_groups)}"
f"Please provide two end groups; you provided {len(self._end_groups)}"
)
self._port_labels = ["up", "down"]
self._headtail = [None, None]
Expand Down
4 changes: 2 additions & 2 deletions mbuild/packing.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def fill_box(
)
if len(compound) != len(compound_ratio):
raise ValueError(
"Length of `compound_ratio` must equal length of " "`compound`"
"Length of `compound_ratio` must equal length of `compound`"
)
prototype_mass = 0
for c, r in zip(compound, compound_ratio):
Expand Down Expand Up @@ -747,7 +747,7 @@ def fill_sphere(
)
if len(compound) != len(compound_ratio):
raise ValueError(
"Length of `compound_ratio` must equal length of " "`compound`"
"Length of `compound_ratio` must equal length of `compound`"
)
prototype_mass = 0
for c, r in zip(compound, compound_ratio):
Expand Down
3 changes: 1 addition & 2 deletions mbuild/utils/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ def deleter(self, fdel):
def show_warning_msg(self):
if self.warning_msg is not None:
warn(
f"Property {fcn.__name__} is deprecated. "
f"{self.warning_msg}",
f"Property {fcn.__name__} is deprecated. {self.warning_msg}",
DeprecationWarning,
)
if not self.always_show:
Expand Down
3 changes: 2 additions & 1 deletion mbuild/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ def import_(module):
message = MESSAGES[module]
except KeyError:
message = (
"The code at {filename}:{line_number} requires the " f"{module} package"
"The code at {filename}:{line_number} requires the "
f"{module} package"
)
raise ImportError(f"No module named {module}")

Expand Down

0 comments on commit 8012f9c

Please sign in to comment.