diff --git a/changelog_entry.yaml b/changelog_entry.yaml index 8716d2e7..58659269 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1,7 +1,4 @@ - bump: patch changes: - added: - - Poverty output type for single-simulation analysis - - Inequality output type with Gini coefficient - fixed: - - Labels now correctly apply to breakdown parameters + changed: + - Bumped policyengine-core minimum version to 3.23.5 for pandas 3.0 compatibility diff --git a/pyproject.toml b/pyproject.toml index c50583e8..d96edda2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ requires-python = ">=3.13" dependencies = [ "pydantic>=2.0.0", "pandas>=2.0.0", - "microdf_python", + "microdf_python>=1.2.1", "plotly>=5.0.0", "requests>=2.31.0", "psutil>=5.9.0", @@ -23,11 +23,11 @@ dependencies = [ [project.optional-dependencies] uk = [ - "policyengine_core>=3.10", + "policyengine_core>=3.23.6", "policyengine-uk>=2.51.0", ] us = [ - "policyengine_core>=3.10", + "policyengine_core>=3.23.6", "policyengine-us>=1.213.1", ] dev = [ @@ -41,7 +41,7 @@ dev = [ "build", "pytest-asyncio>=0.26.0", "ruff>=0.5.0", - "policyengine_core>=3.10", + "policyengine_core>=3.23.6", "policyengine-uk>=2.51.0", "policyengine-us>=1.213.1", ] diff --git a/tests/test_pandas3_compatibility.py b/tests/test_pandas3_compatibility.py new file mode 100644 index 00000000..93fecd4d --- /dev/null +++ b/tests/test_pandas3_compatibility.py @@ -0,0 +1,19 @@ +"""Test pandas 3.0 compatibility with enum encoding.""" +import pandas as pd +from policyengine_core.enums import Enum + + +class SampleEnum(Enum): + VALUE_A = "value_a" + VALUE_B = "value_b" + + +def test_enum_encode_with_pandas_series(): + """Test that Enum.encode works with pandas Series.""" + enum_items = [SampleEnum.VALUE_A, SampleEnum.VALUE_B, SampleEnum.VALUE_A] + series = pd.Series(enum_items) + + encoded = SampleEnum.encode(series) + + assert len(encoded) == 3 + assert list(encoded) == [0, 1, 0]