From 017dd2d80bd51b6e4bc3cdca360d6187106f13a3 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Thu, 30 Jul 2026 11:03:14 +0100 Subject: [PATCH] docs: fix dead internal references in script docstrings The README half of this drift class is fixed and now gated at PR time (PyAutoHands#213). This is the remaining surface: dead file/folder references in scripts/**/*.py docstrings and comments, which the gate deliberately does not cover. Driven by `pyauto-brain hygiene refs --json`, which reported 129 findings across 7 repos. Verified classes: - log_likelihood_function -> likelihood_function (the scripts drop the log_) - notation/label.yaml -> notation.yaml (config went folder -> file) - config/generag.yaml -> config/general.yaml (autolens->autogalaxy clone residue, here in script prose) - autofit_workspace/*/plots -> plot (the package is singular) - feature/pixelization/... -> features/ ; subhalo/detection -> detect - guides/source_science -> the topic packages (source_science.py lives in imaging/, interferometer/, group/ -- never guides/) - preprocess / propocess -> imaging/data_preparation - modeling/imaging/{customize,searches} -> guides/modeling/... - imaging/advanced/database -> guides/results/database - simulators -> simulator (singular) - dataset directories quoted without their `dataset/` prefix -- the folder is written by a simulator, so the fix is qualification, not a restore Eleven needed prose rewriting rather than a re-point, because the target does not exist in any form: autogalaxy has no CPU-fast pixelization example (now points at the autolens one), point_source has no likelihood_function walkthrough (points at cluster/likelihood_function, titled "Log Likelihood Function: Cluster Point Source"), no subhalo/detect/examples folder exists, mat_wrap.yaml was retired in favour of general.yaml, config/priors has no `default` subfolder, and z_projects/ is not part of this workspace (the Euclid pipeline has its own repo). Notebooks and the navigator catalogue regenerated, since docstring text feeds notebooks/, llms-full.txt and workspace_index.json. Verified: hygiene refs reports 0 findings across all 7 repos (from 129), and check_navigator.py --banners=fail passes on all 6 gated repos. Co-Authored-By: Claude Opus 5 --- .../chapter_1_introduction/start_here.ipynb | 2 +- .../tutorial_5_results_and_samples.ipynb | 4 +- scripts/chapter_1_introduction/start_here.py | 110 +++++++++--------- .../tutorial_5_results_and_samples.py | 4 +- workspace_index.json | 2 +- 5 files changed, 61 insertions(+), 61 deletions(-) diff --git a/notebooks/chapter_1_introduction/start_here.ipynb b/notebooks/chapter_1_introduction/start_here.ipynb index 84063eb..40c5f77 100644 --- a/notebooks/chapter_1_introduction/start_here.ipynb +++ b/notebooks/chapter_1_introduction/start_here.ipynb @@ -55,7 +55,7 @@ "\n", "An applied astronomy-focused example (previously tutorial 8) now lives in\n", "`autofit_workspace_developer/scripts/howtofit/chapter_1_introduction/tutorial_8_astronomy_example.py`,\n", - "alongside the larger `projects/cosmology/` example. These depend on astronomy-specific datasets\n", + "alongside the larger `autofit_workspace_developer/projects/cosmology/` example. These depend on astronomy-specific datasets\n", "that only live in the developer workspace." ] }, diff --git a/notebooks/chapter_1_introduction/tutorial_5_results_and_samples.ipynb b/notebooks/chapter_1_introduction/tutorial_5_results_and_samples.ipynb index 198311c..efcf380 100644 --- a/notebooks/chapter_1_introduction/tutorial_5_results_and_samples.ipynb +++ b/notebooks/chapter_1_introduction/tutorial_5_results_and_samples.ipynb @@ -10,7 +10,7 @@ "In this tutorial, we'll cover all of the output that comes from a non-linear search's `Result` object.\n", "\n", "We used this object at various points in the chapter. The bulk of material covered here is described in the example\n", - "script `autofit_workspace/overview/simple/result.py`. Nevertheless, it is a good idea to refresh ourselves about how\n", + "script `autofit_workspace/*/cookbooks/result.py`. Nevertheless, it is a good idea to refresh ourselves about how\n", "results in **PyAutoFit** work before covering more advanced material.\n", "\n", "__Contents__\n", @@ -993,7 +993,7 @@ "\n", "By combining this with the filtering tools below, specific parameters can be included or removed from the latex.\n", "\n", - "Remember that the superscripts of a parameter are loaded from the config file `notation/label.yaml`, providing high\n", + "Remember that the superscripts of a parameter are loaded from the config file `notation.yaml`, providing high\n", "levels of customization for how the parameter names appear in the latex table. This is especially useful if your model\n", "uses the same model components with the same parameter, which therefore need to be distinguished via superscripts." ] diff --git a/scripts/chapter_1_introduction/start_here.py b/scripts/chapter_1_introduction/start_here.py index 04fd5f2..e2d4d5e 100644 --- a/scripts/chapter_1_introduction/start_here.py +++ b/scripts/chapter_1_introduction/start_here.py @@ -1,55 +1,55 @@ -""" -HowToFit Lectures -================= - -Welcome to the HowToFit Jupyter Notebook lectures! - -At the core of data science is fitting a model to data. This process extracts meaningful patterns, relationships, -and insights, enabling accurate predictions, decision-making, and understanding of underlying processes. - -However, data science can be quite challenging. With a vast array of statistical methods to choose from, it can be -difficult to determine the right one for your problem. Interpreting large volumes of results is complex, and managing big datasets requires significant computational power and sophisticated statistical methods. - -The HowToFit lectures teach you how to perform effective data science analysis. Designed at an undergraduate level, -these lectures assume no prior knowledge of model-fitting, Bayesian statistics, or scientific analysis. They -introduce core concepts without formal statistical equations, aiming to provide an understanding of the -phenomenological methods used in data science. By the end of the lectures, you'll be equipped to perform your own -data analysis. - -The lectures use the probabilistic programming language PyAutoFit, an open-source library for model-fitting, -scientific analysis, and big data analysis (https://github.com/PyAutoLabs/PyAutoFit). - -The HowToFit lectures are composed of 3 chapters: - -**Chapter 1: Introduction**: How to fit a model to data, perform statistical inference, and interpret the results -for scientific analysis. - -**Chapter 2: Scientific Workflow**: Scaling model-fitting to big datasets while ensuring detailed scientific analysis -of the results. - -**Chapter 3: Graphical Models**: Simultaneous model fitting of large datasets, scaling up to models with tens of -thousands of parameters. - -After each chapter, it is advised that you apply what you've learned to your own model-fitting analysis based on -your scientific problem to build confidence in the techniques. Once confident, proceed to the next chapter. - -__Chapter 1: Introduction__ - -The first chapter of the HowToFit lectures covers the basics of model-fitting, statistical inference, and scientific -interpretation. The chapter includes: - -`tutorial_1_models.py`: What probabilistic models are and how to compose them using PyAutoFit. - -`tutorial_2_fitting_data.py`: Fitting a model with an input set of parameters to data and quantifying the goodness of fit. - -`tutorial_3_non_linear_search.py`: Searching non-linear parameter spaces to find the best-fit model. - -`tutorial_4_why_modeling_is_hard.py`: Why modeling becomes difficult and how to over model-fitting problems. - -`tutorial_5_results_and_samples.py`: Interpreting model-fit results and using the samples for scientific analysis. - -An applied astronomy-focused example (previously tutorial 8) now lives in -`autofit_workspace_developer/scripts/howtofit/chapter_1_introduction/tutorial_8_astronomy_example.py`, -alongside the larger `projects/cosmology/` example. These depend on astronomy-specific datasets -that only live in the developer workspace. -""" +""" +HowToFit Lectures +================= + +Welcome to the HowToFit Jupyter Notebook lectures! + +At the core of data science is fitting a model to data. This process extracts meaningful patterns, relationships, +and insights, enabling accurate predictions, decision-making, and understanding of underlying processes. + +However, data science can be quite challenging. With a vast array of statistical methods to choose from, it can be +difficult to determine the right one for your problem. Interpreting large volumes of results is complex, and managing big datasets requires significant computational power and sophisticated statistical methods. + +The HowToFit lectures teach you how to perform effective data science analysis. Designed at an undergraduate level, +these lectures assume no prior knowledge of model-fitting, Bayesian statistics, or scientific analysis. They +introduce core concepts without formal statistical equations, aiming to provide an understanding of the +phenomenological methods used in data science. By the end of the lectures, you'll be equipped to perform your own +data analysis. + +The lectures use the probabilistic programming language PyAutoFit, an open-source library for model-fitting, +scientific analysis, and big data analysis (https://github.com/PyAutoLabs/PyAutoFit). + +The HowToFit lectures are composed of 3 chapters: + +**Chapter 1: Introduction**: How to fit a model to data, perform statistical inference, and interpret the results +for scientific analysis. + +**Chapter 2: Scientific Workflow**: Scaling model-fitting to big datasets while ensuring detailed scientific analysis +of the results. + +**Chapter 3: Graphical Models**: Simultaneous model fitting of large datasets, scaling up to models with tens of +thousands of parameters. + +After each chapter, it is advised that you apply what you've learned to your own model-fitting analysis based on +your scientific problem to build confidence in the techniques. Once confident, proceed to the next chapter. + +__Chapter 1: Introduction__ + +The first chapter of the HowToFit lectures covers the basics of model-fitting, statistical inference, and scientific +interpretation. The chapter includes: + +`tutorial_1_models.py`: What probabilistic models are and how to compose them using PyAutoFit. + +`tutorial_2_fitting_data.py`: Fitting a model with an input set of parameters to data and quantifying the goodness of fit. + +`tutorial_3_non_linear_search.py`: Searching non-linear parameter spaces to find the best-fit model. + +`tutorial_4_why_modeling_is_hard.py`: Why modeling becomes difficult and how to over model-fitting problems. + +`tutorial_5_results_and_samples.py`: Interpreting model-fit results and using the samples for scientific analysis. + +An applied astronomy-focused example (previously tutorial 8) now lives in +`autofit_workspace_developer/scripts/howtofit/chapter_1_introduction/tutorial_8_astronomy_example.py`, +alongside the larger `autofit_workspace_developer/projects/cosmology/` example. These depend on astronomy-specific datasets +that only live in the developer workspace. +""" diff --git a/scripts/chapter_1_introduction/tutorial_5_results_and_samples.py b/scripts/chapter_1_introduction/tutorial_5_results_and_samples.py index a126999..2f47cb5 100644 --- a/scripts/chapter_1_introduction/tutorial_5_results_and_samples.py +++ b/scripts/chapter_1_introduction/tutorial_5_results_and_samples.py @@ -5,7 +5,7 @@ In this tutorial, we'll cover all of the output that comes from a non-linear search's `Result` object. We used this object at various points in the chapter. The bulk of material covered here is described in the example -script `autofit_workspace/overview/simple/result.py`. Nevertheless, it is a good idea to refresh ourselves about how +script `autofit_workspace/*/cookbooks/result.py`. Nevertheless, it is a good idea to refresh ourselves about how results in **PyAutoFit** work before covering more advanced material. __Contents__ @@ -678,7 +678,7 @@ def model_data_from(self, xvalues: np.ndarray): By combining this with the filtering tools below, specific parameters can be included or removed from the latex. -Remember that the superscripts of a parameter are loaded from the config file `notation/label.yaml`, providing high +Remember that the superscripts of a parameter are loaded from the config file `notation.yaml`, providing high levels of customization for how the parameter names appear in the latex table. This is especially useful if your model uses the same model components with the same parameter, which therefore need to be distinguished via superscripts. """ diff --git a/workspace_index.json b/workspace_index.json index 0db3b26..c328c50 100644 --- a/workspace_index.json +++ b/workspace_index.json @@ -130,7 +130,7 @@ "Latex" ], "cross_refs": [ - "autofit_workspace/overview/simple/result.py", + "/cookbooks/result.py", "corner.py" ], "notebook": "notebooks/chapter_1_introduction/tutorial_5_results_and_samples.ipynb",