Skip to content

Commit 0aec099

Browse files
authored
Merge pull request #99 from espdev/update-docs-theme
Update docs theme to Furo
2 parents a50dc88 + 61386dd commit 0aec099

File tree

13 files changed

+289
-156
lines changed

13 files changed

+289
-156
lines changed

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
key: venv-${{ hashFiles('poetry.lock') }}
5757

5858
- name: Install the project dependencies
59-
run: poetry install -E docs
59+
run: poetry install
6060

6161
- name: Run static analysis, linters and mypy
6262
run: poetry run poe check

.github/workflows/release.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ jobs:
4545
key: venv-${{ hashFiles('poetry.lock') }}
4646

4747
- name: Build
48-
run: |
49-
poetry install
50-
poetry build
48+
run: poetry build
5149

5250
- name: Get package version to create a new tag and release
5351
id: get-version

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ repos:
1616
language: system
1717
types: [ python ]
1818
require_serial: true
19-
- id: check-types
20-
name: check-types
21-
entry: poetry run poe check-types-pre-commit
22-
language: system
23-
types: [ python ]
24-
require_serial: true
19+
# - id: check-types
20+
# name: check-types
21+
# entry: poetry run poe check-types-pre-commit
22+
# language: system
23+
# types: [ python ]
24+
# require_serial: true

.readthedocs.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ version: 2
88
build:
99
os: ubuntu-lts-latest
1010
tools:
11-
python: "3.11"
11+
python: "3.12"
12+
13+
# https://docs.readthedocs.com/platform/stable/build-customization.html#install-dependencies-with-poetry~
14+
jobs:
15+
post_install:
16+
- pip install poetry
17+
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs
18+
1219

1320
# Build documentation in the docs/ directory with Sphinx
1421
sphinx:
@@ -18,11 +25,3 @@ sphinx:
1825
# Optionally build your docs in additional formats such as PDF and ePub
1926
formats:
2027
- pdf
21-
22-
# Optionally set the version of Python and requirements required to build your docs
23-
python:
24-
install:
25-
- method: pip
26-
path: .
27-
extra_requirements:
28-
- docs

docs/_static/logo-dark-mode.png

57.1 KB
Loading

docs/_static/logo.png

43.5 KB
Loading

docs/conf.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
# -- Project information -----------------------------------------------------
2020

2121
project = 'csaps'
22-
copyright = '2017-2025, Eugene Prilepin' # noqa
2322
author = 'Eugene Prilepin'
23+
copyright = f'2017-2025, {author}' # noqa
2424

2525

2626
def _get_version():
@@ -47,7 +47,9 @@ def _get_version():
4747
'm2r2',
4848
]
4949

50-
intersphinx_mapping = {'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None)}
50+
intersphinx_mapping = {
51+
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
52+
}
5153

5254
# Extension settings
5355
plot_apply_rcparams = True
@@ -69,7 +71,7 @@ def _get_version():
6971
from mpl_toolkits.mplot3d import Axes3D
7072
from csaps import csaps
7173
72-
plt.style.use('ggplot')
74+
plt.style.use('csaps.mplstyle')
7375
7476
def univariate_data(n=25, seed=1234):
7577
np.random.seed(seed)
@@ -95,23 +97,22 @@ def univariate_data(n=25, seed=1234):
9597

9698
# The theme to use for HTML and HTML Help pages. See the documentation for
9799
# a list of builtin themes.
98-
#
99-
html_theme = 'alabaster'
100+
html_theme = 'furo'
100101

101102
# Add any paths that contain custom static files (such as style sheets) here,
102103
# relative to this directory. They are copied after the builtin static files,
103104
# so a file named "default.css" will overwrite the builtin "default.css".
104105
html_static_path = ['_static']
105106

107+
pygments_style = 'tango'
108+
pygments_dark_style = 'stata-dark'
109+
106110
html_theme_options = {
107-
'fixed_sidebar': 'true',
108-
'show_powered_by': 'false',
109-
'description': 'Cubic spline approximation (smoothing)',
110-
'github_user': 'espdev',
111-
'github_repo': 'csaps',
112-
'github_type': 'star',
113-
'extra_nav_links': {
114-
'GitHub repository': 'https://github.com/espdev/csaps',
115-
'PyPI': 'https://pypi.org/project/csaps',
116-
},
111+
'light_logo': 'logo.png',
112+
'dark_logo': 'logo-dark-mode.png',
113+
'sidebar_hide_name': True,
114+
'source_repository': 'https://github.com/espdev/csaps',
115+
'source_branch': 'master',
116+
'source_directory': 'docs/',
117+
'top_of_page_buttons': ['view'],
117118
}

docs/csaps.mplstyle

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# based on Matplotlib ggplot.mplstyle
2+
# https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/mpl-data/stylelib/ggplot.mplstyle
3+
4+
patch.linewidth: 0.5
5+
patch.facecolor: 348ABD # blue
6+
patch.edgecolor: EEEEEE
7+
patch.antialiased: True
8+
9+
font.size: 10.0
10+
11+
axes.facecolor: none
12+
axes.edgecolor: none
13+
axes.linewidth: 1
14+
axes.grid: True
15+
axes.titlesize: x-large
16+
axes.labelsize: large
17+
axes.labelcolor: 555555
18+
axes.axisbelow: True # grid/ticks are below elements (e.g., lines, text)
19+
axes.titlecolor: 555555
20+
21+
axes.prop_cycle: cycler('color', ['E24A33', '348ABD', '988ED5', '777777', 'FBC15E', '8EBA42', 'FFB5B8'])
22+
# E24A33 : red
23+
# 348ABD : blue
24+
# 988ED5 : purple
25+
# 777777 : gray
26+
# FBC15E : yellow
27+
# 8EBA42 : green
28+
# FFB5B8 : pink
29+
30+
axes3d.grid: True
31+
axes3d.xaxis.panecolor: none
32+
axes3d.yaxis.panecolor: none
33+
axes3d.zaxis.panecolor: none
34+
35+
xtick.color: 555555
36+
xtick.direction: out
37+
38+
ytick.color: 555555
39+
ytick.direction: out
40+
41+
grid.color: C9C9C9
42+
grid.linestyle: - # solid line
43+
44+
legend.facecolor: none
45+
legend.edgecolor: none
46+
legend.labelcolor: 555555
47+
48+
figure.facecolor: white
49+
figure.edgecolor: 0.50

docs/formulation.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ It is an example plot of comparison ``csaps`` and ``scipy.UnivariateSpline`` (k=
8989
plt.plot(x, y, 'o')
9090
plt.plot(xi, yi_scipy, '-', label='scipy UnivariateSpline')
9191
plt.plot(xi, yi_csaps, '-', label='csaps')
92-
plt.legend()
92+
93+
plt.legend(bbox_to_anchor=(0, 1, 1, 0), loc="lower center", ncol=2)
9394

9495

9596
.. rubric:: Footnotes

docs/index.rst

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ csaps
55

66
CSAPS -- Cubic Spline Approximation (Smoothing)
77

8+
Version:
9+
|release|
10+
811
Overview
912
--------
1013

@@ -38,27 +41,37 @@ You can install and update csaps using pip:
3841
3942
pip install -U csaps
4043
44+
or using modern packaging tools like Poetry:
45+
46+
.. code-block:: bash
47+
48+
poetry add csaps
49+
50+
4151
The module depends only on NumPy and SciPy.
4252

4353
Python 3.10 or above is supported.
4454

45-
Content
46-
-------
47-
4855
.. toctree::
49-
:maxdepth: 2
56+
:caption: User Guide
57+
:hidden:
5058

5159
formulation
5260
tutorial
5361
internals
5462
benchmarks
55-
api
5663
changelog
5764

65+
.. toctree::
66+
:caption: API
67+
:hidden:
68+
69+
api
70+
genindex
5871

59-
Indices and Tables
60-
==================
72+
.. toctree::
73+
:caption: Project Links
74+
:hidden:
6175

62-
* :ref:`genindex`
63-
* :ref:`modindex`
64-
* :ref:`search`
76+
GitHub <https://github.com/espdev/csaps>
77+
PyPI <https://pypi.org/project/csaps>

0 commit comments

Comments
 (0)