Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
GardevoirX committed Nov 18, 2024
1 parent ac9763a commit 67c060b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions python/chemiscope/structures/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
ase_tensors_to_ellipsoids,
ase_vectors_to_arrows,
)
from ._mda import (
from ._mda import ( # noqa: F401
_mda_to_json,
_mda_valid_structures,
_mda_list_atom_properties,
Expand Down Expand Up @@ -47,7 +47,7 @@ def _guess_adapter(frames):
stk_frames, use_stk = _stk_valid_structures(frames)
if use_stk:
return stk_frames, "stk"

mda_frames, use_mda = _mda_valid_structures(frames)
if use_mda:
return mda_frames, "mda"
Expand Down Expand Up @@ -133,10 +133,11 @@ def extract_properties(frames, only=None, environments=None):
raise RuntimeError(
"stk molecules do not contain properties, you must manually provide them"
)

elif adapter == "mda":
raise RuntimeError(
"MDAnalysis molecules do not contain properties, you must manually provide them"
"MDAnalysis molecules do not contain properties, you"
"must manually provide them"
)

else:
Expand Down
3 changes: 2 additions & 1 deletion python/chemiscope/structures/_mda.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def _mda_to_json(ag):
if ag.dimensions is not None:
data["cell"] = list(
np.concatenate(
mda.lib.mdamath.triclinic_vectors(ag.dimensions), dtype=np.float64
mda.lib.mdamath.triclinic_vectors(ag.dimensions),
dtype=np.float64,
# should be np.float64 otherwise not serializable
)
)
Expand Down
1 change: 0 additions & 1 deletion python/tests/mda_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
BASE_FRAME.atoms.positions = np.array([[0, 0, 0], [1, 1, 1], [2, 2, 5]])



class TestStructures(unittest.TestCase):
"""Conversion of structure data to chemiscope JSON"""

Expand Down

0 comments on commit 67c060b

Please sign in to comment.