Skip to content

Conversation

@matulni
Copy link
Contributor

@matulni matulni commented Nov 25, 2025

This commit adapts the existing method :func: OpenGraph.isclose to the new API introduced in #358.
Additionally, it introduces a new method :func: OpenGraph.__eq__ relevant for open graphs of parametric type graphix.fundamentals.Plane or graphix.fundamentals.Axis.

@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.31%. Comparing base (8d9a477) to head (c4fe9b8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #374      +/-   ##
==========================================
+ Coverage   86.25%   86.31%   +0.05%     
==========================================
  Files          44       44              
  Lines        6161     6166       +5     
==========================================
+ Hits         5314     5322       +8     
+ Misses        847      844       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matulni matulni changed the title Refactor of flow tools - OpenGraph comparison. Refactor of flow tools - OpenGraph.isclose Nov 25, 2025
Comment on lines 452 to 456
if not nx.utils.graphs_equal(og_1.graph, og_2.graph):
return False

if og_1.input_nodes != og_2.input_nodes or og_1.output_nodes != og_2.output_nodes:
return False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if not nx.utils.graphs_equal(og_1.graph, og_2.graph):
return False
if og_1.input_nodes != og_2.input_nodes or og_1.output_nodes != og_2.output_nodes:
return False
return (
nx.utils.graphs_equal(og_1.graph, og_2.graph)
and og_1.input_nodes == og_2.input_nodes
and og_1.output_nodes == og_2.output_nodes
)

Copy link
Collaborator

@thierry-martinez thierry-martinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! All the changes in this PR are included in #375, right? In that case, you can either merge this PR first and then #375, or just drop this PR and merge only #375. I would say it mainly depends on which PR receives the second approval first!

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