diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 60b948bfa..e15e66f98 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,13 +22,13 @@ repos: - id: black args: [--line-length=80] - repo: https://github.com/pycqa/isort - rev: 5.11.1 + rev: 5.11.4 hooks: - id: isort name: isort (python) args: [--profile=black, --line-length=80] - repo: https://github.com/pycqa/pydocstyle - rev: '6.1.1' + rev: '6.2.3' hooks: - id: pydocstyle exclude: ^(mbuild/tests/|docs/|devtools/|setup.py|setup.cfg|mbuild/formats/charmm_writer.py|mbuild/formats/gomc_conf_writer.py|mbuild/utils/specific_ff_to_residue.py) diff --git a/mbuild/compound.py b/mbuild/compound.py index 75c3c7405..bcdd0784f 100644 --- a/mbuild/compound.py +++ b/mbuild/compound.py @@ -2384,7 +2384,7 @@ def _energy_minimize_openbabel( # if a user passes single constraint as a 1-D array, # i.e., [(p1,p2), 2.0] rather than [[(p1,p2), 2.0]], # just add it to a list so we can use the same looping code - if len(np.array(distance_constraints).shape) == 1: + if len(np.array(distance_constraints, dtype=object).shape) == 1: distance_constraints = [distance_constraints] for con_temp in distance_constraints: @@ -2415,7 +2415,7 @@ def _energy_minimize_openbabel( # if fixed_compounds is a 1-d array and it is of length 2, we need to determine whether it is # a list of two Compounds or if fixed_compounds[1] should correspond to the directions to constrain - if len(np.array(fixed_compounds).shape) == 1: + if len(np.array(fixed_compounds, dtype=object).shape) == 1: if len(fixed_compounds) == 2: if not isinstance(fixed_compounds[1], Compound): # if it is not a list of two Compounds, make a 2d array so we can use the same looping code @@ -2493,7 +2493,7 @@ def _energy_minimize_openbabel( ob_constraints.AddAtomZConstraint(pid) if ignore_compounds is not None: - temp1 = np.array(ignore_compounds) + temp1 = np.array(ignore_compounds, dtype=object) if len(temp1.shape) == 2: ignore_compounds = list(temp1.reshape(-1)) diff --git a/mbuild/formats/hoomd_snapshot.py b/mbuild/formats/hoomd_snapshot.py index a9ff1100d..1b08df364 100644 --- a/mbuild/formats/hoomd_snapshot.py +++ b/mbuild/formats/hoomd_snapshot.py @@ -77,6 +77,7 @@ def from_snapshot(snapshot, scale=1.0): comp.add(atom, label=str(i)) # Add bonds + particle_dict = {idx: p for idx, p in enumerate(comp.particles())} for i in range(bond_array.shape[0]): atom1 = int(bond_array[i][0]) atom2 = int(bond_array[i][1])