Skip to content

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

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