scip cannot read lp file with a binary variable that is used nowhere
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
[!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
- 主要言語
- Python
- スター
- 264
- フォーク
- 95
- 平均マージ
- 11時間 33分
- マージ済み PR(30日)
- 86
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PyPSA/linopy のほかの issue
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
メンテナーはふだん 1 日以内に返信
-
feature needs triage
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 18/100
PyPSA/linopy#1159 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
spec: a row emptied by the data is refused even when it holds再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
Gurobi raises GurobiError when a MIP stops at a limit without an incumbent対応中かも @Blizzeq が 15 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Rose22/openlumara#166 ·
-
documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
enhancement feature/signals self-driving team/self-driving
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
PostHog/posthog#144208 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
good first issue help wanted tests
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
LMPrado-DZ23/open_notas_br#14 ·
メンテナーはふだん 1 日以内に返信