Skip to content

Commit

Permalink
drop guard for from ruamel.yaml import YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Oct 20, 2024
1 parent 0c9d844 commit 78f16e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
8 changes: 2 additions & 6 deletions src/monty/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
from typing import Any
from uuid import UUID, uuid4

from ruamel.yaml import YAML

try:
import numpy as np
except ImportError:
Expand All @@ -41,17 +43,11 @@
except ImportError:
bson = None

try:
from ruamel.yaml import YAML
except ImportError:
YAML = None

try:
import orjson
except ImportError:
orjson = None


try:
import torch
except ImportError:
Expand Down
5 changes: 1 addition & 4 deletions src/monty/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
import os
from typing import TYPE_CHECKING

try:
from ruamel.yaml import YAML
except ImportError:
YAML = None # type: ignore[arg-type]
from ruamel.yaml import YAML

from monty.io import zopen
from monty.json import MontyDecoder, MontyEncoder
Expand Down

0 comments on commit 78f16e5

Please sign in to comment.