Skip to content

Commit 0b0cc22

Browse files
authored
Merge pull request #4492 from plotly/update-python-versions
Update python versions
2 parents 95cc3d0 + ca597f9 commit 0b0cc22

20 files changed

+213
-80
lines changed

Diff for: .circleci/config.yml

+55-38
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ commands:
77
test_core:
88
parameters:
99
py:
10-
default: "36"
10+
default: "310"
1111
type: string
1212
steps:
1313
- checkout
@@ -32,7 +32,7 @@ commands:
3232
test_optional:
3333
parameters:
3434
py:
35-
default: "36"
35+
default: "310"
3636
type: string
3737
steps:
3838
- checkout
@@ -95,7 +95,7 @@ commands:
9595
test_orca:
9696
parameters:
9797
py:
98-
default: "36"
98+
default: "310"
9999
type: string
100100
steps:
101101
- checkout
@@ -153,20 +153,6 @@ jobs:
153153
black --check . --exclude venv
154154
155155
# Core
156-
python_36_core:
157-
docker:
158-
- image: cimg/python:3.6-browsers
159-
steps:
160-
- test_core:
161-
py: "36"
162-
163-
python_37_core:
164-
docker:
165-
- image: cimg/python:3.7-browsers
166-
steps:
167-
- test_core:
168-
py: "37"
169-
170156
python_38_core:
171157
docker:
172158
- image: cimg/python:3.8-browsers
@@ -181,20 +167,28 @@ jobs:
181167
- test_core:
182168
py: "39"
183169

184-
# Optional
185-
python_36_optional:
170+
python_310_core:
186171
docker:
187-
- image: cimg/python:3.6-browsers
172+
- image: cimg/python:3.10-browsers
188173
steps:
189-
- test_optional:
190-
py: "36"
174+
- test_core:
175+
py: "310"
191176

192-
python_37_optional:
177+
python_311_core:
193178
docker:
194-
- image: cimg/python:3.7-browsers
179+
- image: cimg/python:3.11-browsers
195180
steps:
196-
- test_optional:
197-
py: "37"
181+
- test_core:
182+
py: "311"
183+
184+
python_312_core:
185+
docker:
186+
- image: cimg/python:3.12-browsers
187+
steps:
188+
- test_core:
189+
py: "312"
190+
191+
# Optional
198192

199193
python_38_optional:
200194
docker:
@@ -210,6 +204,27 @@ jobs:
210204
- test_optional:
211205
py: "39"
212206

207+
python_310_optional:
208+
docker:
209+
- image: cimg/python:3.10-browsers
210+
steps:
211+
- test_optional:
212+
py: "310"
213+
214+
python_311_optional:
215+
docker:
216+
- image: cimg/python:3.11-browsers
217+
steps:
218+
- test_optional:
219+
py: "311"
220+
221+
python_312_optional:
222+
docker:
223+
- image: cimg/python:3.12-browsers
224+
steps:
225+
- test_optional:
226+
py: "312"
227+
213228
# Pandas
214229

215230
python_39_pandas_2_optional:
@@ -228,7 +243,7 @@ jobs:
228243
py: "38"
229244

230245
# Percy
231-
python_37_percy:
246+
python_39_percy:
232247
docker:
233248
- image: cimg/python:3.9-browsers
234249
environment:
@@ -277,9 +292,9 @@ jobs:
277292
rm test/percy/*.html
278293
279294
# Chart studio
280-
python_37_chart_studio:
295+
python_38_chart_studio:
281296
docker:
282-
- image: cimg/python:3.7
297+
- image: cimg/python:3.8
283298
resource_class: large
284299

285300
steps:
@@ -291,7 +306,7 @@ jobs:
291306
python -m venv venv
292307
. venv/bin/activate
293308
pip install --upgrade pip wheel
294-
pip install -r ./test_requirements/requirements_37.txt
309+
pip install -r ./test_requirements/requirements_38.txt
295310
- run:
296311
name: Tests
297312
command: |
@@ -302,7 +317,7 @@ jobs:
302317

303318
plotlyjs_dev_build:
304319
docker:
305-
- image: cimg/python:3.7-node
320+
- image: cimg/python:3.8-node
306321
environment:
307322
LANG: en_US.UTF-8
308323
resource_class: large
@@ -316,7 +331,7 @@ jobs:
316331
python -m venv venv
317332
. venv/bin/activate
318333
pip install --upgrade pip wheel
319-
pip install -r ./test_requirements/requirements_37_core.txt black inflect
334+
pip install -r ./test_requirements/requirements_38_core.txt black inflect
320335
pip install jupyterlab~=3.0
321336
- run:
322337
name: Update jupyterlab-plotly version
@@ -433,7 +448,7 @@ jobs:
433448
docker:
434449
# specify the version you desire here
435450
# use `-browsers` prefix for selenium tests, for example, `3.6.1-browsers`
436-
- image: cimg/python:3.7-browsers
451+
- image: cimg/python:3.9-browsers
437452

438453
steps:
439454
- add_ssh_keys:
@@ -570,15 +585,17 @@ workflows:
570585

571586
build:
572587
jobs:
573-
- python_36_core
574-
- python_37_core
575588
- python_38_core
576589
- python_39_core
577-
- python_36_optional
578-
- python_37_optional
590+
- python_310_core
591+
- python_311_core
592+
- python_312_core
579593
- python_38_optional
580594
- python_39_optional
595+
- python_310_optional
596+
- python_311_optional
597+
- python_312_optional
581598
- python_39_pandas_2_optional
582599
- python_38_orca
583-
- python_37_percy
600+
- python_39_percy
584601
- build-doc

Diff for: CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## [UNRELEASED]
66

7+
### Updated
8+
- Removed Python 3.6 and Python 3.7 support [[#4492](https://github.com/plotly/plotly.py/pull/4492)]
9+
710
### Fixed
811
- Ensure scatter `mode` is deterministic from `px` [[#4429](https://github.com/plotly/plotly.py/pull/4429)]
912
- Fix issue with creating dendrogram in subplots [[#4411](https://github.com/plotly/plotly.py/pull/4411)],

Diff for: binder/requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ jupytext
22
plotly==5.18.0
33
jupyter
44
notebook
5-
pandas==1.0.3
6-
statsmodels==0.11.1
5+
pandas==1.2.0
6+
statsmodels==0.12.1
77
scipy
88
patsy==0.5.1
99
numpy

Diff for: doc/python/county-choropleth.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ Run the following commands to install the correct versions of the following modu
4747

4848
```python
4949
!pip install plotly-geo==1.0.0
50-
!pip install geopandas==0.3.0
51-
!pip install pyshp==1.2.10
52-
!pip install shapely==1.6.3
50+
!pip install geopandas==0.8.1
51+
!pip install pyshp==2.1.2
52+
!pip install shapely==1.7.1
5353
```
5454

5555
If you are using Windows, follow this post to properly install geopandas and dependencies: http://geoffboeing.com/2014/09/using-geopandas-windows/. If you are using Anaconda, do not use PIP to install the packages above. Instead use conda to install them:

Diff for: doc/python/ml-pca.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.3'
9-
jupytext_version: 1.14.1
9+
jupytext_version: 1.16.1
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.8.8
23+
version: 3.10.11
2424
plotly:
2525
description: Visualize Principle Component Analysis (PCA) of your high-dimensional
2626
data in Python with Plotly.
@@ -105,17 +105,17 @@ fig.show()
105105

106106
When you will have too many features to visualize, you might be interested in only visualizing the most relevant components. Those components often capture a majority of the [explained variance](https://en.wikipedia.org/wiki/Explained_variation), which is a good way to tell if those components are sufficient for modelling this dataset.
107107

108-
In the example below, our dataset contains 10 features, but we only select the first 4 components, since they explain over 99% of the total variance.
108+
In the example below, our dataset contains 8 features, but we only select the first 2 components.
109109

110110
```python
111111
import pandas as pd
112112
import plotly.express as px
113113
from sklearn.decomposition import PCA
114-
from sklearn.datasets import load_boston
114+
from sklearn.datasets import fetch_california_housing
115115

116-
boston = load_boston()
117-
df = pd.DataFrame(boston.data, columns=boston.feature_names)
118-
n_components = 4
116+
housing = fetch_california_housing(as_frame=True)
117+
df = housing.data
118+
n_components = 2
119119

120120
pca = PCA(n_components=n_components)
121121
components = pca.fit_transform(df)
@@ -127,7 +127,7 @@ labels['color'] = 'Median Price'
127127

128128
fig = px.scatter_matrix(
129129
components,
130-
color=boston.target,
130+
color=housing.target,
131131
dimensions=range(n_components),
132132
labels=labels,
133133
title=f'Total Explained Variance: {total_var:.2f}%',

Diff for: doc/python/ml-regression.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.3'
9-
jupytext_version: 1.14.1
9+
jupytext_version: 1.16.1
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.8.8
23+
version: 3.10.0
2424
plotly:
2525
description: Visualize regression in scikit-learn with Plotly.
2626
display_as: ai_ml
@@ -412,6 +412,7 @@ import pandas as pd
412412
import plotly.express as px
413413
import plotly.graph_objects as go
414414
from sklearn.linear_model import LassoCV
415+
from sklearn.preprocessing import StandardScaler
415416

416417
N_FOLD = 6
417418

@@ -421,9 +422,13 @@ X = df.drop(columns=['lifeExp', 'iso_num'])
421422
X = pd.get_dummies(X, columns=['country', 'continent', 'iso_alpha'])
422423
y = df['lifeExp']
423424

425+
# Normalize the data
426+
scaler = StandardScaler()
427+
X_scaled = scaler.fit_transform(X)
428+
424429
# Train model to predict life expectancy
425-
model = LassoCV(cv=N_FOLD, normalize=True)
426-
model.fit(X, y)
430+
model = LassoCV(cv=N_FOLD)
431+
model.fit(X_scaled, y)
427432
mean_alphas = model.mse_path_.mean(axis=-1)
428433

429434
fig = go.Figure([

Diff for: doc/requirements.txt

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ ipywidgets==7.7.2
44
jupyter-client<7
55
jupyter
66
notebook
7-
pandas==1.0.3
8-
statsmodels==0.11.1
9-
scipy==1.3.1
7+
pandas==1.2.0
8+
statsmodels==0.12.1
9+
scipy==1.5.4
1010
patsy==0.5.1
1111
numpy==1.19.5
1212
plotly-geo
@@ -16,7 +16,7 @@ pyshp==2.1.2
1616
shapely==1.7.1
1717
psutil
1818
requests
19-
networkx
19+
networkx==2.6.3
2020
squarify
2121
scikit-image==0.18.1
2222
scikit-learn
@@ -25,7 +25,7 @@ sphinx_bootstrap_theme
2525
recommonmark
2626
pathlib
2727
python-frontmatter
28-
datashader
28+
datashader==0.14.4
2929
pyarrow
3030
cufflinks==0.17.3
3131
kaleido
@@ -38,3 +38,4 @@ dash-bio
3838
jinja2<3.1
3939
parmed<=3.4.4; python_version<"3.8"
4040
polars
41+
dask==2022.2.0

0 commit comments

Comments
 (0)