Skip to content

Commit

Permalink
Fix mypy errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
orionarcher committed Apr 11, 2024
1 parent 5e7ecf5 commit b30b9e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions emmet-core/emmet/core/classical_md/openmm/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from emmet.core.vasp.task_valid import TaskState # type: ignore[import-untyped]
from pydantic import BaseModel, Field

from emmet.core.classical_md import ClassicalMDTaskDocument
from emmet.core.classical_md.tasks import HexBytes
from emmet.core.classical_md import ClassicalMDTaskDocument # type: ignore[import-untyped]
from emmet.core.classical_md.tasks import HexBytes # type: ignore[import-untyped]


class CalculationInput(BaseModel, extra="allow"): # type: ignore[call-arg]
Expand Down
4 changes: 3 additions & 1 deletion emmet-core/emmet/core/classical_md/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
PlainValidator,
PlainSerializer,
WithJsonSchema,
errors,
)
from monty.json import MSONable

from emmet.core.vasp.task_valid import TaskState
from emmet.core.vasp.task_valid import TaskState # type: ignore[import-untyped]


def hex_bytes_validator(o: Any) -> bytes:
Expand All @@ -28,6 +29,7 @@ def hex_bytes_validator(o: Any) -> bytes:
return bytes(o)
elif isinstance(o, str):
return zlib.decompress(bytes.fromhex(o))
raise errors.BytesError()


def hex_bytes_serializer(b: bytes) -> str:
Expand Down

0 comments on commit b30b9e7

Please sign in to comment.