-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Convert the FERC exploded forest to a table for readability #2832
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I cancelled the CI since it was already failing. And the failure is on GitHub's side. Some issue with actions right now sitewide. |
8 tasks
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## explode_tree_fixes #2832 +/- ##
====================================================
- Coverage 88.6% 88.4% -0.3%
====================================================
Files 90 90
Lines 10791 10825 +34
====================================================
+ Hits 9569 9572 +3
- Misses 1222 1253 +31
☔ View full report in Codecov by Sentry. 📢 Have feedback on the report? Share it here. |
For more information, see https://pre-commit.ci
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Overview
This PR adds a few methods to the forest class that converts a forest's relationships into a big ol table. Starting from the seed node, I grab that nodes' direct children and merge those children with their direct parents. I used
_level{n}
to indicate which step in the tree the nodes refer to.I decided to use the
calculation_components_ferc1
as the core building blocks of the table instead of just using a decomposed forest. I think using only a forest could have done the job just fine, but I thought it would a) be a nice check on the forest and b) be slightly more straightforward bc the calc components table is already a table. Using the calc components table, each time you want to get a level of parent/child connections from the calc comps table I first select for the parent nodes and then select the child nodes from that subset of the table. This way you never get parents records that have children that got pruned from the forest and you never have children records that refer to a different parent.Once the subset of the calc components table is selected each round, a new set of
_level{n+1}
nodes gets merged onto their_level{n}
parents.Other notes:
weight
of the children for every level.PR Checklist
dev
).