Repository navigation
Export CountryTaxBenefitSystem so the Core CLI can load the NZ model - #36
Merged
Merged
Conversation
policyengine-core's CLI loads a country through `package.CountryTaxBenefitSystem`, which policyengine_nz defined in system.py but never exported. Export it, list it in __all__, and test that Core's build_tax_benefit_system loads the NZ system. Fixes #15 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Round 1 independent review of
All 11 CI checks passed on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude Code built this pull request for Max Ghenis, and Antigravity harvested the review.
Fixes #15.
What changes
policyengine_nz/system.pydefinesCountryTaxBenefitSystemas an alias ofNewZealandTaxBenefitSystem, but the package never exported it. policyengine-core's CLI looks for that attribute on the package:build_tax_benefit_systemraisesImportErrorwithout it, anddetect_country_packageskips the package (policyengine_core/scripts/__init__.py:53–61and line 81, in Core 3.20.0 and 3.38.0). This PR imports the alias inpolicyengine_nz/__init__.py, lists it in__all__, and addspolicyengine_nz/tests/test_package_exports.py, which checks the attribute, the__all__entry and thatbuild_tax_benefit_system("policyengine_nz", None, None)returns aNewZealandTaxBenefitSystem. No parameter or variable changes, so no computed value moves.Tests
__init__.py.test policyengine_nz/tests/policy -c policyengine_nz; it raisedImportErrorwith no items collected on both Cores before the change. After it, the run collected and passed 361 items, and 223 withPYTEST_ADDOPTS=--noconftest, on both Cores. The repo'sconftest.pyregisters a second plugin, so the default run collects each of the 138 YAML cases twice.ruff format --check .with ruff 0.15.5 passes in CI.Follow-ups
PYTEST_ADDOPTS=--noconftest, so each YAML case runs once on that path.package.Simulation, which the package does not export.PolicyEngine/policyengine-core#681tracksdetect_country_package()selecting packages that lackDATASETSinscripts/run_data.pyorMicrosimulationintools/dependency_map.py.axiom: no RuleSpec change (package export and test)
Claude Code and Antigravity prepared this pull request for Max Ghenis.