Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Remove the Reform and chart functions that call the Public API

Offen
#628 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 3 Tagen

@anth-volk arbeitet bereits daran.

Seit 22.10.2026.

  • #629 von @anth-volk — offen

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Refactoring
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
backend

Rechercherichtung

Start by reading policyengine_core/reforms/reform.py, policyengine_core/charts/api.py, and the exports in policyengine_core.charts; trace the named methods and helpers and check their callers. Add the source scan test for api.policyengine.org, keep the dataset requests dependency, and add a removed changelog fragment. Done means the API functions and their exports are removed, the new test passes, and dependent repositories have merged their updates before release.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

What

Three parts of policyengine-core send HTTP requests to the PolicyEngine Public API (api.policyengine.org):

  • Reform.from_api (policyengine_core/reforms/reform.py) downloads a saved policy by its numeric ID with GET /{country}/policy/{id} and builds a Reform from it.
  • Reform.api_id (same module) sends the reform's parameter values to POST /{country}/policy and returns the new policy's ID.
  • policyengine_core/charts/api.py: get_api_chart_data reads GET /{country}/metadata, then requests GET /{country}/economy/{reform}/over/{baseline} once a second until the result is ready; intra_decile_chart and decile_chart plot that result. policyengine_core.charts re-exports all three.

Why

The Public API depends on the country packages, which depend on policyengine-core, so these functions make the lowest-level package depend on the top-level service at run time. The Public API's newer policy routes also have no lookup by these numeric policy IDs, and the routes these functions call are planned for removal.

Proposed change

  • Remove Reform.from_api, Reform.api_id, the helpers only they use (_api_period_range and classproperty, and the requests import in the reform module), and policyengine_core/charts/api.py with its re-export from policyengine_core.charts.
  • Add a test that fails if any file in the package source contains api.policyengine.org.
  • Keep the requests dependency, which policyengine_core/data/dataset.py uses.
  • Release it as a minor version through a removed changelog fragment.

Release order

The known users of these functions are being updated first: two test cases in policyengine-uk, three public repositories (uk-local-area-calibration, obr-forecast and blank-slate-ubi-in-the-us) and one private repository. policyengine-uk accepts any policyengine-core>=3.32.27, so the release containing this change must be published only after those changes merge; otherwise policyengine-uk's tests fail as soon as it is published.

Vorherrschende Sprache
Python
Sterne
22
Forks
30
Ø Merge
4 T. 16 Std.
Gemergte PRs (30 T.)
35

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus PolicyEngine/policyengine-core

Alle Issues in PolicyEngine/policyengine-core

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.