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
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: "3.14"
- uses: psf/black@stable
with:
options: ". -l 79 --check"
6 changes: 3 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: "3.14"
- uses: psf/black@stable
with:
options: ". -l 79 --check"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name="tmd",
version="2.1.4",
packages=find_packages(),
python_requires=">=3.11,<3.14",
python_requires=">=3.12,<3.15",
install_requires=[
"taxcalc>=6.8.0",
"numpy",
Expand Down
12 changes: 8 additions & 4 deletions tests/test_prepare_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class TestSOIShares:
"""Test that SOI shares are computed correctly."""

@pytest.fixture(scope="class")
def shares_data(self):
@classmethod
def shares_data(cls):
"""Load SOI data and compute shares for 2022."""
soilong = create_soilong(SOI_RAW_DIR, years=[2022])
pop_df = get_state_population(2022)
Expand Down Expand Up @@ -134,7 +135,8 @@ class TestTargetFileWriter:
"""Test recipe expansion produces correct target files."""

@pytest.fixture(scope="class")
def mn_targets(self, tmp_path_factory):
@classmethod
def mn_targets(cls, tmp_path_factory):
"""Run the full pipeline for MN."""
enhanced = prepare_area_targets(
area_type=AreaType.STATE,
Expand Down Expand Up @@ -252,7 +254,8 @@ class TestCDShares:
"""Validate the pre-computed CD shares file."""

@pytest.fixture(scope="class")
def cd_shares(self, congress):
@classmethod
def cd_shares(cls, congress):
"""Load the pre-computed CD shares CSV for the given Congress."""
path = _PREPARE / "data" / f"cds_{congress}_shares.csv"
if not path.exists():
Expand Down Expand Up @@ -302,7 +305,8 @@ class TestCDTargetFiles:
"""Validate CD target file structure (no solving)."""

@pytest.fixture(scope="class")
def cd_target_dir(self, congress):
@classmethod
def cd_target_dir(cls, congress):
"""Path to CD target files for the given Congress."""
path = REPO_ROOT / "tmd" / "areas" / "targets" / f"cds_{congress}"
if not path.exists() or not list(path.glob("*_targets.csv")):
Expand Down
11 changes: 6 additions & 5 deletions tests/test_state_weight_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,19 @@ def test_solver_status_solved(self, state):
), f"{state}: solver did not report Solved"


@pytest.fixture(scope="module")
def vdf():
"""Load TMD data once for all accuracy tests."""
return _load_taxcalc_data()


@pytest.mark.skipif(
not _HAS_CACHED,
reason="Cached TMD data files not available",
)
class TestStateTargetAccuracy:
"""Verify weighted sums hit targets within tolerance."""

@pytest.fixture(scope="class")
def vdf(self):
"""Load TMD data once for all accuracy tests."""
return _load_taxcalc_data()

@pytest.mark.parametrize(
"state",
["al", "ca", "mn", "ny", "tx"],
Expand Down
Loading
Loading