Skip to content

Move in-line imports to top of files#542

Open
MridulS wants to merge 1 commit intoscipp:mainfrom
MridulS:imports_lazy
Open

Move in-line imports to top of files#542
MridulS wants to merge 1 commit intoscipp:mainfrom
MridulS:imports_lazy

Conversation

@MridulS
Copy link
Member

@MridulS MridulS commented Mar 6, 2026

Since lazy_loader was introduced in #405, modules are lazily loaded so deferred imports to avoid hard dependencies are no longer needed.

Closes #541

Did some rudimentary tests on import times, didn't see much affect as expected.

Since lazy_loader was introduced in scipp#405, modules are lazily loaded
so deferred imports to avoid hard dependencies are no longer needed.

Closes scipp#541

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
import warnings
from typing import Literal

import ipywidgets
Copy link
Member

Choose a reason for hiding this comment

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

Can you abbreviate ipywidgets to ipw?
That's what we do everywhere else in the code.

@@ -154,12 +155,6 @@ def _get_points_info(artist, figure):


def _make_points(**kwargs):
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, does this mean that we can do away with the entire function _make_points (and the like)?
The comment clearly states it's to avoid issues with dependency import?

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.

Move all in-line imports to the top

2 participants