Add parsing of multi-terminal DC lines #43
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
there's a reason i left this til last... 😂 so it turns out "multi-terminal DC line" data is about as wild as "transformers" data, but in a wholey different way.
Originally i thought this PSSE / power flow data format was like a bunch of CSV files appended together, each with a different schema.
i.e. each "section" would be made up of an arbitrary number of rows, but the rows would have a fixed, documented, known number of columns.
But it turns out some sections have variable number of columns (not "empty cells" like you might have in a CSV, but just no representation in the file that there are columns with no data). So basically rows in the same section can have different schemas. E.g. Shunts, Impedance Corrections, and maybe others (i'll need to go back and review)
And then it turns out in some sections each "row" is actually multiple lines of data, so to read one "record" you actually have to read multiple lines.
[aside: Also the manual i have (apart from being really old) is really inconsistent about how it uses the work "record", sometimes using it to mean a line in the data and sometimes a whole row-like-thing that may actually be multiple rows (so a records might be made up of 3 records 😆)]
The Transformers data is still the maddest.. combining "multiple lines" with "schema changes" (#17)
But multi-terminal DC lines are fun too! Each entry (what this package calls a "record") is kinda like its own little file:
and then there may be another entry like this or not
trying to find PSSE files in the wild is kinda difficult, but i couldn't find any that actually contain "multi-terminal DC lines"
And i'm not aware of any other parsers that support parsing multi-terminal DC lines
so this was probably just a fun exercise
anyway, here it is
Also i slightly feel like there's 1 or 2 many layers of nesting going on in the solution in this PR... but i'll review with a fresh mind tomorrow