-
Notifications
You must be signed in to change notification settings - Fork 0
Adds ability to merge two IPPMs #503
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
base: main
Are you sure you want to change the base?
Conversation
- To do this I changes the named tuple to a class.
# Conflicts: # demos/demo_ippm.ipynb # kymata/io/atlas.py # kymata/io/json.py # kymata/ippm/graph.py # kymata/ippm/ippm.py
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
kymata/ippm/graph.py
Outdated
self_nodes = {node.node_id: node for node in self.graph_full.nodes()} | ||
other_nodes = {node.node_id: node for node in other.graph_full.nodes()} | ||
|
||
overlapping_node_ids = set(self_nodes.keys()) & set(other_nodes.keys()) |
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.
This is (GenAI) relying on the assumption that IPPMNode.__hash__()
is computed based only on the ID, which is (I think) no longer true as of upstream changes, and is (thus demonstrated) generally a fragile assumption. I will replace this check with general checks about overlapping transforms, which currently won't be supported.
… `IPPMGraph.serial_sequence` use `set`s of transforms, not `list`s
Still todo are checklist items in description |
kymata/ippm/graph.py
Outdated
combined_ctl = CandidateTransformList(combined_hierarchy) | ||
|
||
# Create new graph by directly merging NetworkX graphs | ||
merged_graph_full = DiGraph() |
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.
There should be no need to rebuild the graph from scratch when the graph-building logic is already in the IPPMGraph
constructor. I've rewritten this to reuse that. As a bonus, it's much shorter :) Needs review and testing.
Implements:
Tasks
CandidateTransformList
sIPPMGraph
sIPPM
s