Skip to content

Fix plot for model #794

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 1 commit into from
Jul 28, 2025
Merged

Fix plot for model #794

merged 1 commit into from
Jul 28, 2025

Conversation

AlexeyKozhevin
Copy link
Member

No description provided.

@AlexeyKozhevin AlexeyKozhevin requested a review from a team as a code owner July 24, 2025 11:07
@AlexeyKozhevin AlexeyKozhevin requested review from Copilot and removed request for a team July 24, 2025 11:07
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the import mechanism for the plot function in the torch base mixins module. The change replaces a conditional import using try_import with a direct import from the parent package.

  • Replaces conditional import with direct import for the plot function
  • Removes dependency on utils_import.try_import utility
  • Simplifies the import structure by using a direct relative import

from ...utils_import import try_import
plot = try_import(module='...plotter', package=__name__, attribute='plot',
help='Try `pip install batchflow[image]`!')
from ... import plot
Copy link
Preview

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

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

The change from conditional import to direct import removes the graceful fallback behavior. If the plot module is not available, this will now raise an ImportError instead of providing a helpful error message about installing 'batchflow[image]'. Consider whether this breaking change is intentional.

Copilot uses AI. Check for mistakes.

Copy link
Member Author

Choose a reason for hiding this comment

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

But plot from batchflow is already lazy import

@AlexeyKozhevin AlexeyKozhevin merged commit c86e586 into r0.9.2 Jul 28, 2025
1 check passed
@AlexeyKozhevin AlexeyKozhevin deleted the fix/model-plot branch July 28, 2025 18:07
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.

1 participant