Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
d9ff878
Bit of a blank slate
nikhilwoodruff Aug 21, 2025
300406f
Move to src/ format
nikhilwoodruff Aug 21, 2025
f95f309
Add database models
nikhilwoodruff Aug 22, 2025
e8ea5be
Add database improvements
nikhilwoodruff Aug 22, 2025
ee401d1
Reset to simpler version
nikhilwoodruff Aug 24, 2025
a0f9944
Remove example
nikhilwoodruff Aug 24, 2025
43e1cf1
Add updates
nikhilwoodruff Aug 24, 2025
f0c9287
Add parameter rows
nikhilwoodruff Aug 24, 2025
f22eb6c
Add progress
nikhilwoodruff Aug 25, 2025
f18df8b
Add user concepts
nikhilwoodruff Aug 25, 2025
cd3073a
Remove migration file
nikhilwoodruff Aug 25, 2025
8bc9408
Minor improvements
nikhilwoodruff Aug 25, 2025
f1d8179
Add model versioning
nikhilwoodruff Aug 25, 2025
8c7ef7a
Have initialise update parameters
nikhilwoodruff Aug 25, 2025
e166ecc
Add variables table
nikhilwoodruff Aug 25, 2025
f696d5b
Add data file tracking
nikhilwoodruff Aug 25, 2025
f8da2b7
Add multi-period handling
nikhilwoodruff Aug 25, 2025
f49fa52
Add multi year outputs
nikhilwoodruff Aug 25, 2025
96585cf
Update with changes
nikhilwoodruff Aug 26, 2025
f07b629
Update
nikhilwoodruff Aug 27, 2025
caf83c1
Clean up/remove unfinished code
nikhilwoodruff Aug 27, 2025
8913d80
Add UK model outputs
nikhilwoodruff Aug 27, 2025
dfa911e
Add US impacts
nikhilwoodruff Aug 27, 2025
ad604a4
Add refactor
nikhilwoodruff Aug 27, 2025
30315cc
Start again, again
nikhilwoodruff Aug 28, 2025
ee2458b
Update code
nikhilwoodruff Aug 28, 2025
9bedffd
Split up classes from feedback
nikhilwoodruff Aug 28, 2025
6031351
Update
nikhilwoodruff Aug 28, 2025
0a03afc
Remove import
nikhilwoodruff Aug 28, 2025
7f8722a
Update models
nikhilwoodruff Aug 29, 2025
08e8df2
Back to formalised and finished schemas, todo: add database class again
nikhilwoodruff Aug 30, 2025
ccb566c
First db version
nikhilwoodruff Aug 30, 2025
0610d0c
Finally fix schemas, sqlmodel incapable of inheritance
nikhilwoodruff Aug 31, 2025
de29cf4
Add models
nikhilwoodruff Sep 1, 2025
109ff22
Reset a bit
nikhilwoodruff Sep 2, 2025
e97c4fb
Cleanup
nikhilwoodruff Sep 2, 2025
2b4af90
Get basic functionality working for each country
nikhilwoodruff Sep 3, 2025
666575d
Add docs and synthetic test data
nikhilwoodruff Sep 3, 2025
1213d03
Remove repo test nbs
nikhilwoodruff Sep 3, 2025
3232a11
Add docs and synthetic data
nikhilwoodruff Sep 3, 2025
075eefc
Add database models back!
nikhilwoodruff Sep 3, 2025
b92c544
Add new tables
nikhilwoodruff Sep 3, 2025
05b50a8
Re-add seeding
nikhilwoodruff Sep 3, 2025
f164933
Improve deduplication and add seeding
nikhilwoodruff Sep 3, 2025
cdade80
ID improvement
nikhilwoodruff Sep 3, 2025
5583178
Fix bugs
nikhilwoodruff Sep 3, 2025
fc29480
Update insert logic
nikhilwoodruff Sep 3, 2025
b2524fc
Format
nikhilwoodruff Sep 4, 2025
427faf9
Separate data item classes
nikhilwoodruff Sep 4, 2025
1d3381f
Add migration runner
nikhilwoodruff Sep 4, 2025
45b65a0
Improve migration code
nikhilwoodruff Sep 4, 2025
ac7c56a
Add changes
nikhilwoodruff Sep 5, 2025
3ebdb71
Updates
nikhilwoodruff Sep 5, 2025
c9f81a2
Add docs, rename dynamics to dynamic
nikhilwoodruff Sep 5, 2025
68f7c80
Fix tests
nikhilwoodruff Sep 5, 2025
6412ef7
Fix
nikhilwoodruff Sep 5, 2025
f3680da
Also save structural reforms
nikhilwoodruff Sep 6, 2025
75b34e2
Format
nikhilwoodruff Sep 6, 2025
25a4245
Fix migration
nikhilwoodruff Sep 7, 2025
8931b76
Add db constant for live db
nikhilwoodruff Sep 7, 2025
8a601af
Add baseline parameter table
nikhilwoodruff Sep 7, 2025
73f6dd5
Add baseline parameter table improvements
nikhilwoodruff Sep 7, 2025
a54ba06
Update dataset type
nikhilwoodruff Sep 8, 2025
9d9ace8
Add policy/dynamic missing links
nikhilwoodruff Sep 8, 2025
f127db2
Improve migration
nikhilwoodruff Sep 8, 2025
9dc0093
Update agg and count
nikhilwoodruff Sep 8, 2025
40bca1c
Format
nikhilwoodruff Sep 8, 2025
8403717
Remove quickstart nb
nikhilwoodruff Sep 8, 2025
129fadf
Add output tables
nikhilwoodruff Sep 10, 2025
787d2c1
Remove example
nikhilwoodruff Sep 10, 2025
db68cda
Update UK simulation runner to include all variables by default
nikhilwoodruff Sep 10, 2025
6c23bdf
Refactor
nikhilwoodruff Sep 14, 2025
63f2f7f
Refactor
nikhilwoodruff Sep 14, 2025
9569d33
Reimplement
nikhilwoodruff Sep 15, 2025
3b02493
Get us working
nikhilwoodruff Sep 18, 2025
08e0cc7
Move out of extensions
nikhilwoodruff Sep 18, 2025
8428c14
Add tables
nikhilwoodruff Sep 18, 2025
07d18d3
Add seed object function
nikhilwoodruff Sep 18, 2025
32ef960
Fix bugs
nikhilwoodruff Sep 18, 2025
ad76817
Add tests, fix bugs, start docs
nikhilwoodruff Sep 19, 2025
69fdcf7
Add notebook
nikhilwoodruff Sep 19, 2025
eb21974
Update
nikhilwoodruff Sep 19, 2025
0805cdf
Fix ID generation bug
nikhilwoodruff Sep 19, 2025
0e8f40c
Update notebook
nikhilwoodruff Sep 19, 2025
93d920d
Update nb
nikhilwoodruff Sep 19, 2025
68c4e28
Format
nikhilwoodruff Sep 20, 2025
cfdd0b0
Fix tests
nikhilwoodruff Sep 20, 2025
27760d5
CI
nikhilwoodruff Sep 20, 2025
90ec7cc
Update CI to match -uk
nikhilwoodruff Sep 20, 2025
e160806
Update CI
nikhilwoodruff Sep 20, 2025
94f7119
Update CI
nikhilwoodruff Sep 20, 2025
a18d387
Lint fix
nikhilwoodruff Sep 20, 2025
6a0a522
Fix docs action
nikhilwoodruff Sep 20, 2025
14f9a0a
No change
nikhilwoodruff Sep 20, 2025
0743eec
Format
nikhilwoodruff Sep 20, 2025
aa1b820
Fix test action
nikhilwoodruff Sep 20, 2025
4f5ff4b
Fix issues
nikhilwoodruff Sep 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Copy this file to `.env` and fill in the values as needed.

# Local development database (default if not set)
DATABASE_URL=sqlite:///policyengine.db

# PolicyEngine live database connection pieces (used when --db-location policyengine)
# The CLI composes the URL as postgresql+psycopg2://... with sslmode=require by default.
POLICYENGINE_DB_PASSWORD=
POLICYENGINE_DB_USER=postgres
POLICYENGINE_DB_HOST=db.usugnrssspkdutcjeevk.supabase.co
POLICYENGINE_DB_PORT=5432
POLICYENGINE_DB_NAME=postgres

# Optional: Hugging Face token for private repos when seeding datasets from HF
HUGGING_FACE_TOKEN=
1 change: 0 additions & 1 deletion .github/fetch_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ def fetch_version():
import importlib

return importlib.import_module("policyengine").__version__
return version
except Exception as e:
print(f"Error fetching version: {e}")
return None
Expand Down
45 changes: 0 additions & 45 deletions .github/workflows/any_changes.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/changelog_entry.yaml

This file was deleted.

31 changes: 17 additions & 14 deletions .github/workflows/code_changes.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Workflow that runs on code changes to a pull request.
# Workflow that runs on code changes to the master branch.

name: Code changes
on:
pull_request:
push:
branches:
- main

paths:
- policyengine/**
- src/**
- tests/**
- .github/**
workflow_dispatch:

jobs:
Lint:
Expand All @@ -20,27 +22,28 @@ jobs:
with:
args: ". -l 79 --check"
Test:
runs-on: ubuntu-latest
runs-on: macos-latest
permissions:
contents: "read"
id-token: "write"
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.13'
- uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: "projects/322898545428/locations/global/workloadIdentityPools/policyengine-research-id-pool/providers/prod-github-provider"
service_account: "policyengine-research@policyengine-research.iam.gserviceaccount.com"

- name: Install package
run: uv pip install .[dev] --system

- name: Run tests
run: make test
run: uv pip install -e .[dev] --system
- name: Install JB
run: uv pip install "jupyter-book>=2.0.0a0" --system
- name: UV sync
run: uv sync
- name: Run tests with coverage
run: make test
env:
HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This file was created automatically with `myst init --gh-pages` 🪄 💚
# Ensure your GitHub Pages settings for this repository are set to deploy with **GitHub Actions**.

name: Deploy documentation
on:
push:
# Runs on pushes targeting the default branch
branches: [master]
env:
# `BASE_URL` determines, relative to the root of the domain, the URL that your site is served from.
# E.g., if your site lives at `https://mydomain.org/myproject`, set `BASE_URL=/myproject`.
# If, instead, your site lives at the root of the domain, at `https://mydomain.org`, set `BASE_URL=''`.
BASE_URL: /${{ github.event.repository.name }}

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false
jobs:
deploy:
name: Deploy to GitHub Pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v3
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install MyST
run: npm install -g mystmd
- name: Build HTML Assets
run: cd docs && myst build --html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './docs/_build/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
48 changes: 48 additions & 0 deletions .github/workflows/pr_code_changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Workflow that runs on code changes to a pull request.

name: Code changes
on:
pull_request:
branches:
- main

paths:
- src/**
- tests/**
- .github/**
workflow_dispatch:

jobs:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Check formatting with ruff
- name: Install ruff
run: pip install ruff

- name: Run ruff check
run: ruff check .
Test:
runs-on: macos-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Install package
run: uv pip install -e .[dev] --system
- name: Install policyengine
run: uv pip install policyengine --system
- name: UV sync
run: uv sync
- name: Run tests with coverage
run: make test
env:
HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/pr_docs_changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Workflow that runs on code changes to a pull request.

name: Docs changes
on:
pull_request:
branches:
- main

paths:
- docs/**
- .github/**
workflow_dispatch:

jobs:
Test:
runs-on: ubuntu-latest
name: Test documentation builds
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Install package
run: uv pip install -e .[dev] --system
- name: Install policyengine
run: uv pip install policyengine --system
- name: Install JB
run: uv pip install "jupyter-book>=2.0.0a0" --system
- name: Test documentation builds
run: cd docs && jupyter book build
38 changes: 0 additions & 38 deletions .github/workflows/publish_documentation.yaml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/publish_package.yaml

This file was deleted.

Loading