scip cannot read lp file with a binary variable that is used nowhere
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Start by tracing the LP and LP-Polars export paths used by m.solve("scip", io_api=...), then look for their tests covering variable bounds and binary declarations. Reproduce with the supplied model and compare the generated LP sections with MPS output. Done means both LP APIs solve the model with the unused binary variable, matching the expected objective of 5.0.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
[!NOTE]
The following content was generated by AI.
Issue Description
SCIP cannot read the LP file linopy writes when a binary variable is declared but appears in no constraint and not in the objective.
Reproducible Example
import linopy
m = linopy.Model()
x = m.add_variables(lower=0, upper=10, name="x")
m.add_variables(binary=True, name="unused")
m.add_constraints(x >= 5)
m.add_objective(1.0 * x)
for io_api in ["lp", "lp-polars", "mps", "direct"]:
try:
status, cond = m.solve("scip", io_api=io_api)
print(io_api, "OK", status, cond, m.objective.value)
except Exception as e:
print(io_api, "FAIL", type(e).__name__, str(e)[:300])
Result:
lp: fails withOSError: SCIP: read error!lp-polars: fails with the same errormps: works, objective 5.0direct:NotImplementedError: Solver scip does not support direct API model export.
SCIP's message:
[reader_lp.c:166] ERROR: Syntax error in line 23 ('x1'): unknown variable in binaries section.
The LP file has x1 (the unused binary) only in the binary section. SCIP's LP reader seems to accept only variables it has already seen in the objective, constraints or bounds.
Expected Behavior
The model solves with io_api="lp" and "lp-polars", as it does with "mps". For example, the writer could emit such variables in the objective with a zero coefficient or in the bounds section.
Installed Versions
linopy 0.0.post1.dev60+gac3eaf7a8 (master at ac3eaf7), highspy 1.15.1, pyscipopt 6.3.0, gurobipy 14.0.0 (restricted license), Python 3.13.18
Written LP file and full output
min
obj:
+1.0 x0
s.t.
c0:
+1.0 x0
>= 5.0
bounds
+0.0 <= x0 <= +10.0
binary
x1
end
[reader_lp.c:166] ERROR: Syntax error in line 23 ('x1'): unknown variable in binaries section.
input: end
^
[reader_lp.c:4365] ERROR: Error <-2> in function call
lp FAIL OSError SCIP: read error!
Generated by Claude Code
- Ngôn ngữ chính
- Python
- Star
- 264
- Fork
- 95
- Merge trung bình
- 11 giờ 33 phút
- Pull request đã merge (30 ngày)
- 86
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 PyPSA/linopy
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feature needs triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/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 18/100
PyPSA/linopy#1159 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
spec: a row emptied by the data is refused even when it holdsCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Gurobi raises GurobiError when a MIP stops at a limit without an incumbentCó thể đã có người làm @Blizzeq đã nhận 15 ngày trước. Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Rose22/openlumara#166 ·
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
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 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement feature/signals self-driving team/self-driving
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PostHog/posthog#144208 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue help wanted tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
LMPrado-DZ23/open_notas_br#14 ·
Maintainer thường phản hồi trong vòng 1 ngày