Remove the Reform and chart functions that call the Public API
Maintainer thường phản hồi trong vòng 3 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 22
- Fork
- 30
- Merge trung bình
- 4 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 35
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PolicyEngine/policyengine-core
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
PolicyEngine/policyengine-core#605 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PolicyEngine/policyengine-core#549 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
`restore_simulation` silently drops memberless group entitiesCó thể đã có người làm @Adelagric đã nhận 45 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PolicyEngine/policyengine-core#547 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
SimulationBuilder.build_from_dict should clear dataset provenance when rebuilding from a situationĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
PolicyEngine/policyengine-core#627 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
PolicyEngine/policyengine-core#621 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của PolicyEngine/policyengine-core
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
GoogleCloudPlatform/gce-rescue#195 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
intake mcp-intake needs-ac needs-human-review priority:medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Ikalus1988/MisakaNet#3848 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
521xueweihan/HelloGitHub#4105 ·
-
bug size:XS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày