Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ 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",
]

[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 = [
Expand All @@ -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",
]
Expand Down
19 changes: 19 additions & 0 deletions tests/test_pandas3_compatibility.py
Original file line number Diff line number Diff line change
@@ -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]