Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update calibration handling of tax function parameters #56

Merged
merged 7 commits into from
May 15, 2024

Conversation

jdebacker
Copy link
Member

This PR addresses Issue #55, but updating calibrate.py to handle tax function parameters stored in lists, as is done in the most recent version of OG-Core.

This PR also updates a dependency from openfisca_uk to policyengine_uk (Issue #54).

@jdebacker
Copy link
Member Author

Working through API changes for PolicyEngine. Latest traceback:

Traceback (most recent call last):
  File "/Users/jason.debacker/repos/OG-UK/examples/run_oguk.py", line 199, in <module>
    main(reform=reform)
  File "/Users/jason.debacker/repos/OG-UK/examples/run_oguk.py", line 78, in main
    c = Calibration(p, estimate_tax_functions=True, client=client)
  File "/Users/jason.debacker/repos/OG-UK/oguk/calibrate.py", line 33, in __init__
    self.tax_function_params = self.get_tax_function_parameters(
  File "/Users/jason.debacker/repos/OG-UK/oguk/calibrate.py", line 113, in get_tax_function_parameters
    micro_data, taxcalc_version = get_micro_data.get_data(
  File "/Users/jason.debacker/repos/OG-UK/oguk/get_micro_data.py", line 210, in get_data
    results = client.gather(futures)
  File "/Users/jason.debacker/anaconda3/envs/oguk-dev/lib/python3.9/site-packages/distributed/client.py", line 2294, in gather
    return self.sync(
  File "/Users/jason.debacker/anaconda3/envs/oguk-dev/lib/python3.9/site-packages/distributed/utils.py", line 339, in sync
    return sync(
  File "/Users/jason.debacker/anaconda3/envs/oguk-dev/lib/python3.9/site-packages/distributed/utils.py", line 406, in sync
    raise exc.with_traceback(tb)
  File "/Users/jason.debacker/anaconda3/envs/oguk-dev/lib/python3.9/site-packages/distributed/utils.py", line 379, in f
    result = yield future
  File "/Users/jason.debacker/anaconda3/envs/oguk-dev/lib/python3.9/site-packages/tornado/gen.py", line 769, in run
    value = future.result()
  File "/Users/jason.debacker/anaconda3/envs/oguk-dev/lib/python3.9/site-packages/distributed/client.py", line 2157, in _gather
    raise exception.with_traceback(traceback)
  File "/Users/jason.debacker/repos/OG-UK/oguk/get_micro_data.py", line 126, in get_calculator_output
    "mtr_labinc": get_household_mtrs(
  File "/Users/jason.debacker/repos/OG-UK/oguk/get_micro_data.py", line 65, in get_household_mtrs
    reformed = Microsimulation(reform, **kwargs)
  File "/Users/jason.debacker/anaconda3/envs/oguk-dev/lib/python3.9/site-packages/policyengine_core/simulations/simulation.py", line 131, in __init__
    self.build_from_dataset()
  File "/Users/jason.debacker/anaconda3/envs/oguk-dev/lib/python3.9/site-packages/policyengine_core/simulations/simulation.py", line 172, in build_from_dataset
    self.tax_benefit_system.instantiate_entities()
AttributeError: 'tuple' object has no attribute 'instantiate_entities'

cc @nikhilwoodruff

@jdebacker
Copy link
Member Author

Note, this PR is waiting on some appropriate data to be available for public consumption from PolicyEngine-UK

cc @nikhilwoodruff @rickecon

@jdebacker jdebacker marked this pull request as ready for review May 15, 2024 19:11
@jdebacker
Copy link
Member Author

Tests are failing bc there still is not a usable dataset for PolicyEngine-UK.

But merging anyway to get in some of the other work in this PR.

@jdebacker jdebacker merged commit 307d761 into PSLmodels:main May 15, 2024
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant