Skip to content

Feature/remove preloads#283

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

Feature/remove preloads#283
Jammy2211 merged 2 commits intomainfrom
feature/remove_preloads

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

This pull request primarily removes the use of the Preloads object and associated logic from the autogalaxy codebase. This results in a significant simplification of the initialization and fitting logic across multiple modules, eliminating parameters and code paths related to preloading mesh grids and other precomputed data. The changes also update a test to explicitly specify the number of pixels in a mesh, likely to maintain test stability after the removal of preloads.

Core simplifications and removals:

  • Removed all references to aa.Preloads and the preloads parameter from constructors and method calls in major modules, including analysis.py, dataset.py, to_inversion.py, fit_imaging.py, fit_interferometer.py, and their respective model analysis files. This includes both the passing of preloads and any logic or documentation related to it. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25]

  • Removed the import of Preloads and related utilities from the package’s __init__.py file, further decoupling the codebase from preloading mechanisms.

Aggregator and utility logic updates:

  • Simplified the mesh_grids_of_planes_list_from function in agg_util.py by removing the use_preloaded_grid parameter and all logic related to loading precomputed mesh grids, as well as removing the now-obsolete preloads_from function. [1] [2]

Test update:

  • Updated a test in test_galaxy.py to explicitly set the pixels parameter in a Delaunay mesh, likely to ensure deterministic behavior after the removal of preloads.

Copy link
Copy Markdown
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 pull request removes the Preloads object and all associated preloading infrastructure from the autogalaxy codebase. This is a significant refactoring that simplifies the initialization and fitting logic across multiple modules by eliminating parameters and code paths related to preloading mesh grids and other precomputed data. The change reduces complexity while maintaining the ability to load precomputed mesh grids from fit objects when needed via the aggregator utilities.

Changes:

  • Removed all references to aa.Preloads and the preloads parameter from constructors, method calls, and attributes across major modules including analysis, fit, and inversion classes
  • Simplified the mesh_grids_of_planes_list_from function by removing the use_preloaded_grid parameter, making it always attempt to load preloaded grids when available
  • Removed the preloads_from function and associated imports from the package, completely decoupling the codebase from the preloading mechanism
  • Updated a test to explicitly specify pixels=9 in a Delaunay mesh for deterministic behavior

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
autogalaxy/analysis/analysis/analysis.py Removed preloads parameter and attribute from base Analysis class
autogalaxy/analysis/analysis/dataset.py Removed preloads parameter from AnalysisDataset constructor call chain
autogalaxy/imaging/model/analysis.py Removed preloads parameter from AnalysisImaging constructor and fit_from method, updated docstring
autogalaxy/imaging/fit_imaging.py Removed preloads parameter and attribute from FitImaging class
autogalaxy/interferometer/model/analysis.py Removed preloads parameter from AnalysisInterferometer constructor and fit_from method, updated docstring
autogalaxy/interferometer/fit_interferometer.py Removed preloads parameter and attribute from FitInterferometer class
autogalaxy/galaxy/to_inversion.py Removed preloads parameter and attribute from AbstractToInversion and GalaxiesToInversion classes, eliminated preloads from all mapper and inversion creation calls
autogalaxy/aggregator/agg_util.py Simplified mesh_grids_of_planes_list_from to always load preloaded grids when available; removed preloads_from function entirely
autogalaxy/__init__.py Removed imports of Preloads and mapper_indices_from from autoarray
test_autogalaxy/galaxy/test_galaxy.py Added explicit pixels=9 parameter to Delaunay mesh in JSON serialization test for deterministic behavior

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

@Jammy2211 Jammy2211 merged commit da9b84a into main Feb 25, 2026
8 of 12 checks passed
@Jammy2211 Jammy2211 deleted the feature/remove_preloads branch April 2, 2026 11:43
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