iiasa / iiasa/message_ix

lp_diag parsing error

Open
#945 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Jupyter Notebook
Stars
150
Forks
178
Avg merge
17h 32m
Merged PRs (30d)
2

Description

### What happened?

When running lp_diag on my mps file the parser fails.

I get this type of parser fail

example of the line in the mps file
`"G COMMODITY_BALANCE_GT(R12_AFR,'Fertilizer Use|Nitrogen',final_material,2035,year)"`

### Code Sample

```python
in __init__ inside message_ix\tools\lp_diag
ln 248

in add_row
assert n_words == 2, (
^^^^^^^^^^^^
AssertionError: row declaration (line 7917) has 3 words instead of 2.
```

### What did you expect to happen?

example of the line in the mps file
`"G COMMODITY_BALANCE_GT(R12_AFR,'Fertilizer Use|Nitrogen',final_material,2035,year)"`

### Versions

```shell

```

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start in message_ix/tools/lp_diag, reviewing __init__ around line 248 and add_row where the assertion reports line 7917. Reproduce the failure with the shown MPS row and determine how its quoted declaration is expected to be parsed. Done means this input no longer triggers the row-declaration assertion and its parsing behavior is covered by an appropriate regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.