This project analyzes the impact of a Blank Slate Universal Basic Income (UBI) in the United States using PolicyEngine.
- Visual Studio Code
- GitHub account
- Python 3.11
- macOS (instructions are for Homebrew users)
-
Fork the repository:
- Visit https://github.com/PolicyEngine/blank-slate-ubi-in-the-us
- Click the "Fork" button in the top-right corner
- Choose your GitHub account as the destination for the fork
-
Clone your forked repository using VS Code:
- Open VS Code
- Press
Cmd+Shift+P
to open the Command Palette - Type "Git: Clone" and select it
- Paste the URL of your forked repository
- Choose a local directory to clone into
-
Install Python 3.11 using Homebrew:
brew update brew install [email protected]
-
Add Python 3.11 to your PATH by adding these lines to your
~/.zshrc
file:export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH" alias python3.11="/opt/homebrew/opt/[email protected]/bin/python3.11"
-
Apply the changes:
source ~/.zshrc
-
Open a terminal in VS Code (Terminal > New Terminal) and run:
make
This command will:
- Check for Python 3.11
- Create a virtual environment
- Install all required packages
- Set up a Jupyter kernel
- Execute both notebooks in sequence:
blank_slate_ubi.ipynb
andcharts.ipynb
blank_slate_ubi.ipynb
: Main analysis notebookcharts.ipynb
: Notebook for generating charts based on the analysisrequirements.txt
: List of Python package dependenciesMakefile
: Automates the setup and execution processubi_amounts.csv
: Contains UBI amounts dataoptimisation_results.csv
: Contains optimization resultsjson_data.json
: Contains JSON data for analysis
-
To only set up the environment without running the notebooks:
make setup
-
To run the notebooks after setup:
make run
-
To clean up the environment and generated files:
make clean
If you encounter any issues:
-
Ensure Python 3.11 is installed and active:
python3.11 --version
-
If you're having issues with pip or package installations, try:
make clean make
-
If you encounter an "externally-managed-environment" error, ensure you're using the virtual environment:
source policyengine_env/bin/activate
Then run pip commands within this environment.
-
For any other issues, please check the error messages in the console output. The Makefile includes verbose output to help identify where problems occur.
If you make changes to the project dependencies, please update the requirements.txt
file:
policyengine_env/bin/pip freeze > requirements.txt
For questions or issues, please open an issue on the GitHub repository.