diff --git a/docs/conf.py b/docs/conf.py index 7462a24a4..c8f4fc96d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -89,11 +89,11 @@ } intersphinx_mapping = { - "python": ("https://docs.python.org/3.7", None), - "numpy": ("https://numpy.org/doc/stable", None), + "python": ("https://docs.python.org/3.9/", None), + "numpy": ("https://numpy.org/doc/stable/", None), "scipy": ("https://docs.scipy.org/doc/scipy/", None), "astropy": ("https://docs.astropy.org/en/latest/", None), - "gammapy": ("https://docs.gammapy.org/0.18/", None), + "gammapy": ("https://docs.gammapy.org/1.1/", None), } # Add any paths that contain custom static files (such as style sheets) here, diff --git a/docs/notebooks/fact_example.ipynb b/docs/notebooks/fact_example.ipynb index 5c6fdc266..f1ed1f245 100644 --- a/docs/notebooks/fact_example.ipynb +++ b/docs/notebooks/fact_example.ipynb @@ -20,7 +20,8 @@ "source": [ "import numpy as np\n", "import astropy.units as u\n", - "import matplotlib.pyplot as plt" + "import matplotlib.pyplot as plt\n", + "import subprocess as sp" ] }, { @@ -48,7 +49,11 @@ "metadata": {}, "outputs": [], "source": [ - "! curl -z gamma_test_dl3.hdf5 -fLO https://factdata.app.tu-dortmund.de/dl3/FACT-Tools/v1.1.2/gamma_test_dl3.hdf5" + "path = \"gamma_test_dl3.hdf5\"\n", + "url = f\"https://factdata.app.tu-dortmund.de/dl3/FACT-Tools/v1.1.2/{path}\"\n", + "ret = sp.run([\"curl\", \"-z\", path, \"-fsSLO\", url], stdout=sp.PIPE, stderr=sp.PIPE, encoding='utf-8')\n", + "if ret.returncode != 0:\n", + " raise IOError(ret.stderr)" ] }, { @@ -111,11 +116,10 @@ "source": [ "### DL2 Event List\n", "\n", - "\n", "`pyirf` does not prescribe or use a specific DL2 *file* format.\n", "You need to read the data into an `astropy.table.QTable` following our conventions, detailed in the docs here: \n", "\n", - "https://cta-observatory.github.io/pyirf/introduction.html#dl2-event-lists\n", + "\n", "\n", "The FACT-Tools / aict-tools analysis chain uses a column-oriented hdf5 file written using h5py. \n", "Unfortunately, units have to be known and are not in the metadata." @@ -279,9 +283,7 @@ "cell_type": "code", "execution_count": null, "id": "norman-personal", - "metadata": { - "scrolled": false - }, + "metadata": {}, "outputs": [], "source": [ "# utility function to converet pyirf Quantities to the gammapy classes\n", @@ -414,9 +416,7 @@ "cell_type": "code", "execution_count": null, "id": "heard-plate", - "metadata": { - "scrolled": false - }, + "metadata": {}, "outputs": [], "source": [ "from gammapy.irf import EnergyDispersion2D\n", @@ -480,14 +480,6 @@ "\n", "fits.HDUList(hdus).writeto('fact_irf.fits.gz', overwrite=True)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "0d608e4c", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -506,7 +498,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.7" } }, "nbformat": 4, diff --git a/pyirf/interpolation/nearest_neighbor_searcher.py b/pyirf/interpolation/nearest_neighbor_searcher.py index 4543d4c07..d1f368c3e 100644 --- a/pyirf/interpolation/nearest_neighbor_searcher.py +++ b/pyirf/interpolation/nearest_neighbor_searcher.py @@ -40,9 +40,9 @@ def __init__(self, grid_points, values, norm_ord=2): TypeError: If norm_ord is not non-zero integer - Note - ---- - Also calls pyirf.interpolation.BaseInterpolators.__init__ + Notes + ----- + Also calls pyirf.interpolation.BaseInterpolators.__init__ """ super().__init__(grid_points) @@ -79,10 +79,10 @@ def interpolate(self, target_point): content_new: numpy.ndarray, shape=(1, ...) values at nearest neighbor - Note - ---- - In case of multiple nearest neighbors, the values corresponding - to the first one are returned. + Notes + ----- + In case of multiple nearest neighbors, the values corresponding + to the first one are returned. """ if target_point.ndim == 1: @@ -124,9 +124,9 @@ def __init__(self, grid_points, bin_edges, binned_pdf, norm_ord=2): passed to numpy.linalg.norm [1]. Defaults to 2, which uses the euclidean norm. - Note - ---- - Also calls pyirf.interpolation.BaseNearestNeighborSearcher.__init__ + Notes + ----- + Also calls pyirf.interpolation.BaseNearestNeighborSearcher.__init__ """ super().__init__(grid_points=grid_points, values=binned_pdf, norm_ord=norm_ord) @@ -159,9 +159,9 @@ def __init__(self, grid_points, params, norm_ord=2): passed to numpy.linalg.norm [1]. Defaults to 2, which uses the euclidean norm. - Note + Notes ---- - Also calls pyirf.interpolation.BaseNearestNeighborSearcher.__init__ + Also calls pyirf.interpolation.BaseNearestNeighborSearcher.__init__ """ super().__init__(grid_points=grid_points, values=params, norm_ord=norm_ord)