Skip to content

Commit ac819a3

Browse files
committed
Merge remote-tracking branch 'origin/main' into 219-dependency-groups
# Conflicts: # docs/reference/changelog.md
2 parents 51a14bd + 14e872d commit ac819a3

22 files changed

Lines changed: 287 additions & 23 deletions

File tree

.github/workflows/check-release-notes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
timeout-minutes: 1
2424
steps:
25-
- uses: actions/checkout@v6
25+
- uses: actions/checkout@v7
2626

2727
- name: Default MISSING_CHANGELOG_ENTRY to 1
2828
run: echo 'MISSING_CHANGELOG_ENTRY=1' >> "$GITHUB_ENV"

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
timeout-minutes: 6
2424
steps:
25-
- uses: actions/checkout@v6
25+
- uses: actions/checkout@v7
2626
- uses: ./.github/actions/setup-python
2727
with:
2828
python-version: "3.10"
@@ -68,7 +68,7 @@ jobs:
6868
DIFF_AGAINST: HEAD
6969
timeout-minutes: 8
7070
steps:
71-
- uses: actions/checkout@v6
71+
- uses: actions/checkout@v7
7272
with:
7373
# TODO: This can be very expensive for large repos. Is there a better way to do this?
7474
# Fetch all history and tags for setuptools_scm to work
@@ -104,7 +104,7 @@ jobs:
104104
# Upload coverage reports to Codecov
105105

106106
- name: Upload coverage to codecov
107-
uses: codecov/codecov-action@v6
107+
uses: codecov/codecov-action@v7
108108
env:
109109
OS: "${{ matrix.os }}"
110110
PYTHON: "${{ matrix.python-version }}"

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
# actions: read
3030
# contents: read
3131
steps:
32-
- uses: actions/checkout@v6
32+
- uses: actions/checkout@v7
3333

3434
- uses: github/codeql-action/init@v4
3535
with:

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: ubuntu-latest
3333
timeout-minutes: 6
3434
steps:
35-
- uses: actions/checkout@v6
35+
- uses: actions/checkout@v7
3636
with:
3737
# TODO: This can be very expensive for large repos. Is there a better way to do this?
3838
# Fetch all history and tags for setuptools_scm to work
@@ -105,7 +105,7 @@ jobs:
105105
steps:
106106

107107
# Generate the release notes
108-
- uses: actions/checkout@v6
108+
- uses: actions/checkout@v7
109109
with:
110110
# TODO: This can be very expensive for large repos. Is there a better way to do this?
111111
# Fetch all history and tags for setuptools_scm to work
@@ -124,14 +124,14 @@ jobs:
124124
name: python-package-distributions
125125
path: dist/
126126
- name: Sign the dists with Sigstore
127-
uses: sigstore/gh-action-sigstore-python@v3.3.0
127+
uses: sigstore/gh-action-sigstore-python@v3.4.0
128128
with:
129129
inputs: >-
130130
./dist/*.tar.gz
131131
./dist/*.whl
132132
133133
- name: Create GitHub Release
134-
uses: softprops/action-gh-release@v2
134+
uses: softprops/action-gh-release@v3
135135
with:
136136
body_path: LATEST_RELEASE_NOTES.md
137137
# `dist/` contains the built distributions, and the

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ repos:
4343
exclude: ^\.bumpversion\.cfg$
4444

4545
- repo: https://github.com/python-jsonschema/check-jsonschema.git
46-
rev: 0.37.2
46+
rev: 0.37.4
4747
hooks:
4848
- id: check-github-actions
4949
- id: check-github-workflows
@@ -65,7 +65,7 @@ repos:
6565
- id: nbstripout
6666

6767
- repo: https://github.com/codespell-project/codespell
68-
rev: v2.4.2
68+
rev: v2.4.3
6969
hooks:
7070
- id: codespell
7171
args: [ "-L", "probly", "-L", "mis" ]
@@ -104,7 +104,7 @@ repos:
104104
additional_dependencies: [setuptools-scm]
105105

106106
- repo: https://github.com/astral-sh/ruff-pre-commit
107-
rev: v0.15.13
107+
rev: v0.15.22
108108
hooks:
109109
- id: ruff-format
110110
- id: ruff

cicd_utils/ridgeplot_examples/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ def load_basic() -> go.Figure:
1919
return main()
2020

2121

22+
def load_basic_dark() -> go.Figure:
23+
from ._basic_dark import main
24+
25+
return main()
26+
27+
2228
def load_basic_hist() -> go.Figure:
2329
from ._basic_hist import main
2430

@@ -45,6 +51,7 @@ def load_probly() -> go.Figure:
4551

4652
ALL_EXAMPLES: list[Example] = [
4753
Example("basic", load_basic),
54+
Example("basic_dark", load_basic_dark),
4855
Example("basic_hist", load_basic_hist),
4956
Example("lincoln_weather", load_lincoln_weather),
5057
Example("lincoln_weather_red_blue", load_lincoln_weather_red_blue),

cicd_utils/ridgeplot_examples/_basic.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@
55
if TYPE_CHECKING:
66
import plotly.graph_objects as go
77

8+
from ridgeplot._types import PlotlyTemplate
89

9-
def main() -> go.Figure:
10+
11+
def main(
12+
template: PlotlyTemplate | None = None,
13+
) -> go.Figure:
1014
import numpy as np
1115

1216
from ridgeplot import ridgeplot
1317

1418
rng = np.random.default_rng(42)
1519
my_samples = [rng.normal(n, size=900) for n in range(6, 0, -2)]
16-
fig = ridgeplot(samples=my_samples)
20+
fig = ridgeplot(samples=my_samples, template=template)
1721
fig.update_layout(height=400, width=800)
1822

1923
return fig
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from __future__ import annotations
2+
3+
from typing import TYPE_CHECKING
4+
5+
from ridgeplot_examples._basic import main as basic
6+
7+
if TYPE_CHECKING:
8+
import plotly.graph_objects as go
9+
10+
11+
def main() -> go.Figure:
12+
fig = basic(template="plotly_dark")
13+
return fig
14+
15+
16+
if __name__ == "__main__":
17+
fig = main()
18+
fig.show()
25.7 KB
Loading

docs/getting_started/getting_started.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,3 +287,20 @@ fig = ridgeplot(
287287
```{raw} html
288288
:file: ../_static/charts/lincoln_weather_red_blue.html
289289
```
290+
291+
## Theming with Plotly templates
292+
293+
Since `ridgeplot` is built on top of Plotly, you can also theme your ridgeline plots using [Plotly's figure templates](https://plotly.com/python/templates/). Simply pass the name of a registered template (or any other valid template representation) to the {py:paramref}`~ridgeplot.ridgeplot.template` parameter. For instance, taking the basic example from the top of this page and applying the `"plotly_dark"` template:
294+
295+
```python
296+
fig = ridgeplot(samples=my_samples, template="plotly_dark")
297+
fig.show()
298+
```
299+
300+
```{raw} html
301+
:file: ../_static/charts/basic_dark.html
302+
```
303+
304+
:::{note}
305+
Unless a custom {py:paramref}`~ridgeplot.ridgeplot.colorscale` is specified, the default colorscale will also be inferred from the specified template.
306+
:::

0 commit comments

Comments
 (0)