From 34afb6338fd5b05807162e1cbaea9ad0aa4abe57 Mon Sep 17 00:00:00 2001 From: Jason DeBacker Date: Mon, 27 Jul 2026 16:27:22 -0400 Subject: [PATCH 1/6] format --- iot/inverse_optimal_tax.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/iot/inverse_optimal_tax.py b/iot/inverse_optimal_tax.py index 632358e..ae49d03 100644 --- a/iot/inverse_optimal_tax.py +++ b/iot/inverse_optimal_tax.py @@ -288,9 +288,7 @@ def mills_ratio(t): # tails, which can zero out the fitted density and # poison downstream calculations (theta_z, g_z) with # infs/NaNs. - return np.sqrt(np.pi / 2) * scipy.special.erfcx( - t / np.sqrt(2) - ) + return np.sqrt(np.pi / 2) * scipy.special.erfcx(t / np.sqrt(2)) def pln_pdf(y, mu, sigma, alpha): x1 = alpha * sigma - (np.log(y) - mu) / sigma @@ -336,11 +334,9 @@ def fit_pln(data, weights, initial_guess): def pln_cdf(y, mu, sigma, alpha): x1 = alpha * sigma - (np.log(y) - mu) / sigma - CDF = ( - st.norm.cdf((np.log(y) - mu) / sigma) - - st.norm.pdf((np.log(y) - mu) / sigma) - * mills_ratio(x1) - ) + CDF = st.norm.cdf((np.log(y) - mu) / sigma) - st.norm.pdf( + (np.log(y) - mu) / sigma + ) * mills_ratio(x1) return CDF def pln_dpdf(y, mu, sigma, alpha): @@ -480,14 +476,10 @@ def find_eti(iot, g_z=None, eti_0=0.25, boundary="z0"): tail_integral = np.append(rev_cumsum, 0.0) eti_beliefs = ( - ((1 - iot.mtr) / iot.mtr) - * (1 / (iot.z * iot.f)) - * tail_integral + ((1 - iot.mtr) / iot.mtr) * (1 / (iot.z * iot.f)) * tail_integral ) else: - raise ValueError( - f"boundary must be 'z0' or 'inf', got '{boundary}'" - ) + raise ValueError(f"boundary must be 'z0' or 'inf', got '{boundary}'") return eti_beliefs From 6a000fb99407050a1f0d6621f2171879dc8bbc2b Mon Sep 17 00:00:00 2001 From: Jason DeBacker Date: Mon, 27 Jul 2026 16:36:22 -0400 Subject: [PATCH 2/6] pin taxcalc, limit jupyter book --- environment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index c72202d..f8f9500 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge dependencies: - python -- "taxcalc>=4.0.0" +- "taxcalc==4.4.0" - pandas - numpy - scipy @@ -15,7 +15,7 @@ dependencies: - pylint - coverage - pip: - - jupyter-book>=0.9.1 + - jupyter-book<2.0.0 - black - plotly-express - kaleido From 0e10197104a9e8dbd467f9f38a5736201369405d Mon Sep 17 00:00:00 2001 From: Jason DeBacker Date: Mon, 27 Jul 2026 16:52:37 -0400 Subject: [PATCH 3/6] try to pin python version --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index f8f9500..b455050 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,7 @@ name: iot-dev channels: - conda-forge dependencies: -- python +- python<3.11 - "taxcalc==4.4.0" - pandas - numpy From eade42be91fd71d0b02e0d2891a35d578c395ae4 Mon Sep 17 00:00:00 2001 From: Jason DeBacker Date: Tue, 28 Jul 2026 06:15:37 -0400 Subject: [PATCH 4/6] only test on 3.10 --- .github/workflows/build_and_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 4959101..f0ab999 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -1,4 +1,4 @@ -name: Build and test [Python 3.10, 3.11] +name: Build and test [Python 3.10] on: [push, pull_request] @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11"] + python-version: ["3.10"] steps: - name: Checkout From 326279a075b447266250a541c5f0fae45138e80b Mon Sep 17 00:00:00 2001 From: Jason DeBacker Date: Tue, 28 Jul 2026 06:45:10 -0400 Subject: [PATCH 5/6] build docs with py 3.10 --- .github/workflows/deploy_docs.yml | 2 +- .github/workflows/docs_check.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 7929be5..f33e246 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -18,7 +18,7 @@ jobs: with: activate-environment: iot-dev environment-file: environment.yml - python-version: 3.11 + python-version: 3.10 auto-activate-base: false - name: Build # Build Jupyter Book diff --git a/.github/workflows/docs_check.yml b/.github/workflows/docs_check.yml index 8d3366f..9fd6abb 100644 --- a/.github/workflows/docs_check.yml +++ b/.github/workflows/docs_check.yml @@ -15,7 +15,7 @@ jobs: with: activate-environment: iot-dev environment-file: environment.yml - python-version: 3.11 + python-version: 3.10 auto-activate-base: false - name: Build # Build Jupyter Book From 5e18aee4efdade437eaee65654dbae502ae638fb Mon Sep 17 00:00:00 2001 From: Jason DeBacker Date: Tue, 28 Jul 2026 07:34:15 -0400 Subject: [PATCH 6/6] build docs with py 3.10 --- .github/workflows/deploy_docs.yml | 2 +- .github/workflows/docs_check.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index f33e246..f6be657 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -18,7 +18,7 @@ jobs: with: activate-environment: iot-dev environment-file: environment.yml - python-version: 3.10 + python-version: "3.10" auto-activate-base: false - name: Build # Build Jupyter Book diff --git a/.github/workflows/docs_check.yml b/.github/workflows/docs_check.yml index 9fd6abb..f54b70f 100644 --- a/.github/workflows/docs_check.yml +++ b/.github/workflows/docs_check.yml @@ -15,7 +15,7 @@ jobs: with: activate-environment: iot-dev environment-file: environment.yml - python-version: 3.10 + python-version: "3.10" auto-activate-base: false - name: Build # Build Jupyter Book