Skip to content

Commit 8db1fbc

Browse files
authored
Merge branch 'master' into version-6-migration
2 parents eaae154 + c27c49d commit 8db1fbc

File tree

11 files changed

+108
-74
lines changed

11 files changed

+108
-74
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
### Added
6+
- Add `plotly[express]` extra for easily installing Plotly Express dependencies [#4644](https://github.com/plotly/plotly.py/pull/4644)
7+
58
### Removed
69
- Drop deprecated `pointcloud` and `heatmapgl` traces from the API
710
- Drop `tenacity` dependency [#4831](https://github.com/plotly/plotly.js/pull/4831)

contributing.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,17 @@ We will support Python 3.12 and higher versions soon.
136136
[conda-env]: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands
137137
[virtualenv]: http://docs.python-guide.org/en/latest/dev/virtualenvs/
138138

139-
### Install requirements - (Non-Windows)
139+
### Install development requirements (Non-Windows)
140140
```bash
141-
(plotly_dev) $ pip install -r packages/python/plotly/requirements.txt
142-
(plotly_dev) $ pip install -r packages/python/plotly/optional-requirements.txt
141+
(plotly_dev) $ pip install -r packages/python/plotly/requires-optional.txt
143142
```
144-
### Install requirements - (Windows + Conda)
143+
### Install development requirements (Windows + Conda)
145144
Because Windows requires Visual Studio libraries to compile some of the optional dependencies, follow these steps to
146145
complete installation and avoid gdal-config errors.
147146

148147
```bash
149-
(plotly_dev) $ pip install -r packages/python/plotly/requirements.txt
150148
(plotly_dev) $ conda install fiona
151-
(plotly_dev) $ pip install -r packages/python/plotly/optional-requirements.txt
149+
(plotly_dev) $ pip install -r packages/python/plotly/requires-optional.txt
152150
```
153151

154152
### Editable install of plotly packages
@@ -178,7 +176,7 @@ documentation on _development mode_.
178176
This repo uses the [Black](https://black.readthedocs.io/en/stable/) code formatter,
179177
and the [pre-commit](https://pre-commit.com/) library to manage a git commit hook to
180178
run Black prior to each commit. Both pre-commit and black are included in the
181-
`packages/python/plotly/optional-requirements.txt` file, so you should have them
179+
`packages/python/plotly/requires-optional.txt` file, so you should have them
182180
installed already if you've been following along.
183181

184182
To enable the Black formatting git hook, run the following from within your virtual
@@ -266,7 +264,7 @@ We take advantage of two tools to run tests:
266264

267265
### Running Tests with `pytest`
268266

269-
Since our tests cover *all* the functionality, to prevent tons of errors from showing up and having to parse through a messy output, you'll need to install `optional-requirements.txt` as explained above.
267+
Since our tests cover *all* the functionality, to prevent tons of errors from showing up and having to parse through a messy output, you'll need to install `requires-optional.txt` as explained above.
270268

271269
After you've done that, go ahead and run the test suite!
272270

packages/python/plotly/MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ include LICENSE.txt
22
include README.md
33
include versioneer.py
44
include plotly/_version.py
5+
include requires-install.txt
6+
include requires-express.txt
57
include plotly/package_data/widgetbundle.js

packages/python/plotly/optional-requirements.txt

Lines changed: 0 additions & 58 deletions
This file was deleted.

packages/python/plotly/plotly/express/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,24 @@
22
`plotly.express` is a terse, consistent, high-level wrapper around `plotly.graph_objects`
33
for rapid data exploration and figure generation. Learn more at https://plotly.com/python/plotly-express/
44
"""
5+
56
from plotly import optional_imports
67

78
np = optional_imports.get_module("numpy")
89
if np is None:
910
raise ImportError(
1011
"""\
11-
Plotly express requires numpy to be installed."""
12+
Plotly Express requires numpy to be installed. You can install numpy using pip with:
13+
14+
$ pip install numpy
15+
16+
Or install Plotly Express and its dependencies directly with:
17+
18+
$ pip install "plotly[express]"
19+
20+
You can also use Plotly Graph Objects to create a large number of charts without installing
21+
numpy. See examples here: https://plotly.com/python/graph-objects/
22+
"""
1223
)
1324

1425
from ._imshow import imshow

packages/python/plotly/plotly/express/_core.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,9 +1486,8 @@ def build_dataframe(args, constructor):
14861486
# PySpark to pandas.
14871487
is_pd_like = False
14881488

1489-
# Flag that indicates if data_frame requires to be converted to arrow via the
1490-
# dataframe interchange protocol.
1491-
# True if Ibis, DuckDB, Vaex or implements __dataframe__
1489+
# Flag that indicates if data_frame needs to be converted to PyArrow.
1490+
# True if Ibis, DuckDB, Vaex, or implements __dataframe__
14921491
needs_interchanging = False
14931492

14941493
# If data_frame is provided, we parse it into a narwhals DataFrame, while accounting

packages/python/plotly/plotly/tests/test_optional/test_utils/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def np_inf():
9595
columns=["col 1"], data=[1, 2, 3, dt(2014, 1, 5), pd.NaT, np_nan(), np_inf()]
9696
)
9797

98-
rng = pd.date_range("1/1/2011", periods=2, freq="H")
98+
rng = pd.date_range("1/1/2011", periods=2, freq="h")
9999
ts = pd.Series([1.5, 2.5], index=rng)
100100

101101

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### Required dependencies for Plotly Express ###
2+
### ###
3+
### To install, run: ###
4+
### $ pip install -r requires-express.txt ###
5+
### ###
6+
###################################################
7+
8+
numpy
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
### Dependencies for Core Plotly Functionality ###
22
### ###
33
### To install, run: ###
4-
### $ pip install -r requirements.txt ###
4+
### $ pip install -r requires-install.txt ###
55
### ###
66
###################################################
77

88
## dataframe agnostic layer ##
99
narwhals>=1.13.3
10+
packaging
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
### Optional Dependencies for Additional Plotly Functionality ###
2+
### ###
3+
### This file lists packages which are not strictly required ###
4+
### by Plotly.py, but which are needed to use some of the ###
5+
### library's functionality. See headings below for more ###
6+
### See headings below for more detail. ###
7+
### ###
8+
### Packages used in the development process are also listed ###
9+
### here. ###
10+
### ###
11+
### To install, run: ###
12+
### $ pip install -r requires-optional.txt ###
13+
### ###
14+
###################################################################
15+
16+
## numpy (required by Plotly Express) ##
17+
numpy
18+
19+
## matplotlylib dependencies ##
20+
# matplotlib==2.2.2
21+
22+
## testing dependencies ##
23+
coverage==4.3.1
24+
mock==2.0.0
25+
pytest==8.1.1
26+
xarray
27+
pytz
28+
29+
## orca dependencies ##
30+
requests
31+
psutil
32+
33+
## code formatting ##
34+
pre-commit
35+
black==22.3.0
36+
37+
## codegen dependencies ##
38+
inflect
39+
40+
## template generation ##
41+
colorcet
42+
43+
## pandas (for some matplotlib functionality) ##
44+
pandas
45+
46+
## scipy deps (for some Figure Factory functions) ##
47+
scipy
48+
49+
## jupyter ##
50+
jupyter
51+
anywidget
52+
53+
## deps for _county_choropleth.py (Figure Factory) ##
54+
pyshp
55+
geopandas
56+
shapely
57+
58+
## image uri conversion ##
59+
pillow

0 commit comments

Comments
 (0)