Skip to content

📈streamline-network-and-si-grap-plot #349

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

Merged
merged 33 commits into from
May 27, 2025

Conversation

heinzll
Copy link
Collaborator

@heinzll heinzll commented Mar 22, 2025

This pull request introduces several updates to streamline the network_plot function, improve modularity, and enhance test coverage. The most significant changes involve refactoring the network_plot implementation to delegate functionality to si_graph_plot, simplifying its interface, and adding utility functions for better reusability.

Refactoring and Simplification:

  • shapiq/plot/network.py: Refactored the network_plot function to delegate most of its functionality to si_graph_plot, removing redundant code and simplifying the function's interface. Several arguments, such as first_order_values, second_order_values, and feature_image_patches, were removed, and a generic **kwargs was introduced to pass additional parameters. [1] [2] [3]

Dependency Updates:

  • pyproject.toml: Added pillow as a dependency to support image processing functionality.

Utility Enhancements:

  • shapiq/plot/utils.py: Added a new utility function add_image_in_center to handle the addition of images in the center of plots, improving reusability and modularity.

Testing Improvements:

  • tests/conftest.py: Introduced a new pytest fixture, example_values, to provide reusable interaction values for testing.
  • tests/tests_plots/test_network_plot.py: Removed redundant tests for network_plot that relied on now-deprecated arguments and added reliance on InteractionValues objects for testing. [1] [2]

Code Cleanup:

  • shapiq/plot/network.py: Removed unused imports and large blocks of obsolete code related to graph construction and legend management.

@heinzll heinzll marked this pull request as ready for review March 22, 2025 08:00
@heinzll heinzll closed this Mar 26, 2025
@heinzll heinzll reopened this Mar 26, 2025
@mmschlk mmschlk changed the title streamline-network-and-si-grap-plot 📈streamline-network-and-si-grap-plot May 27, 2025
@mmschlk mmschlk self-requested a review May 27, 2025 13:57
Copy link
Owner

@mmschlk mmschlk left a comment

Choose a reason for hiding this comment

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

Amazing @heinzll! :)

@mmschlk mmschlk merged commit 84c0b43 into main May 27, 2025
7 checks passed
@mmschlk mmschlk deleted the streamline-network-and-si-grap-plot branch May 27, 2025 14:00
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