Skip to content

Commit 7f04bef

Browse files
committed
remove omegaconf
1 parent 683538f commit 7f04bef

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

autointent/context/_utils.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,21 @@
99
from typing import Any
1010

1111
import numpy as np
12-
from omegaconf import ListConfig
1312

1413
from autointent import Dataset
1514

1615

1716
class NumpyEncoder(json.JSONEncoder):
1817
"""
19-
JSON encoder that handles numpy data types and OmegaConf ListConfig.
18+
JSON encoder that handles numpy data types.
2019
2120
This encoder extends the default `json.JSONEncoder` to serialize numpy
22-
arrays, numpy data types, and OmegaConf ListConfig objects.
21+
arrays, numpy data types.
2322
"""
2423

2524
def default(self, obj: Any) -> str | int | float | list[Any] | Any: # noqa: ANN401
2625
"""
27-
Serialize objects with special handling for numpy and OmegaConf types.
26+
Serialize objects with special handling for numpy.
2827
2928
:param obj: Object to serialize.
3029
:return: JSON-serializable representation of the object.
@@ -35,8 +34,6 @@ def default(self, obj: Any) -> str | int | float | list[Any] | Any: # noqa: ANN
3534
return float(obj)
3635
if isinstance(obj, np.ndarray):
3736
return obj.tolist()
38-
if isinstance(obj, ListConfig):
39-
return list(obj)
4037
return super().default(obj)
4138

4239

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ module = [
181181
"appdirs",
182182
"sre_yield",
183183
"skmultilearn.model_selection",
184-
"omegaconf",
185184
"hydra",
186185
"hydra.*",
187186
"transformers",

0 commit comments

Comments
 (0)