Skip to content

perf: lazy-load plotting functions, drop unused seaborn dependency#2

Merged
Arvindiyer merged 1 commit into
mainfrom
feature/complete-selectsim-py
Jul 14, 2026
Merged

perf: lazy-load plotting functions, drop unused seaborn dependency#2
Arvindiyer merged 1 commit into
mainfrom
feature/complete-selectsim-py

Conversation

@Arvindiyer

Copy link
Copy Markdown
Member
  • selectsim/init.py eagerly imported selectsim.plotting at package import time, which pulls in matplotlib and scipy (used nowhere outside plotting.py) even for callers who only call selectX() and never plot anything. Plotting functions (obs_exp_scatter, ridge_plot_ed, oncoprint, etc.) are now resolved lazily on first access via a PEP 562 module getattr instead -- same ss. usage, just deferred. Measured: import selectsim dropped from ~1.5s to ~0.6s.

  • Also drops the seaborn dependency: it was listed in pyproject.toml and mentioned in a couple of docstrings, but grep confirms it was never actually imported or used anywhere in the codebase. Updated the introduction tutorial's Session info cell to match (it printed seaborn.version).

Bumped to 0.3.1; full test suite (148 tests) and the tutorial notebook both verified as passing after the change.

selectsim/__init__.py eagerly imported selectsim.plotting at package
import time, which pulls in matplotlib and scipy (used nowhere outside
plotting.py) even for callers who only call selectX() and never plot
anything. Plotting functions (obs_exp_scatter, ridge_plot_ed, oncoprint,
etc.) are now resolved lazily on first access via a PEP 562 module
__getattr__ instead -- same ss.<name> usage, just deferred. Measured:
`import selectsim` dropped from ~1.5s to ~0.6s.

Also drops the seaborn dependency: it was listed in pyproject.toml and
mentioned in a couple of docstrings, but grep confirms it was never
actually imported or used anywhere in the codebase. Updated the
introduction tutorial's Session info cell to match (it printed
seaborn.__version__).

Bumped to 0.3.1; full test suite (148 tests) and the tutorial notebook
both verified passing after the change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018g7ADBXHN2yWDkf2NPyNm3
@Arvindiyer Arvindiyer merged commit f48fff7 into main Jul 14, 2026
3 checks passed
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