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

Add a flag to export only the matpower spec and not extra PowerModels data #707

Closed
frederikgeth opened this issue May 8, 2020 · 6 comments
Milestone

Comments

@frederikgeth
Copy link
Collaborator

Right now, if there is supplementary data in the PM data dictionary, it is written out by default through the _export_extra_data data function. An option to suppress this would be convenient.

@ccoffrin
Copy link
Member

ccoffrin commented May 8, 2020

The default semantics is that if you write the internal data to ".m" and then read it back to PowerModels you will get the same internal data. I think that is a suitable default setting. Adding a flag to omit the extra data upon request seems reasonable.

A work around for the current version would be to delete the extra data from the data dict before calling export_matpower.

@ccoffrin ccoffrin added this to the v0.17.1 milestone May 8, 2020
@ccoffrin ccoffrin changed the title support both core matpower spec and matpower spec+extra_data through export_matpower Add a flag to export only the matpower spec and not extra PowerModels data May 8, 2020
@ccoffrin
Copy link
Member

@frederikgeth I was looking into this a bit more. What were you thinking for components like storage and switches, which do not require an extensions table but also are not part of the Matpower format?

@frederikgeth
Copy link
Collaborator Author

Sorry for the delay and lack of detail. So the problem I ran into originally is that _export_extra_data fails relatively easily when there is data in the data dict that isn't expected or complete. The use case is being able to write out m files without _export_extra_data failing. But because it's done through function handles in

return sprint(export_matpower, data)
, I coulnd't just add a keyword argument. Currently, in some internal packages, I short-circuit _export_extra_data to work around this.

@ccoffrin
Copy link
Member

I see in that case, I would just propose to fix _export_extra_data so that it is more resilient. Can you give some examples of the kind of data that has issues with export?

For example, in _export_extra_data if I filter to only export extra values that are subtypes of Real do you think that would resolve the issue?

@frederikgeth
Copy link
Collaborator Author

So we tend to have failures here

for (key, value) in c
, e.g. BoundsError: attempt to access Float64 when there is a vector instead of a dict where it isn't expected.

@ccoffrin
Copy link
Member

Ok let me try to make this more robust and get back to you.

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

2 participants