Skip to content

perf: remove unused astropy.modeling import from convert.py#331

Merged
Jammy2211 merged 1 commit intomainfrom
feature/remove-unused-astropy-import
Apr 7, 2026
Merged

perf: remove unused astropy.modeling import from convert.py#331
Jammy2211 merged 1 commit intomainfrom
feature/remove-unused-astropy-import

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Remove two unused imports from autogalaxy/convert.py: from astropy.modeling import InputParameterError and from docutils.io import InputError. Neither symbol is used anywhere in the file, but the astropy import pulls in the entire astropy.modeling stack (including astropy.nddatadask.array → cupy probe), adding ~1.2s to import time.

Part of PyAutoLabs/PyAutoLens#426.

API Changes

None — internal changes only.

Test Plan

  • pytest test_autogalaxy/ -x — 811 passed (tested with lazy-imports changes)
  • Import time: 2.17s → 1.37s (removes the single largest remaining cost)
Full API Changes (for automation & release notes)

Removed (internal only)

  • Unused from astropy.modeling import InputParameterError in autogalaxy/convert.py
  • Unused from docutils.io import InputError in autogalaxy/convert.py

🤖 Generated with Claude Code

The `from astropy.modeling import InputParameterError` and
`from docutils.io import InputError` imports were unused but pulled in
the entire astropy.modeling stack (including dask.array and a cupy
probe), adding ~1.2s to import time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Jammy2211 Jammy2211 merged commit c179685 into main Apr 7, 2026
2 checks passed
@Jammy2211 Jammy2211 deleted the feature/remove-unused-astropy-import branch April 7, 2026 17:44
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