Skip to content

Feature/remove preloads#390

Merged
Jammy2211 merged 4 commits intomainfrom
feature/remove_preloads
Feb 25, 2026
Merged

Feature/remove preloads#390
Jammy2211 merged 4 commits intomainfrom
feature/remove_preloads

Conversation

@Jammy2211
Copy link
Owner

This pull request removes support for passing and handling the Preloads object throughout the autolens codebase. All references to preloads have been removed from constructors, function calls, and tests. The changes simplify the API and internal logic by eliminating the need to manage preloading of mapper indices and related data structures.

The most important changes are:

API and Internal Logic Simplification:

  • Removed the preloads parameter from constructors and method calls in key classes and functions, including FitImaging, FitInterferometer, TracerToInversion, and related analysis/model classes (autolens/imaging/fit_imaging.py, autolens/interferometer/fit_interferometer.py, autolens/lens/to_inversion.py, autolens/analysis/analysis/dataset.py, autolens/imaging/model/analysis.py, autolens/interferometer/model/analysis.py). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]

  • Removed the import and usage of Preloads and mapper_indices_from from the main package initialization (autolens/__init__.py).

Test Updates:

  • Refactored tests in test_autolens/imaging/test_simulate_and_fit_imaging.py to remove all usage of the Preloads object and related manual setup, updating assertions and test logic accordingly. [1] [2] [3] [4] [5]

Behavioral Adjustments:

  • Updated pixelization and settings in tests to use new parameters instead of relying on preloaded indices, and adjusted expected results to match the new logic. [1] [2]

These changes collectively modernize the codebase and make it easier to maintain by removing legacy preloading mechanisms.

Copy link
Contributor

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 removes the Preloads mechanism from the PyAutoLens API surface and internal fit/inversion construction flow, simplifying how fits are created and configured.

Changes:

  • Removed preloads parameters and plumbing from FitImaging, FitInterferometer, TracerToInversion, and analysis classes.
  • Stopped exporting Preloads / mapper_indices_from from autolens.__init__.
  • Updated imaging simulation / fit tests to no longer build or pass Preloads, adjusting pixelization/settings and expected results accordingly.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
autolens/imaging/fit_imaging.py Removes preloads argument/storage and stops passing it into inversion setup.
autolens/interferometer/fit_interferometer.py Removes preloads argument/storage and stops passing it into inversion setup.
autolens/lens/to_inversion.py Removes preloads from constructor and downstream galaxy/inversion construction calls.
autolens/imaging/model/analysis.py Removes preloads forwarding when creating FitImaging.
autolens/interferometer/model/analysis.py Removes preloads forwarding when creating FitInterferometer.
autolens/analysis/analysis/dataset.py Removes preloads from analysis dataset initialization/plumbing.
autolens/__init__.py Removes top-level exports of Preloads and mapper_indices_from.
test_autolens/imaging/test_simulate_and_fit_imaging.py Refactors tests to eliminate Preloads usage and updates expectations/settings accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Jammy2211 Jammy2211 merged commit 219a830 into main Feb 25, 2026
4 of 8 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.

2 participants