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

Attempting to use policyengine-uk code in Colab notebook throws fetch error #828

Open
anth-volk opened this issue Mar 4, 2024 · 0 comments

Comments

@anth-volk
Copy link
Contributor

When attempting to use code from policyengine-uk in a Colab notebook or other Python platform, the code raises the following error:

---------------------------------------------------------------------------

ValueError                                Traceback (most recent call last)

[<ipython-input-4-c88b9fc1a9ef>](https://localhost:8080/#) in <cell line: 20>()
     18     def apply(self):
     19         self.modify_parameters(modify_parameters)
---> 20 baseline = Microsimulation()
     21 reformed = Microsimulation(reform=reform)
     22 baseline_person = baseline.calc("household_net_income",

3 frames

[/usr/local/lib/python3.10/dist-packages/policyengine_core/data/dataset.py](https://localhost:8080/#) in download(self, url)
    298             response = requests.get(url, headers=auth_headers)
    299             if response.status_code != 200:
--> 300                 raise ValueError(
    301                     f"Invalid response code {response.status_code} for url {url}."
    302                 )

ValueError: Invalid response code 404 for url https://api.github.com/repos/policyengine/non-public-microdata/releases/tags/uk-2023-dec-calibration.

This is almost certainly from the non-public microdata. Even so, this presents a confusing output to users who may have taken the code from the Reproduce in Python page of the app, so I feel it'd be a good idea to develop a strategy to dealing with this.

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

No branches or pull requests

1 participant