-
Notifications
You must be signed in to change notification settings - Fork 9
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
PSSE Exporter Part 1: Add Tests and Formalize Exporter Implementation #42
PSSE Exporter Part 1: Add Tests and Formalize Exporter Implementation #42
Conversation
443b157
to
fb1b917
Compare
Here's my Git plan:
This lets me submit PRs for code review along the way, rather than having one massive code review at the end, while also letting the interface evolve as I discover more requirements of it. |
The current exporter interface is: # Initialize an exporter from a Sienna system
PSSEExporter(base_system::System, psse_version::Symbol)
# Whenever you have new data to export, update the exporter with either a `PowerFlowData` or
# a modified `System` (which must be fundamentally the same system, just with some values changed):
update_exporter!(exporter::PSSEExporter, data::PowerFlowData) # preferred
update_exporter!(exporter::PSSEExporter, data::System) # less preferred
# Actually perform an export
write_export(exporter::PSSEExporter, scenario_name::AbstractString, year::Int, export_location::AbstractString) and I expect this will probably stay roughly the same throughout Part 1 — though I may change up the arguments a bit — but will probably change substantially in Part 2. |
The current status of Part 1 is that the above interface is fully implemented and round-trip tested up to a certain level, but the implementation still relies on old code. I'll now work on a from-scratch reimplementation of the exporter. |
src/psse_export.jl
Outdated
PSY.ACBusTypes.ISOLATED => 4, | ||
) | ||
|
||
# TODO consider adding this to IS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
- `data::PSY.PowerFlowData`: the new data. Must correspond to the `System` with which the | ||
exporter was constructor | ||
""" | ||
function update_exporter!(exporter::PSSEExporter, data::PowerFlowData) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference since we discussed it already. Relying on deep copies can be problematic for systems with large time series data sets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes — will change this in Part 2
for original_number in buses | ||
haskey(mapping, original_number) && continue | ||
new_number = original_number | ||
new_number %= 1_000_000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should consider addressing this in the parser too. I understand the safety logic of never creating a bus number that PSSe can recognize but it makes a mess to write back
CKT = _psse_quote_string(CKT) | ||
R = PSY.get_r(branch) | ||
X = PSY.get_x(branch) | ||
B = 0.0 # TODO iron out the details of B vs. BI, BJ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those sections being
d5e054a
to
e60b2d9
Compare
63ce16f
to
93fd777
Compare
@jarry7 verifies that PSS/E can read the export as currently written under certain modes but not others. I'm going to merge this into the dev branch now to continue with Part 2 and readdress this later. |
This PR picks up the effort to implement a Sienna to PSS/E exporter, an effort started by @HaleyRoss here (see also my cleanup of that code to work with PSY4 here). Very much a draft for now, but I'll be building out a public interface to perform this export in the next few weeks.