diff --git a/pyproject.toml b/pyproject.toml index 2ecc5279..b098173f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ authors = [{name="Statnett Datascience", email="Datascience.Drift@Statnett.no"}] requires-python = ">=3.11" dependencies = [ "httpx>=0.27.2", - "numpy>=2.1.1", + "numpy>=1.9.0", "pandas>=2.2.3", "pandera>=0.20.4", "polyfactory>=2.17.0", diff --git a/src/cimsparql/data_models.py b/src/cimsparql/data_models.py index 0ac915bd..65029e9f 100644 --- a/src/cimsparql/data_models.py +++ b/src/cimsparql/data_models.py @@ -1,7 +1,6 @@ import datetime as dt from typing import Self -import pandas as pd import pandera as pa from pandera.typing import DataFrame, Index, Series @@ -189,10 +188,10 @@ class TransfConToConverterSchema(NamedResourceSchema): class CoordinatesSchema(JsonSchemaOut): mrid: Series[str] = pa.Field() - x: Series[str] = pa.Field() - y: Series[str] = pa.Field() - epsg: Series[pd.CategoricalDtype] = pa.Field() - rdf_type: Series[pd.CategoricalDtype] = pa.Field() + x: Series[float] = pa.Field() + y: Series[float] = pa.Field() + epsg: Series[str] = pa.Field() + rdf_type: Series[str] = pa.Field() CoordinatesDataFrame = DataFrame[CoordinatesSchema] diff --git a/tests/test_micro_t1_nl.py b/tests/test_micro_t1_nl.py index 6cbbfb99..c3c69654 100644 --- a/tests/test_micro_t1_nl.py +++ b/tests/test_micro_t1_nl.py @@ -3,7 +3,6 @@ from string import Template from typing import Any -import pandas as pd import pytest import tests.t_utils.common as t_common @@ -268,11 +267,11 @@ def test_coordinates(test_model: t_common.ModelTest): assert test_model.model model = test_model.model crd = model.coordinates() - pd.testing.assert_index_equal(crd["epsg"].cat.categories, pd.Index(["4326"], dtype=str)) + assert set(crd["epsg"]), {"4326"} cim = model.client.prefixes["cim"] categories = {f"{cim}ACLineSegment", f"{cim}Substation"} - assert crd["rdf_type"].cat.categories.difference(categories).empty + assert set(crd["rdf_type"]).difference(categories) == set() assert len(crd) == 49 coordinates = crd.astype({"x": float, "y": float})