Skip to content

Conversation

@thierry-martinez
Copy link
Contributor

This commit adds type annotations to visualization.py, along with its corresponding tests, enabling full type-checking with mypy while preserving existing functionality.

Related issue:
This PR continues the work started in #302, #308, and #312.

This commit adds type annotations to `visualization.py`, along with
its corresponding tests, enabling full type-checking with mypy while
preserving existing functionality.

**Related issue:**
This PR continues the work started in TeamGraphix#302, TeamGraphix#308, and TeamGraphix#312.
@codecov
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

❌ Patch coverage is 98.84393% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.86%. Comparing base (3eaaf44) to head (e5411f3).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
graphix/pattern.py 75.00% 1 Missing ⚠️
graphix/visualization.py 99.39% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #347      +/-   ##
==========================================
+ Coverage   79.52%   85.86%   +6.34%     
==========================================
  Files          41       42       +1     
  Lines        5793     5704      -89     
==========================================
+ Hits         4607     4898     +291     
+ Misses       1186      806     -380     

☔ 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.

@emlynsg emlynsg self-requested a review October 14, 2025 08:27
Copy link

Choose a reason for hiding this comment

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

Eventually we should update the docstrings for consistency too.

Copy link

@emlynsg emlynsg Oct 14, 2025

Choose a reason for hiding this comment

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

  • Do we want to change all the figsize variables to _Point = tuple[float, float] type?
  • Line 768 do we want to give a more descriptive ValueError?
  • Additional bug noticed in GraphVisualizer init . If no measurement planes input, generated measurement planes include measurements on output nodes. I will make an issue for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that even if figsize could formally be of type _Point, it makes sense to distinguish them since a size is semantically different than a point. The two other issues should have been fixed by the refactoring. Thanks!

Copy link

@emlynsg emlynsg left a comment

Choose a reason for hiding this comment

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

Happy to approve once comments are checked.

@thierry-martinez
Copy link
Contributor Author

I just refactored the visualization module: the behavior should be unchanged, and the code logic is the same, but I reduced code duplication and improved test coverage.

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