Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error converting dd to csv #218

Closed
SamRWest opened this issue Mar 14, 2024 · 8 comments
Closed

Error converting dd to csv #218

SamRWest opened this issue Mar 14, 2024 · 8 comments
Assignees

Comments

@SamRWest
Copy link
Collaborator

I'm getting this exception when converting the austimes DD files to CSVs:

...
File "xl2times\utils\dd_to_csv.py", line 147, in save_data_with_headers
    raise ValueError(
ValueError: Mismatched number of columns for param UC_DYNBND between data (2) and mapping (3)

For values:

>>> columns
['UC_N', 'LIM', 'VALUE']
>>> row
('UC_non-decreasing EE penetration', 'UP')

Relevant DD file section is:

SET UC_DYNBND

/
'UC_non-decreasing EE penetration'.UP
/;

And I found a seemingly relevant comment on line 77-79:

   if data[index].startswith("SET"):
            # See https://www.gams.com/latest/docs/UG_SetDefinition.html
            # This can only parse a subset of the allowed representations

So I'm guessing this error is because parsing isn't yet implemented for all the GAMS Set types (and this is one of them), does that sound right?
Any idea what's the right general approach to fixing this?

@olejandro
Copy link
Member

olejandro commented Mar 14, 2024

No, UC_DYNBND is probably just misclassified in times-info.json. Could you try changing gams-cat from parameter to md-set?

@SamRWest
Copy link
Collaborator Author

Yep, that's got it sorted, thanks! I'll roll that into my next PR (a few other dd_to_csv bugfixes)
Glad we had this chat :)

@olejandro
Copy link
Member

Great! Sounds like xl2times is about to produce the numbers for correct and additional rows for AusTIMES. Would be very curious to know how much off we are. :-)

@SamRWest
Copy link
Collaborator Author

Yep it sure is, and I'm also very curious :)
xl2times now converts the whole model (in one region) in about a minute (used to take over an hour). That's a big milestone :)

I'm floating the idea internally of sharing the (currently private) AusTIMES DD files with you guys for future CI benchmarking in here too. Would that be useful?

Might be worth a quick meeting to talk about our respective broader aims and stuff as well, if you guys are available sometime?

@olejandro
Copy link
Member

That's quite a speed up. Exciting! 🚀
Having AusTIMES in benchmarks would definitely be very useful. The more model variety we can get the better. At least until we manage to get a good coverage with the unit tests.
Having a quick meeting sounds good! Was thinking about it as well. :-) Will reach out by email.

@SamRWest
Copy link
Collaborator Author

Sounds good. I'm at sam dot west at csiro dot au (no .com). And I'm at UTC+11 (sydney time).

@olejandro
Copy link
Member

Thanks! Picked up your email from the git log. :-) My email should be in your inbox soon.

SamRWest added a commit to csiro-energy-systems/xl2times that referenced this issue Mar 21, 2024
@olejandro
Copy link
Member

Addressed in #230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants