From 3b9113c2b30e9e91db72e2b13d6508adb27c97b9 Mon Sep 17 00:00:00 2001 From: Lukas Beiske Date: Tue, 24 Oct 2023 16:11:00 +0200 Subject: [PATCH 1/4] Add docstring for ctapipe-train-disp-reconstructor --- ctapipe/tools/train_disp_reconstructor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ctapipe/tools/train_disp_reconstructor.py b/ctapipe/tools/train_disp_reconstructor.py index 5953bda8038..e4faa6b62c4 100644 --- a/ctapipe/tools/train_disp_reconstructor.py +++ b/ctapipe/tools/train_disp_reconstructor.py @@ -1,3 +1,6 @@ +""" +Tool for training the DispReconstructor +""" import astropy.units as u import numpy as np From b1a726492b3a53a546867c276844cd92468bed02 Mon Sep 17 00:00:00 2001 From: Lukas Beiske Date: Tue, 24 Oct 2023 16:16:50 +0200 Subject: [PATCH 2/4] Add changelog --- docs/changes/2420.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/changes/2420.bugfix.rst diff --git a/docs/changes/2420.bugfix.rst b/docs/changes/2420.bugfix.rst new file mode 100644 index 00000000000..aa21eafa4fb --- /dev/null +++ b/docs/changes/2420.bugfix.rst @@ -0,0 +1 @@ +Add docstring for ``ctapipe-train-disp-reconstructor``. From ff533e30821932ff6709f0640a95cfc12f19b4fa Mon Sep 17 00:00:00 2001 From: Lukas Beiske Date: Fri, 27 Oct 2023 18:08:59 +0200 Subject: [PATCH 3/4] Add disp train tool to sphinx docs --- ctapipe/tools/train_disp_reconstructor.py | 4 ++++ docs/api-reference/tools/index.rst | 3 +++ 2 files changed, 7 insertions(+) diff --git a/ctapipe/tools/train_disp_reconstructor.py b/ctapipe/tools/train_disp_reconstructor.py index e4faa6b62c4..7dfc8504977 100644 --- a/ctapipe/tools/train_disp_reconstructor.py +++ b/ctapipe/tools/train_disp_reconstructor.py @@ -11,6 +11,10 @@ from ctapipe.reco import CrossValidator, DispReconstructor from ctapipe.reco.preprocessing import check_valid_rows, horizontal_to_telescope +__all__ = [ + "TrainDispReconstructor", +] + class TrainDispReconstructor(Tool): """ diff --git a/docs/api-reference/tools/index.rst b/docs/api-reference/tools/index.rst index 0d1c2dc8e6d..e9e9823e253 100644 --- a/docs/api-reference/tools/index.rst +++ b/docs/api-reference/tools/index.rst @@ -93,5 +93,8 @@ Reference/API .. automodapi:: ctapipe.tools.train_particle_classifier :no-inheritance-diagram: +.. automodapi:: ctapipe.tools.train_disp_reconstructor + :no-inheritance-diagram: + .. automodapi:: ctapipe.tools.apply_models :no-inheritance-diagram: From f34eb6fffa9a072ba897840402565b59df9fd525 Mon Sep 17 00:00:00 2001 From: Lukas Beiske Date: Fri, 27 Oct 2023 18:52:45 +0200 Subject: [PATCH 4/4] Fix docstrings for disp train tool --- ctapipe/tools/train_disp_reconstructor.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ctapipe/tools/train_disp_reconstructor.py b/ctapipe/tools/train_disp_reconstructor.py index 7dfc8504977..784d68a6a18 100644 --- a/ctapipe/tools/train_disp_reconstructor.py +++ b/ctapipe/tools/train_disp_reconstructor.py @@ -22,7 +22,8 @@ class TrainDispReconstructor(Tool): The tool first performs a cross validation to give an initial estimate on the quality of the estimation and then finally trains two models - (|disp| and sign(disp)) per telescope type on the full dataset. + (estimating ``norm(disp)`` and ``sign(disp)`` respectively) per + telescope type on the full dataset. """ name = "ctapipe-train-disp-reconstructor" @@ -61,9 +62,9 @@ class TrainDispReconstructor(Tool): project_disp = Bool( default_value=False, help=( - "If true, true |disp| is the distance between shower cog and" + "If true, ``true_disp`` is the distance between shower cog and" " the true source position along the reconstructed main shower axis." - "If false, true |disp| is the distance between shower cog" + "If false, ``true_disp`` is the distance between shower cog" " and the true source position." ), ).tag(config=True)