From 7996e3d16a96e3586475cf9fa05f2508a8d9e699 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Tue, 10 Mar 2026 16:30:19 +0000 Subject: [PATCH] docs: add module docstrings to analysis package - Add module-level docstring to analysis/analysis.py describing the abstract Analysis class and its role in the inheritance hierarchy - Add module-level docstring to result.py explaining the Result class hierarchy and the galaxy-specific properties it provides Co-Authored-By: Claude Sonnet 4.6 --- autogalaxy/analysis/analysis/analysis.py | 15 +++++++++++++++ autogalaxy/analysis/result.py | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/autogalaxy/analysis/analysis/analysis.py b/autogalaxy/analysis/analysis/analysis.py index 2afd5978..daa42e3e 100644 --- a/autogalaxy/analysis/analysis/analysis.py +++ b/autogalaxy/analysis/analysis/analysis.py @@ -1,3 +1,18 @@ +""" +Abstract `Analysis` class providing shared functionality across all **PyAutoGalaxy** model-fitting analyses. + +This module provides `Analysis`, the root analysis class from which all dataset-specific analysis classes +inherit (`AnalysisImaging`, `AnalysisInterferometer`, `AnalysisEllipse`, `AnalysisQuantity`). + +`Analysis` itself inherits from `af.Analysis` (from **PyAutoFit**) and extends it with: + +- A cosmology instance (defaulting to Planck15). +- A `galaxies_via_instance_from` helper that extracts galaxies from a model instance, handling the + case where an `extra_galaxies` collection is also present. + +All subclasses call `super().__init__` to initialise the cosmology before implementing their own +`log_likelihood_function`. +""" import logging import numpy as np from typing import List, Optional diff --git a/autogalaxy/analysis/result.py b/autogalaxy/analysis/result.py index 36902073..0849c9ae 100644 --- a/autogalaxy/analysis/result.py +++ b/autogalaxy/analysis/result.py @@ -1,3 +1,18 @@ +""" +Result classes returned by **PyAutoGalaxy** model-fitting analyses. + +Each concrete analysis class (`AnalysisImaging`, `AnalysisInterferometer`, etc.) has a paired `Result*` +class (e.g. `ResultImaging`, `ResultInterferometer`) that inherits from the base `Result` class defined here. + +The `Result` class extends **PyAutoFit**'s `af.Result` with galaxy-specific convenience properties: + +- `max_log_likelihood_galaxies` — the list of galaxies at the maximum likelihood point. +- `path_galaxy_tuples` — (name, galaxy) pairs for inspecting which galaxy is which in the model. +- Adapt-image utilities for propagating model images between pipeline stages. + +Dataset-specific result classes (e.g. `ResultImaging`) additionally expose the maximum-likelihood fit +object (`max_log_likelihood_fit`) and other dataset-specific outputs. +""" from __future__ import annotations from typing import Dict, List, Optional, Tuple, Type, Union