Resource-constraint check cannot exempt the terminal period without waiving the whole path
Maintainer thường phản hồi trong vòng 1 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
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- numpy, python
- Lĩnh vực
- backend, testing-qa
Hướng nghiên cứu
The check is in ogcore/TPI.py around line 1839; start by reading that resource-constraint check and how RC_TPI is configured. The issue also cites oguk/api.py lines 979–983 as a downstream example. Done means terminal-period handling no longer masks interior violations, with the behavior covered by relevant tests; a pull request is already open.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
RC_TPI is a single scalar compared against the resource-constraint error at every period with np.any, so there is no way to exempt the terminal period without simultaneously waiving the check across the whole path.
https://github.com/PSLmodels/OG-Core/blob/master/ogcore/TPI.py#L1839
if (np.any(np.absolute(RC_error) >= p.RC_TPI)) and ENFORCE_SOLUTION_CHECKS:
raise RuntimeError("Transition path equlibrium not found " + "(RC_error)")
Why this matters
The last period of a truncated transition path is not a true steady state, so RC_error[T-1] is routinely larger than the interior periods by orders of magnitude. Country packages that hit this have no expressive option other than raising the global tolerance.
A concrete example downstream: OG-UK sets p.RC_TPI = 0.2 with an in-code comment stating that only t = T-1 fails and "all other periods are well within 1e-4" (oguk/api.py:979-983). The effect is that a mid-path violation of up to 0.2 — the same order as the terminal error the setting was written to route around — now passes silently on every transition run.
Suggested change
Check the interior and terminal periods separately, e.g.
- compare
RC_error[:-1]against a tight tolerance (RC_TPI, default unchanged), and - handle
RC_error[-1]under a separate, looserRC_TPI_terminalparameter (or exclude it and note the truncation in the docs).
This is backwards compatible for anyone currently passing the check, and it restores the diagnostic for the interior path.
Happy to open a PR if the approach looks right.
- Ngôn ngữ chính
- Python
- Star
- 85
- Fork
- 153
- Merge trung bình
- 1 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 19
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 PSLmodels/OG-Core
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 57/100
PSLmodels/OG-Core#1218 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của PSLmodels/OG-Core
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
micropython/micropython#19906 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
FinanceFlash/unvibecode#597 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
TomAnthony/YourOwnWeigh#21 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]: Compliance rules never see Unity Catalog views as viewsCó thể đã có người làm @wagnercsantos đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
databrickslabs/ontos#1348 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Deprecated datetime.utcnow() is called on every log line (DeprecationWarning on Python 3.12+)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày