Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs build #277

Merged
merged 3 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
30 changes: 11 additions & 19 deletions docs/notebooks/fact_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -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)"
]
},
{
Expand Down Expand Up @@ -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",
"<https://cta-observatory.github.io/pyirf/introduction.html#dl2-event-lists>\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."
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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": {
Expand All @@ -506,7 +498,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.11.7"
}
},
"nbformat": 4,
Expand Down
24 changes: 12 additions & 12 deletions pyirf/interpolation/nearest_neighbor_searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Loading