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

Update docs #2373

Merged
merged 38 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0c13026
Update environment.yml and setup.cfg to latest version of sphinx
aknierim Jul 4, 2023
501f2a9
Moved docs/_static/theme_overrides.css to docs/_static/ctapipe.css
aknierim Jul 4, 2023
135df80
Added logos dark/light
aknierim Jul 4, 2023
11275ed
Updated docs, added version switcher
aknierim Jul 4, 2023
c1eef15
Update setup.cfg pydata dependency
aknierim Jul 4, 2023
a76a43d
Added sphinx-design
aknierim Jul 4, 2023
c60a81e
Update environment.yml and setup.cfg to latest version of sphinx
aknierim Jul 4, 2023
658fb6a
Moved docs/_static/theme_overrides.css to docs/_static/ctapipe.css
aknierim Jul 4, 2023
d2a6d54
Added logos dark/light
aknierim Jul 4, 2023
b97b531
Updated docs, added version switcher
aknierim Jul 4, 2023
40aab03
Update setup.cfg pydata dependency
aknierim Jul 4, 2023
bc9d6d7
Added sphinx-design
aknierim Jul 4, 2023
1050126
Merge branch 'update-docs' of github.com:aknierim/ctapipe into update…
aknierim Jul 4, 2023
07ce4ba
Fixed sphinx warning for ctapipe.compat.StrEnum
aknierim Jul 4, 2023
c025fe3
Fixed sphinx warnings for `ctapipe.instrument`
aknierim Jul 5, 2023
2aed4de
Attempt at a temporary workaround
aknierim Jul 5, 2023
8b60b9a
Added ``:noindex:`` option to certain rst files
aknierim Jul 5, 2023
f3f6d00
Workarounds for duplicate reference warnings
aknierim Jul 7, 2023
958e5d9
Fix heading issue
aknierim Jul 7, 2023
1618eb1
Not adding to __all__ fixes automodapi warnings
aknierim Jul 9, 2023
a99555b
Change back to automodapi, rework docs front page
aknierim Jul 9, 2023
246639f
Ignore unused import warnings
aknierim Jul 10, 2023
3c0223b
Fix isort failing in ctapipe/instrument/camera/__init__.py
aknierim Jul 10, 2023
099f601
Remove html_sidebars option from conf.py
aknierim Jul 10, 2023
57d348f
Fix duplicated reference warning for muon components
maxnoe Jul 17, 2023
c0dc668
Fix broken html syntax in Component.__repr_html__
maxnoe Jul 17, 2023
2f16d23
Clear notebook outputs
maxnoe Jul 17, 2023
4f5f051
Fix add_css_file call in docs/conf.py
maxnoe Jul 17, 2023
63b9e63
Fix Tool repr_html and add html escaping
maxnoe Jul 17, 2023
beb5fad
Simplify __init__.py
maxnoe Jul 17, 2023
02798cb
Remove version switcher from navbar
aknierim Jul 17, 2023
a089c49
Add sidebar to all pages
aknierim Jul 17, 2023
61547d2
Fix for failed CI/lint
aknierim Jul 17, 2023
22d2062
Move content of caution admonition to announcement banner
aknierim Jul 18, 2023
2a6b6ed
Add sphinx conf path to .readthedocs.yml
aknierim Jul 18, 2023
854a84e
Add sidebars again
aknierim Jul 18, 2023
c782ba0
Add navbar version switcher
aknierim Jul 19, 2023
05cc382
Fix versions in switcher.json
aknierim Jul 19, 2023
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
8 changes: 4 additions & 4 deletions ctapipe/calib/camera/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
Camera calibration module.
"""

from .calibrator import CameraCalibrator
from .gainselection import GainSelector
from .calibrator import CameraCalibrator # noqa: F401
from .gainselection import GainSelector # noqa: F401

__all__ = [
"CameraCalibrator",
"GainSelector",
# "CameraCalibrator",
# "GainSelector",
]
17 changes: 10 additions & 7 deletions ctapipe/core/component.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Class to handle configuration for algorithms """
import html
import warnings
import weakref
from abc import ABCMeta
Expand Down Expand Up @@ -233,9 +234,9 @@ def _repr_html_(self):
or "Undocumented"
)
lines = [
"<div style='border:1px solid black; max-width: 700px; padding:2em'; word-wrap:break-word;>",
'<div style="border:1px solid black; max-width: 700px; padding:2em; word-wrap:break-word;">',
f"<b>{name}</b>",
f"<p> {docstring} </p>",
docstring,
"<table>",
" <colgroup>",
" <col span='1' style=' '>",
Expand All @@ -246,21 +247,23 @@ def _repr_html_(self):
]
for key, val in self.get_current_config()[name].items():
htmlval = (
str(val).replace("/", "/<wbr>").replace("_", "_<wbr>")
html.escape(str(val)).replace("/", "/<wbr>").replace("_", "_<wbr>")
) # allow breaking at boundary

# traits of the current component
if key in traits:
thehelp = f"{traits[key].help} (default: {traits[key].default_value})"
thehelp = html.escape(
f"{traits[key].help} (default: {traits[key].default_value})"
)
lines.append(f"<tr><th>{key}</th>")
if val != traits[key].default_value:
lines.append(
f"<td style='text-align: left;'><span style='color:blue; max-width:30em;'>{htmlval}</span></td>"
f'<td style="text-align: left;"><span style="color:blue; max-width:30em;">{htmlval}</span></td>'
)
else:
lines.append(f"<td style='text-align: left;'>{htmlval}</td>")
lines.append(f'<td style="text-align: left;">{htmlval}</td>')
lines.append(
f"<td style='text-align: left;'><i>{thehelp}</i></td></tr>"
f'<td style="text-align: left;"><i>{thehelp}</i></td></tr>'
)
lines.append(" </tbody>")
lines.append("</table>")
Expand Down
10 changes: 7 additions & 3 deletions ctapipe/core/tool.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Classes to handle configurable command-line user interfaces."""
import html
import logging
import logging.config
import os
Expand Down Expand Up @@ -495,8 +496,9 @@ def _repr_html_(self):
or "Undocumented"
)
lines = [
'<div style="border:1px solid black; max-width: 700px; padding:2em; word-wrap:break-word;">',
f"<b>{name}</b>",
f"<p> {docstring} </p>",
docstring,
"<table>",
" <colgroup>",
" <col span='1' style=' '>",
Expand All @@ -507,12 +509,14 @@ def _repr_html_(self):
]
for key, val in self.get_current_config()[name].items():
htmlval = (
str(val).replace("/", "/<wbr>").replace("_", "_<wbr>")
html.escape(str(val)).replace("/", "/<wbr>").replace("_", "_<wbr>")
) # allow breaking at boundary

# traits of the current component
if key in traits:
thehelp = f"{traits[key].help} (default: {traits[key].default_value})"
thehelp = html.escape(
f"{traits[key].help} (default: {traits[key].default_value})"
)
lines.append(f"<tr><th>{key}</th>")
if val != traits[key].default_value:
lines.append(
Expand Down
2 changes: 2 additions & 0 deletions ctapipe/image/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
)
from .muon import (
MuonIntensityFitter,
MuonProcessor,
MuonRingFitter,
intensity_ratio_inside_ring,
kundu_chaudhuri_circle_fit,
Expand Down Expand Up @@ -93,6 +94,7 @@
"chi_squared",
"MuonIntensityFitter",
"MuonRingFitter",
"MuonProcessor",
"kundu_chaudhuri_circle_fit",
"mean_squared_error",
"intensity_ratio_inside_ring",
Expand Down
9 changes: 3 additions & 6 deletions ctapipe/image/muon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@
ring_containment,
)
from .fitting import kundu_chaudhuri_circle_fit
from .intensity_fitter import MuonIntensityFitter
from .processor import MuonProcessor
from .ring_fitter import MuonRingFitter
from .intensity_fitter import MuonIntensityFitter # noqa: F401
from .processor import MuonProcessor # noqa: F401
from .ring_fitter import MuonRingFitter # noqa: F401

__all__ = [
"MuonIntensityFitter",
"MuonRingFitter",
"kundu_chaudhuri_circle_fit",
"mean_squared_error",
"intensity_ratio_inside_ring",
"ring_completeness",
"ring_containment",
"MuonProcessor",
]
17 changes: 9 additions & 8 deletions ctapipe/instrument/camera/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from .description import CameraDescription
from .geometry import CameraGeometry, UnknownPixelShapeWarning, PixelShape
from .readout import CameraReadout
from .description import CameraDescription # noqa: F401
from .geometry import CameraGeometry, PixelShape, UnknownPixelShapeWarning # noqa: F401
from .readout import CameraReadout # noqa: F401

# commented out due to sphinx issue with classes being defined in 3 places
__all__ = [
"CameraDescription",
"CameraGeometry",
"PixelShape",
"UnknownPixelShapeWarning",
"CameraReadout",
# "CameraDescription",
# "CameraGeometry",
# "PixelShape",
# "UnknownPixelShapeWarning",
# "CameraReadout",
]
47 changes: 47 additions & 0 deletions docs/_static/ctapipe.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* override table width restrictions */
@media screen and (min-width: 767px) {

.wy-table-responsive table td {
/* !important prevents the common CSS stylesheets from overriding
this as on RTD they are loaded after this stylesheet */
white-space: normal !important;
}

.wy-table-responsive {
overflow: visible !important;
}
}

/* sphinx-design */
.sd-card {
border-radius: 5px;
padding: 30px 10px 20px 10px;
margin: 10px 0px;
}

.sd-card .sd-card-header .sd-card-text {
margin: 0px;
}

.sd-card .sd-card-header {
border: none;
text-align: center;
font-size: var(--pst-font-size-h4);
font-weight: bold;
padding: 0.5rem 0rem 0.5rem 0rem;
}

.sd-card .sd-card-footer {
border: none;
}

.sd-card .sd-card-footer .sd-card-text {
max-width: 220px;
margin-left: auto;
margin-right: auto;
}

html[data-theme="dark"] .sd-shadow-sm {
--sd-color-shadow: #6e6e6e;
}

72 changes: 72 additions & 0 deletions docs/_static/switcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[
{
"name": "dev",
"version": "latest",
"url": "https://ctapipe.readthedocs.io/en/latest/"
},
{
"name": "v0.19.2 (stable)",
maxnoe marked this conversation as resolved.
Show resolved Hide resolved
"version": "stable",
"url": "https://ctapipe.readthedocs.io/en/stable/"
},
{
"name": "v0.19.3",
"version": "v0.19.3",
"url": "https://ctapipe.readthedocs.io/en/v0.19.3/"
},
{
"name": "v0.19.2",
"version": "v0.19.2",
"url": "https://ctapipe.readthedocs.io/en/v0.19.2/"
},
{
"name": "v0.19.1",
"version": "v0.19.1",
"url": "https://ctapipe.readthedocs.io/en/v0.19.1/"
},
{
"name": "v0.19.0",
"version": "v0.19.0",
"url": "https://ctapipe.readthedocs.io/en/v0.19.0/"
},
{
"name": "v0.18.1",
"version": "v0.18.1",
"url": "https://ctapipe.readthedocs.io/en/v0.18.1/"
},
{
"name": "v0.18.0",
"version": "v0.18.0",
"url": "https://ctapipe.readthedocs.io/en/v0.18.0/"
},
{
"name": "v0.17.0",
"version": "v0.17.0",
"url": "https://ctapipe.readthedocs.io/en/v0.17.0/"
},
{
"name": "v0.16.0",
"version": "v0.16.0",
"url": "https://ctapipe.readthedocs.io/en/v0.16.0/"
},
{
"name": "v0.15.0",
"version": "v0.15.0",
"url": "https://ctapipe.readthedocs.io/en/v0.15.0/"
},
{
"name": "v0.14.0",
"version": "v0.14.0",
"url": "https://ctapipe.readthedocs.io/en/v0.14.0/"
},
{
"name": "v0.12.0-rtd",
"version": "v0.12.0-rtd",
"url": "https://ctapipe.readthedocs.io/en/v0.12.0-rtd/"
},
{
"name": "v0.11.0-rtd",
"version": "v0.11.0-rtd",
"url": "https://ctapipe.readthedocs.io/en/v0.11.0-rtd/"
}
]
13 changes: 0 additions & 13 deletions docs/_static/theme_overrides.css

This file was deleted.

3 changes: 3 additions & 0 deletions docs/changes/2373.maintenance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Switched to ``PyData`` theme for docs
* Updated ``Sphinx`` to version 6.2.1
* Updated front page of docs
Loading