PolicyEngine / policyengine-core

Core microsimulation engine for PolicyEngine models. Forked from OpenFisca-Core.
https://policyengine.github.io/policyengine-core
GNU Affero General Public License v3.0
14 stars 20 forks source link

Add default_calculation_period to test runner simulation #284

Closed anth-volk closed 1 month ago

anth-volk commented 1 month ago

Fixes #283. This takes the test_builder's default_period and applies as to the underlying Simulation instance's default_calculation_period. This is as simple as popping one in for the other, since they're both the same type.

This PR also adds a fail-safe whereby, if no simulation period is defined anywhere, not even as the default fallback period for the test run, the tests just use the current year. This could be removed if failure would be preferable.

nikhilwoodruff commented 1 month ago

Adding a test that Core doesn't break the US microsimulation (cc @MaxGhenis)

nikhilwoodruff commented 1 month ago

Merged through #285 - thanks!