Skip to content

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

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Conversation

neukym
Copy link
Member

@neukym neukym commented Jun 29, 2025

Implements:

combined_ippm = loudness_ippm + motion_ippm

Tasks

  • Merge CandidateTransformLists
  • Merge IPPMGraphs
  • Merge IPPMs
  • Fix notebook demo
  • Get tests to pass

- To do this I changes the named tuple to a class.
@neukym neukym self-assigned this Jun 29, 2025
neukym and others added 3 commits June 29, 2025 18:09
# Conflicts:
#	demos/demo_ippm.ipynb
#	kymata/io/atlas.py
#	kymata/io/json.py
#	kymata/ippm/graph.py
#	kymata/ippm/ippm.py
Copy link

codecov bot commented Jul 4, 2025

Codecov Report

Attention: Patch coverage is 4.34783% with 66 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
kymata/ippm/graph.py 1.75% 56 Missing ⚠️
kymata/ippm/ippm.py 16.66% 10 Missing ⚠️

📢 Thoughts on this report? Let us know!

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())
Copy link
Member

@caiw caiw Jul 11, 2025

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.

@caiw
Copy link
Member

caiw commented Jul 11, 2025

Still todo are checklist items in description

combined_ctl = CandidateTransformList(combined_hierarchy)

# Create new graph by directly merging NetworkX graphs
merged_graph_full = DiGraph()
Copy link
Member

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.

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

Successfully merging this pull request may close these issues.

2 participants