xarray-plotly 0.0.13__tar.gz → 0.0.14__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/.github/dependabot.yml +4 -0
  2. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/.github/workflows/pr-title.yml +1 -1
  3. xarray_plotly-0.0.14/.github/workflows/release-please.yml +42 -0
  4. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/.github/workflows/release.yml +8 -4
  5. xarray_plotly-0.0.14/.release-please-manifest.json +3 -0
  6. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/CHANGELOG.md +7 -0
  7. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/CONTRIBUTING.md +4 -7
  8. {xarray_plotly-0.0.13/xarray_plotly.egg-info → xarray_plotly-0.0.14}/PKG-INFO +5 -5
  9. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/pyproject.toml +4 -4
  10. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/xarray_plotly/common.py +28 -2
  11. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/xarray_plotly/plotting.py +5 -5
  12. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14/xarray_plotly.egg-info}/PKG-INFO +5 -5
  13. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/xarray_plotly.egg-info/requires.txt +4 -4
  14. xarray_plotly-0.0.13/.github/workflows/release-please.yml +0 -19
  15. xarray_plotly-0.0.13/.release-please-manifest.json +0 -3
  16. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/.github/workflows/ci.yml +0 -0
  17. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/.github/workflows/dependabot-auto-merge.yml +0 -0
  18. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/.github/workflows/docs.yml +0 -0
  19. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/.gitignore +0 -0
  20. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/.pre-commit-config.yaml +0 -0
  21. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/.release-please-config.json +0 -0
  22. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/LICENSE +0 -0
  23. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/README.md +0 -0
  24. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/docs/api.md +0 -0
  25. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/docs/examples/combining.ipynb +0 -0
  26. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/docs/examples/datasets.ipynb +0 -0
  27. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/docs/examples/dimensions.ipynb +0 -0
  28. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/docs/examples/fast_bar.ipynb +0 -0
  29. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/docs/examples/figure.ipynb +0 -0
  30. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/docs/examples/kwargs.ipynb +0 -0
  31. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/docs/examples/manipulation.ipynb +0 -0
  32. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/docs/examples/plot-types.ipynb +0 -0
  33. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/docs/getting-started.ipynb +0 -0
  34. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/docs/index.md +0 -0
  35. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/mkdocs.yml +0 -0
  36. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/setup.cfg +0 -0
  37. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/tests/__init__.py +0 -0
  38. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/tests/test_accessor.py +0 -0
  39. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/tests/test_common.py +0 -0
  40. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/tests/test_config.py +0 -0
  41. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/tests/test_figures.py +0 -0
  42. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/xarray_plotly/__init__.py +0 -0
  43. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/xarray_plotly/accessor.py +0 -0
  44. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/xarray_plotly/config.py +0 -0
  45. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/xarray_plotly/figures.py +0 -0
  46. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/xarray_plotly/py.typed +0 -0
  47. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/xarray_plotly.egg-info/SOURCES.txt +0 -0
  48. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/xarray_plotly.egg-info/dependency_links.txt +0 -0
  49. {xarray_plotly-0.0.13 → xarray_plotly-0.0.14}/xarray_plotly.egg-info/top_level.txt +0 -0
@@ -4,6 +4,8 @@ updates:
4
4
  directory: "/"
5
5
  schedule:
6
6
  interval: "weekly"
7
+ commit-message:
8
+ prefix: "chore"
7
9
  groups:
8
10
  dev-dependencies:
9
11
  patterns:
@@ -23,3 +25,5 @@ updates:
23
25
  directory: "/"
24
26
  schedule:
25
27
  interval: "weekly"
28
+ commit-message:
29
+ prefix: "ci"
@@ -8,7 +8,7 @@ jobs:
8
8
  validate:
9
9
  runs-on: ubuntu-latest
10
10
  steps:
11
- - uses: amannn/action-semantic-pull-request@v5
11
+ - uses: amannn/action-semantic-pull-request@v6
12
12
  env:
13
13
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14
14
  with:
@@ -0,0 +1,42 @@
1
+ name: Release Please
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ permissions:
9
+ contents: write
10
+ pull-requests: write
11
+ id-token: write # for PyPI trusted publishing
12
+
13
+ jobs:
14
+ release-please:
15
+ runs-on: ubuntu-latest
16
+ outputs:
17
+ release_created: ${{ steps.release.outputs.release_created }}
18
+ tag_name: ${{ steps.release.outputs.tag_name }}
19
+ steps:
20
+ - uses: googleapis/release-please-action@v4
21
+ id: release
22
+ with:
23
+ config-file: .release-please-config.json
24
+ manifest-file: .release-please-manifest.json
25
+
26
+ publish:
27
+ needs: release-please
28
+ if: ${{ needs.release-please.outputs.release_created }}
29
+ runs-on: ubuntu-latest
30
+ permissions:
31
+ id-token: write
32
+ steps:
33
+ - uses: actions/checkout@v6
34
+
35
+ - name: Install uv
36
+ uses: astral-sh/setup-uv@v7
37
+
38
+ - name: Build package
39
+ run: uv build
40
+
41
+ - name: Publish to PyPI
42
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -1,9 +1,11 @@
1
- name: Release
1
+ name: Release (Manual)
2
2
 
3
3
  on:
4
- push:
5
- tags:
6
- - "v*"
4
+ workflow_dispatch:
5
+ inputs:
6
+ tag:
7
+ description: 'Tag to release (e.g., v0.0.13)'
8
+ required: true
7
9
 
8
10
  jobs:
9
11
  release:
@@ -13,6 +15,8 @@ jobs:
13
15
 
14
16
  steps:
15
17
  - uses: actions/checkout@v6
18
+ with:
19
+ ref: ${{ inputs.tag }}
16
20
 
17
21
  - name: Install uv
18
22
  uses: astral-sh/setup-uv@v7
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.0.14"
3
+ }
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.14](https://github.com/FBumann/xarray_plotly/compare/v0.0.13...v0.0.14) (2026-03-09)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * continuous colorscale strings with discrete-only chart types ([#46](https://github.com/FBumann/xarray_plotly/issues/46)) ([cc865b5](https://github.com/FBumann/xarray_plotly/commit/cc865b5c1d2f7a2921b8e27c23546a883a974279))
9
+
3
10
  ## [0.0.13](https://github.com/FBumann/xarray_plotly/compare/v0.0.12...v0.0.13) (2026-01-28)
4
11
 
5
12
 
@@ -42,11 +42,8 @@ uv run ruff format .
42
42
 
43
43
  ## Releases
44
44
 
45
- Releases are automated via GitHub Actions. Version is determined from git tags via setuptools_scm.
45
+ Releases are fully automated via [Release Please](https://github.com/googleapis/release-please).
46
46
 
47
- To create a release:
48
-
49
- 1. Tag: `git tag v0.1.0`
50
- 2. Push: `git push && git push --tags`
51
-
52
- The CI will automatically publish to PyPI and deploy updated docs.
47
+ 1. Merge PRs to `main` using [conventional commit](https://www.conventionalcommits.org/) prefixes (`feat:`, `fix:`, etc.)
48
+ 2. Release Please automatically creates/updates a release PR with changelog and version bump
49
+ 3. Merge the release PR to publish to PyPI and deploy updated docs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xarray_plotly
3
- Version: 0.0.13
3
+ Version: 0.0.14
4
4
  Summary: Interactive Plotly Express plotting accessor for xarray
5
5
  Author: Felix
6
6
  License: MIT
@@ -28,13 +28,13 @@ Provides-Extra: dev
28
28
  Requires-Dist: pytest==9.0.2; extra == "dev"
29
29
  Requires-Dist: pytest-cov==7.0.0; extra == "dev"
30
30
  Requires-Dist: mypy==1.19.1; extra == "dev"
31
- Requires-Dist: ruff==0.14.14; extra == "dev"
31
+ Requires-Dist: ruff==0.15.5; extra == "dev"
32
32
  Requires-Dist: pre-commit==4.5.1; extra == "dev"
33
- Requires-Dist: nbstripout==0.9.0; extra == "dev"
33
+ Requires-Dist: nbstripout==0.9.1; extra == "dev"
34
34
  Provides-Extra: docs
35
35
  Requires-Dist: mkdocs==1.6.1; extra == "docs"
36
- Requires-Dist: mkdocs-material==9.7.1; extra == "docs"
37
- Requires-Dist: mkdocstrings[python]==1.0.1; extra == "docs"
36
+ Requires-Dist: mkdocs-material==9.7.4; extra == "docs"
37
+ Requires-Dist: mkdocstrings[python]==1.0.3; extra == "docs"
38
38
  Requires-Dist: mkdocs-jupyter==0.25.1; extra == "docs"
39
39
  Requires-Dist: mkdocs-plotly-plugin==0.1.3; extra == "docs"
40
40
  Requires-Dist: jupyter==1.1.1; extra == "docs"
@@ -35,14 +35,14 @@ dev = [
35
35
  "pytest==9.0.2",
36
36
  "pytest-cov==7.0.0",
37
37
  "mypy==1.19.1",
38
- "ruff==0.14.14",
38
+ "ruff==0.15.5",
39
39
  "pre-commit==4.5.1",
40
- "nbstripout==0.9.0",
40
+ "nbstripout==0.9.1",
41
41
  ]
42
42
  docs = [
43
43
  "mkdocs==1.6.1",
44
- "mkdocs-material==9.7.1",
45
- "mkdocstrings[python]==1.0.1",
44
+ "mkdocs-material==9.7.4",
45
+ "mkdocstrings[python]==1.0.3",
46
46
  "mkdocs-jupyter==0.25.1",
47
47
  "mkdocs-plotly-plugin==0.1.3",
48
48
  "jupyter==1.1.1",
@@ -13,7 +13,7 @@ from xarray_plotly.config import DEFAULT_SLOT_ORDERS, _options
13
13
 
14
14
  if TYPE_CHECKING:
15
15
  import pandas as pd
16
- from xarray import DataArray
16
+ from xarray import DataArray, Dataset
17
17
 
18
18
 
19
19
  class _AUTO:
@@ -251,7 +251,21 @@ def _get_qualitative_scale_names() -> frozenset[str]:
251
251
  )
252
252
 
253
253
 
254
- def resolve_colors(colors: Colors, px_kwargs: dict[str, Any]) -> dict[str, Any]:
254
+ def _sample_colorscale(name: str, n: int) -> list[str]:
255
+ """Sample *n* evenly-spaced colors from a named Plotly colorscale."""
256
+ scale = px.colors.get_colorscale(name)
257
+ samplepoints = [i / max(n - 1, 1) for i in range(n)]
258
+ result: list[str] = px.colors.sample_colorscale(scale, samplepoints)
259
+ return result
260
+
261
+
262
+ def resolve_colors(
263
+ colors: Colors,
264
+ px_kwargs: dict[str, Any],
265
+ *,
266
+ color_dim: Hashable | None = None,
267
+ darray: DataArray | Dataset | None = None,
268
+ ) -> dict[str, Any]:
255
269
  """Map unified `colors` parameter to appropriate Plotly px_kwargs.
256
270
 
257
271
  Direct color_* kwargs take precedence and trigger a warning if
@@ -260,6 +274,14 @@ def resolve_colors(colors: Colors, px_kwargs: dict[str, Any]) -> dict[str, Any]:
260
274
  Args:
261
275
  colors: Unified color specification (str, list, dict, or None).
262
276
  px_kwargs: Existing kwargs to pass to Plotly Express.
277
+ color_dim: Dimension name used for discrete color grouping.
278
+ When provided together with *darray*, a continuous colorscale
279
+ string is sampled into a discrete sequence whose length
280
+ matches the number of coordinates along this dimension.
281
+ Use for chart types that only accept discrete color
282
+ parameters (line, area, box, pie).
283
+ darray: Source DataArray or Dataset; used with *color_dim* to
284
+ determine the number of discrete colors to sample.
263
285
 
264
286
  Returns:
265
287
  Updated px_kwargs with color parameters injected.
@@ -284,6 +306,10 @@ def resolve_colors(colors: Colors, px_kwargs: dict[str, Any]) -> dict[str, Any]:
284
306
  # Check if it's a qualitative (discrete) palette name
285
307
  if colors in _get_qualitative_scale_names():
286
308
  px_kwargs["color_discrete_sequence"] = getattr(px.colors.qualitative, colors)
309
+ elif color_dim is not None and darray is not None:
310
+ # Sample from continuous scale into a discrete sequence
311
+ n = darray.sizes[color_dim]
312
+ px_kwargs["color_discrete_sequence"] = _sample_colorscale(colors, n)
287
313
  else:
288
314
  # Assume continuous scale
289
315
  px_kwargs["color_continuous_scale"] = colors
@@ -82,7 +82,6 @@ def line(
82
82
  -------
83
83
  plotly.graph_objects.Figure
84
84
  """
85
- px_kwargs = resolve_colors(colors, px_kwargs)
86
85
  slots = assign_slots(
87
86
  list(darray.dims),
88
87
  "line",
@@ -94,6 +93,7 @@ def line(
94
93
  facet_row=facet_row,
95
94
  animation_frame=animation_frame,
96
95
  )
96
+ px_kwargs = resolve_colors(colors, px_kwargs, color_dim=slots.get("color"), darray=darray)
97
97
 
98
98
  df = to_dataframe(darray)
99
99
  value_col = get_value_col(darray)
@@ -329,7 +329,6 @@ def fast_bar(
329
329
  -------
330
330
  plotly.graph_objects.Figure
331
331
  """
332
- px_kwargs = resolve_colors(colors, px_kwargs)
333
332
  slots = assign_slots(
334
333
  list(darray.dims),
335
334
  "fast_bar",
@@ -339,6 +338,7 @@ def fast_bar(
339
338
  facet_row=facet_row,
340
339
  animation_frame=animation_frame,
341
340
  )
341
+ px_kwargs = resolve_colors(colors, px_kwargs, color_dim=slots.get("color"), darray=darray)
342
342
 
343
343
  df = to_dataframe(darray)
344
344
  value_col = get_value_col(darray)
@@ -410,7 +410,6 @@ def area(
410
410
  -------
411
411
  plotly.graph_objects.Figure
412
412
  """
413
- px_kwargs = resolve_colors(colors, px_kwargs)
414
413
  slots = assign_slots(
415
414
  list(darray.dims),
416
415
  "area",
@@ -421,6 +420,7 @@ def area(
421
420
  facet_row=facet_row,
422
421
  animation_frame=animation_frame,
423
422
  )
423
+ px_kwargs = resolve_colors(colors, px_kwargs, color_dim=slots.get("color"), darray=darray)
424
424
 
425
425
  df = to_dataframe(darray)
426
426
  value_col = get_value_col(darray)
@@ -487,7 +487,6 @@ def box(
487
487
  -------
488
488
  plotly.graph_objects.Figure
489
489
  """
490
- px_kwargs = resolve_colors(colors, px_kwargs)
491
490
  slots = assign_slots(
492
491
  list(darray.dims),
493
492
  "box",
@@ -498,6 +497,7 @@ def box(
498
497
  facet_row=facet_row,
499
498
  animation_frame=animation_frame,
500
499
  )
500
+ px_kwargs = resolve_colors(colors, px_kwargs, color_dim=slots.get("color"), darray=darray)
501
501
 
502
502
  df = to_dataframe(darray)
503
503
  value_col = get_value_col(darray)
@@ -746,7 +746,6 @@ def pie(
746
746
  -------
747
747
  plotly.graph_objects.Figure
748
748
  """
749
- px_kwargs = resolve_colors(colors, px_kwargs)
750
749
  slots = assign_slots(
751
750
  list(darray.dims),
752
751
  "pie",
@@ -754,6 +753,7 @@ def pie(
754
753
  facet_col=facet_col,
755
754
  facet_row=facet_row,
756
755
  )
756
+ px_kwargs = resolve_colors(colors, px_kwargs, color_dim=slots.get("names"), darray=darray)
757
757
 
758
758
  df = to_dataframe(darray)
759
759
  value_col = get_value_col(darray)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xarray_plotly
3
- Version: 0.0.13
3
+ Version: 0.0.14
4
4
  Summary: Interactive Plotly Express plotting accessor for xarray
5
5
  Author: Felix
6
6
  License: MIT
@@ -28,13 +28,13 @@ Provides-Extra: dev
28
28
  Requires-Dist: pytest==9.0.2; extra == "dev"
29
29
  Requires-Dist: pytest-cov==7.0.0; extra == "dev"
30
30
  Requires-Dist: mypy==1.19.1; extra == "dev"
31
- Requires-Dist: ruff==0.14.14; extra == "dev"
31
+ Requires-Dist: ruff==0.15.5; extra == "dev"
32
32
  Requires-Dist: pre-commit==4.5.1; extra == "dev"
33
- Requires-Dist: nbstripout==0.9.0; extra == "dev"
33
+ Requires-Dist: nbstripout==0.9.1; extra == "dev"
34
34
  Provides-Extra: docs
35
35
  Requires-Dist: mkdocs==1.6.1; extra == "docs"
36
- Requires-Dist: mkdocs-material==9.7.1; extra == "docs"
37
- Requires-Dist: mkdocstrings[python]==1.0.1; extra == "docs"
36
+ Requires-Dist: mkdocs-material==9.7.4; extra == "docs"
37
+ Requires-Dist: mkdocstrings[python]==1.0.3; extra == "docs"
38
38
  Requires-Dist: mkdocs-jupyter==0.25.1; extra == "docs"
39
39
  Requires-Dist: mkdocs-plotly-plugin==0.1.3; extra == "docs"
40
40
  Requires-Dist: jupyter==1.1.1; extra == "docs"
@@ -6,14 +6,14 @@ pandas>=1.5.0
6
6
  pytest==9.0.2
7
7
  pytest-cov==7.0.0
8
8
  mypy==1.19.1
9
- ruff==0.14.14
9
+ ruff==0.15.5
10
10
  pre-commit==4.5.1
11
- nbstripout==0.9.0
11
+ nbstripout==0.9.1
12
12
 
13
13
  [docs]
14
14
  mkdocs==1.6.1
15
- mkdocs-material==9.7.1
16
- mkdocstrings[python]==1.0.1
15
+ mkdocs-material==9.7.4
16
+ mkdocstrings[python]==1.0.3
17
17
  mkdocs-jupyter==0.25.1
18
18
  mkdocs-plotly-plugin==0.1.3
19
19
  jupyter==1.1.1
@@ -1,19 +0,0 @@
1
- name: Release Please
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
-
8
- permissions:
9
- contents: write
10
- pull-requests: write
11
-
12
- jobs:
13
- release-please:
14
- runs-on: ubuntu-latest
15
- steps:
16
- - uses: googleapis/release-please-action@v4
17
- with:
18
- config-file: .release-please-config.json
19
- manifest-file: .release-please-manifest.json
@@ -1,3 +0,0 @@
1
- {
2
- ".": "0.0.13"
3
- }
File without changes
File without changes
File without changes