Remove the Reform and chart functions that call the Public API
Maintainer antworten meist innerhalb von 3 Tagen
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 45/100
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 withGET /{country}/policy/{id}and builds aReformfrom it.Reform.api_id(same module) sends the reform's parameter values toPOST /{country}/policyand returns the new policy's ID.policyengine_core/charts/api.py:get_api_chart_datareadsGET /{country}/metadata, then requestsGET /{country}/economy/{reform}/over/{baseline}once a second until the result is ready;intra_decile_chartanddecile_chartplot that result.policyengine_core.chartsre-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_rangeandclassproperty, and therequestsimport in the reform module), andpolicyengine_core/charts/api.pywith its re-export frompolicyengine_core.charts. - Add a test that fails if any file in the package source contains
api.policyengine.org. - Keep the
requestsdependency, whichpolicyengine_core/data/dataset.pyuses. - Release it as a minor version through a
removedchangelog 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
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PolicyEngine/policyengine-core
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
PolicyEngine/policyengine-core#605 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
PolicyEngine/policyengine-core#549 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
`restore_simulation` silently drops memberless group entitiesEvtl. vergeben @Adelagric hat das vor 44 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
PolicyEngine/policyengine-core#547 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
SimulationBuilder.build_from_dict should clear dataset provenance when rebuilding from a situationOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
PolicyEngine/policyengine-core#627 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 8/100
PolicyEngine/policyengine-core#621 ·
Maintainer antworten meist innerhalb von 3 Tagen
Alle Issues in PolicyEngine/policyengine-core
Ähnliche Issues
-
Project submission:Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
slavakurilyak/awesome-ai-agents#845 ·
Maintainer antworten meist innerhalb von 1 Tag
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directoryEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offendifficulty:2 enhancement good first issue
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 92/100
MakazhanAlpamys/Soup#2178 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG] dcg.waggr permutation p-values are folded twice, so near-zero scores get the smallest p-valuesOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
scverse/rapids-singlecell#854 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGLEvtl. vergeben @ninglinLiu hat das heute übernommen. Offenarea:frontend backend:slang bug direction:input
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
random_elements(unique=True) on an OrderedDict: ZeroDivisionError once only zero weights remain, AssertionError with use_weighting=FalseEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 13 Tagen