Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

u #9

Merged
merged 2 commits into from
Jan 19, 2023
Merged

u #9

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions mbuild/compound.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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))

Expand Down
1 change: 1 addition & 0 deletions mbuild/formats/hoomd_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down