From 6da9edc466761b6e169b9be398083964de65527b Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Tue, 10 Mar 2026 19:51:25 +0000 Subject: [PATCH] docs(quantity): add module-level docstrings to quantity package Add module-level docstrings to fit_quantity.py (FitQuantity: comparing derived lensing quantities across different Tracer models) and model/analysis.py (AnalysisQuantity: Bayesian model comparison of lensing quantities). Co-Authored-By: Claude Sonnet 4.6 --- autolens/quantity/fit_quantity.py | 17 +++++++++++++++++ autolens/quantity/model/analysis.py | 11 +++++++++++ 2 files changed, 28 insertions(+) diff --git a/autolens/quantity/fit_quantity.py b/autolens/quantity/fit_quantity.py index c0686af65..2a3c796be 100644 --- a/autolens/quantity/fit_quantity.py +++ b/autolens/quantity/fit_quantity.py @@ -1,3 +1,20 @@ +""" +Quantity fit class for comparing derived lensing quantities across different models. + +``FitQuantity`` extends the ``autogalaxy`` base class to accept a ``Tracer`` as the +model object. It fits a ``DatasetQuantity`` (e.g. a 2D convergence map, deflection +angle map, or potential map) with the corresponding quantity derived from a tracer. + +Typical use cases include: + +- Comparing the convergence of a power-law mass profile with that of an NFW profile on + the same grid, to quantify how well one approximates the other. +- Fitting deflection angles computed by one lens model to those of another model, to + propagate uncertainties from a parametric fit into a more complex model. + +The ``AnalysisQuantity`` class uses ``FitQuantity`` as its evaluation engine when +performing a Bayesian model fit via a non-linear search. +""" import autogalaxy as ag from autogalaxy.quantity.dataset_quantity import DatasetQuantity diff --git a/autolens/quantity/model/analysis.py b/autolens/quantity/model/analysis.py index a184db72c..5fb626344 100644 --- a/autolens/quantity/model/analysis.py +++ b/autolens/quantity/model/analysis.py @@ -1,3 +1,14 @@ +""" +Analysis class for fitting a ``Tracer`` model to a derived lensing quantity dataset. + +``AnalysisQuantity`` combines the ``autogalaxy`` quantity analysis with +``AnalysisLens`` so that a ``Tracer`` is used to evaluate the derived quantity +(e.g. convergence, deflection angles, potential) being fitted. + +It is used for model comparison workflows where two different mass profile families +(e.g. power-law vs. NFW) are compared by fitting one's predicted lensing quantity to +the other's, with a noise-map providing the figure-of-merit. +""" import numpy as np import autofit as af