Skip to content

refactor: future-annotations headers for lazy aggregator imports - #705

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/lazy-heavy-imports
Aug 19, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/lazy-heavy-imports

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Part of the cross-repo import-time task (PyAutoFit#1505). Same one-line change as the PyAutoGalaxy PR: three aggregator modules evaluate af.Aggregator / af.GridSearchAggregator in def-time annotations, re-triggering the sqlalchemy/database import the task defers. from __future__ import annotations headers in aggregator/fit_imaging.py, aggregator/fit_interferometer.py, aggregator/subhalo.py make them lazy strings. Net cross-repo result: import autolens 4.07s → ~2.1s with jax, blackjax, optax, nufftax, IPython, sqlalchemy, numba and astropy all absent from the bare import tree.

API Changes

None — internal changes only (annotation evaluation semantics in three modules).
See full details below.

Test Plan

  • Full suite: 538 passed against the sibling branches
  • python -X importtime -c "import autolens" heavy-module grep: zero hits
  • autolens_workspace smoke 37/37; autolens_workspace_test 20/24 — identical to canonical main (the 4 jax_likelihood pin failures are pre-existing; control-tested, see PyAutoFit#1505)
Full API Changes (for automation & release notes)

Changed Behaviour

  • None — from __future__ import annotations added to three aggregator modules; annotations become lazy strings (PEP 563), no runtime introspection of them exists.

Migration

  • None required.

Generated by the PyAutoLabs agent workflow.

… (PyAutoFit#1505)

Three aggregator modules evaluated af.Aggregator/af.GridSearchAggregator in
def-time annotations, re-triggering the sqlalchemy/database import the
import-time task defers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Aug 19, 2026
@Jammy2211
Jammy2211 merged commit 49a8c35 into main Aug 19, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/lazy-heavy-imports branch August 19, 2026 22:01
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 2026
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