Skip to content

Commit baac3c0

Browse files
authored
Merge branch 'main' into rm/fix-matplotlylib-tests
2 parents 7745fab + aa797c5 commit baac3c0

178 files changed

Lines changed: 16728 additions & 9222 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## Unreleased
66

7+
## [6.5.0] - 2025-11-17
8+
9+
### Updated
10+
- Update plotly.js from version 3.2.0 to version 3.3.0. See the plotly.js [release notes](https://github.com/plotly/plotly.js/releases/tag/v3.3.0) for more information. [[#5421](https://github.com/plotly/plotly.py/pull/5421)]. Notable changes include:
11+
- Add `hovertemplate` for `candlestick` and `ohlc` traces [[#7619](https://github.com/plotly/plotly.js/pull/7619)]
12+
13+
### Fixed
14+
- Fix bug where numpy datetime contained in Python list was converted to integer [[#5415](https://github.com/plotly/plotly.py/pull/5415)]
15+
16+
## [6.4.0] - 2025-11-02
17+
18+
### Updated
19+
- Update plotly.js from version 3.1.1 to version 3.2.0. See the plotly.js [release notes](https://github.com/plotly/plotly.js/releases) for more information. [[#5357](https://github.com/plotly/plotly.py/pull/5388)]. Notable changes include:
20+
- Add `hovertemplatefallback` and `texttemplatefallback` attributes [[#7577](https://github.com/plotly/plotly.js/pull/7577)]
21+
- Add "SI extended" formatting rule for tick exponents on axis labels, allowing values to be displayed with extended SI prefixes (e.g., femto, pico, atto) [[#7249](https://github.com/plotly/plotly.js/pull/7249)]
22+
23+
### Deprecated
24+
- Deprecate `create_hexbin_mapbox` in favor of `create_hexbin_map`, update related function calls [[5358](https://github.com/plotly/plotly.py/pull/5358)], with thanks to @ajlien for the contribution!
25+
726
## [6.3.1] - 2025-10-02
827

928
### Updated

CITATION.cff

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ authors:
99
- family-names: "Parmer"
1010
given-names: "Chris"
1111
title: "An interactive, open-source, and browser-based graphing library for Python"
12-
version: 6.3.1
12+
version: 6.5.0
1313
doi: 10.5281/zenodo.14503524
14-
date-released: 2025-10-02
14+
date-released: 2025-11-17
1515
url: "https://github.com/plotly/plotly.py"
16-

RELEASE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Release process - full release of `plotly` package
55

6-
This is the release process for releasing Plotly.py version `X.Y.Z`, including changelogs, GitHub release and forum announcement.
6+
This is the release process for releasing plotly.py version `X.Y.Z`, including changelogs, GitHub release and forum announcement.
77

88
### Finalize changelog
99

@@ -13,10 +13,10 @@ Make sure the changelog includes the version being published at the top, along
1313
with the expected publication date.
1414

1515
Use the `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, and `Security`
16-
labels for all changes to Plotly.py. If the version of Plotly.js has
16+
labels for all changes to plotly.py. If the version of plotly.js has
1717
been updated, include this as the first `Updated` entry. Call out any
1818
notable changes as sub-bullets (new trace types in particular), and provide
19-
a link to the Plotly.js CHANGELOG.
19+
a link to the plotly.js CHANGELOG.
2020

2121
### Update version numbers
2222

@@ -64,7 +64,7 @@ that `go.Figure()` and `go.FigureWidget()` work as expected.
6464
Notes:
6565
- **Start by creating a brand new notebook each time** so that there is no caching of previous results
6666
- **Do not run the Jupyter commands from the root `plotly.py/` directory on your machine** because Jupyter may be confused
67-
by metadata from previous Plotly.py builds
67+
by metadata from previous plotly.py builds
6868
6969
Code for testing `go.Figure()`:
7070
```python
@@ -110,7 +110,7 @@ Publishing to PyPI:
110110
```
111111

112112
You will be prompted to enter an API token; this can be generated in your PyPI account settings.
113-
Your account must have permissions to publish to the Plotly project on PyPI.
113+
Your account must have permissions to publish to the `plotly` project on PyPI.
114114

115115
### Update documentation site
116116

@@ -121,9 +121,9 @@ Your account must have permissions to publish to the Plotly project on PyPI.
121121
start by doing it first if not. Then merge `main` into `doc-prod` to deploy the doc related
122122
to features in the release.
123123
3. in a clone of the [`graphing-library-docs` repo](https://github.com/plotly/graphing-library-docs):
124-
1. bump the version of Plotly.py in `_data/pyversion.json`
125-
2. bump the version of Plotly.js with `cd _data && python get_plotschema.py <PLOTLY.JS VERSION>` fixing any errors that come up.
126-
- If Plotly.js contains any new traces or trace or layout attributes, you'll get a warning `“missing key in attributes: <attribute-name>`. To resolve, add the attribute to the relevant section in `/_data/orderings.json` in the position you want it to appear in the reference docs.
124+
1. bump the version of plotly.py in `_data/pyversion.json`
125+
2. bump the version of plotly.js with `cd _data && python get_plotschema.py <PLOTLY.JS VERSION>` fixing any errors that come up.
126+
- If plotly.js contains any new traces or trace or layout attributes, you'll get a warning `“missing key in attributes: <attribute-name>`. To resolve, add the attribute to the relevant section in `/_data/orderings.json` in the position you want it to appear in the reference docs.
127127
3. rebuild the Algolia `schema` index with `ALGOLIA_API_KEY=<key> make update_ref_search`
128128
4. Rebuild the Algolia `python` index with `ALGOLIA_API_KEY=<key> make update_python_search`
129129
5. Commit and push the changes to `master` in that repo

_plotly_utils/basevalidators.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ def fullmatch(regex, string, flags=0):
2222
return re.match("(?:" + regex_string + r")\Z", string, flags=flags)
2323

2424

25+
def to_non_numpy_type(np, v):
26+
"""
27+
Convert a numpy scalar value to a native Python type.
28+
Calling .item() on a datetime64[ns] value returns an integer, since
29+
Python datetimes only support microsecond precision. So we cast
30+
datetime64[ns] to datetime64[us] to ensure it remains a datetime.
31+
32+
Should only be used in contexts where we already know `np` is defined.
33+
"""
34+
if hasattr(v, "dtype") and v.dtype == np.dtype("datetime64[ns]"):
35+
return v.astype("datetime64[us]").item()
36+
return v.item()
37+
38+
2539
# Utility functions
2640
# -----------------
2741
def to_scalar_or_list(v):
@@ -35,12 +49,12 @@ def to_scalar_or_list(v):
3549
np = get_module("numpy", should_load=False)
3650
pd = get_module("pandas", should_load=False)
3751
if np and np.isscalar(v) and hasattr(v, "item"):
38-
return v.item()
52+
return to_non_numpy_type(np, v)
3953
if isinstance(v, (list, tuple)):
4054
return [to_scalar_or_list(e) for e in v]
4155
elif np and isinstance(v, np.ndarray):
4256
if v.ndim == 0:
43-
return v.item()
57+
return to_non_numpy_type(np, v)
4458
return [to_scalar_or_list(e) for e in v]
4559
elif pd and isinstance(v, (pd.Series, pd.Index)):
4660
return [to_scalar_or_list(e) for e in v]

0 commit comments

Comments
 (0)