From 51156328407b544683510ec10aa20e0e84b53e21 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 20 Apr 2021 15:04:51 -0400 Subject: [PATCH 01/11] latex docs --- doc/python/LaTeX.md | 68 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 doc/python/LaTeX.md diff --git a/doc/python/LaTeX.md b/doc/python/LaTeX.md new file mode 100644 index 00000000000..7070cbf2d95 --- /dev/null +++ b/doc/python/LaTeX.md @@ -0,0 +1,68 @@ +--- +jupyter: + jupytext: + notebook_metadata_filter: all + text_representation: + extension: .md + format_name: markdown + format_version: '1.2' + jupytext_version: 1.4.2 + kernelspec: + display_name: Python 3 + language: python + name: python3 + language_info: + codemirror_mode: + name: ipython + version: 3 + file_extension: .py + mimetype: text/x-python + name: python + nbconvert_exporter: python + pygments_lexer: ipython3 + version: 3.7.7 + plotly: + description: How to add LaTeX to python graphs. + display_as: advanced_opt + language: python + layout: base + name: LaTeX + order: 5 + page_type: example_index + permalink: python/LaTeX/ + thumbnail: thumbnail/latex.jpg +--- + +#### LaTeX Typesetting + +```python +import plotly.express as px + +fig = px.line(x=[1, 2, 3, 4], y=[1, 4, 9, 16], title=r'$\alpha_{1c} = 352 \pm 11 \text{ km s}^{-1}$') +fig.update_layout( + xaxis_title=r'$\sqrt{(n_\text{c}(t|{T_\text{early}}))}$', + yaxis_title=r'$d, r \text{ (solar radius)}$' +) +fig.show() +``` + +```python +import plotly.graph_objs as go + +fig = go.Figure() +fig.add_trace(go.Scatter( + x=[1, 2, 3, 4], + y=[1, 4, 9, 16], + name=r'$\alpha_{1c} = 352 \pm 11 \text{ km s}^{-1}$' +)) +fig.add_trace(go.Scatter( + x=[1, 2, 3, 4], + y=[0.5, 2, 4.5, 8], + name=r'$\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$' +)) +fig.update_layout( + xaxis_title=r'$\sqrt{(n_\text{c}(t|{T_\text{early}}))}$', + yaxis_title=r'$d, r \text{ (solar radius)}$' +) +fig.show() +``` From fbde6d88fad72fd493c7b8e7f57648b0da0ca44a Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 20 Apr 2021 16:48:04 -0400 Subject: [PATCH 02/11] pin down some deps --- doc/requirements.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 14257257cd5..4f27999a084 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,6 +1,6 @@ plotly==4.14.3 jupytext==1.1.1 -jupyter +jupyter==2 notebook pandas==1.0.3 statsmodels==0.11.1 @@ -16,18 +16,18 @@ psutil requests networkx squarify -scikit-image -scikit-learn +scikit-image==0.17.2 +scikit-learn==0.23.1 sphinx sphinx_bootstrap_theme recommonmark pathlib -python-frontmatter +python-frontmatter==0.5.0 datashader pyarrow cufflinks==0.17.3 kaleido -umap-learn -pooch +umap-learn==0.4.6 +pooch==1.2.0 wget nbconvert==5.6.1 From 9780a9a13c5c55a3eb94a9af7ab8ab5823ad2e6e Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 20 Apr 2021 16:53:20 -0400 Subject: [PATCH 03/11] pin down some deps --- doc/python/ml-tsne-umap-projections.md | 4 ++-- doc/requirements.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/python/ml-tsne-umap-projections.md b/doc/python/ml-tsne-umap-projections.md index 683897eb8c4..dfd7d78d866 100644 --- a/doc/python/ml-tsne-umap-projections.md +++ b/doc/python/ml-tsne-umap-projections.md @@ -5,8 +5,8 @@ jupyter: text_representation: extension: .md format_name: markdown - format_version: '1.1' - jupytext_version: 1.1.1 + format_version: '1.2' + jupytext_version: 1.4.2 kernelspec: display_name: Python 3 language: python diff --git a/doc/requirements.txt b/doc/requirements.txt index 4f27999a084..004d6363bbf 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,6 +1,6 @@ plotly==4.14.3 jupytext==1.1.1 -jupyter==2 +jupyter notebook pandas==1.0.3 statsmodels==0.11.1 From fcc1d65a1e45113c4ff5f0784ee6ad4437fb2e4a Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 20 Apr 2021 16:55:32 -0400 Subject: [PATCH 04/11] pin down some deps --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 004d6363bbf..25a1026b3d5 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -6,7 +6,7 @@ pandas==1.0.3 statsmodels==0.11.1 scipy==1.3.1 patsy==0.5.1 -numpy==1.16.0 +numpy plotly-geo python-igraph geopandas==0.8.1 From b8c823d4fdea61b569db997c69005e54945989f5 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 20 Apr 2021 17:10:03 -0400 Subject: [PATCH 05/11] revert dep changes --- doc/requirements.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 25a1026b3d5..14257257cd5 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -6,7 +6,7 @@ pandas==1.0.3 statsmodels==0.11.1 scipy==1.3.1 patsy==0.5.1 -numpy +numpy==1.16.0 plotly-geo python-igraph geopandas==0.8.1 @@ -16,18 +16,18 @@ psutil requests networkx squarify -scikit-image==0.17.2 -scikit-learn==0.23.1 +scikit-image +scikit-learn sphinx sphinx_bootstrap_theme recommonmark pathlib -python-frontmatter==0.5.0 +python-frontmatter datashader pyarrow cufflinks==0.17.3 kaleido -umap-learn==0.4.6 -pooch==1.2.0 +umap-learn +pooch wget nbconvert==5.6.1 From 9455247fc2889d69b349c4ee82273be96279aab6 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 20 Apr 2021 19:33:46 -0400 Subject: [PATCH 06/11] pin down some deps --- doc/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 14257257cd5..bf177122f2c 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -6,7 +6,7 @@ pandas==1.0.3 statsmodels==0.11.1 scipy==1.3.1 patsy==0.5.1 -numpy==1.16.0 +numpy==1.19.5 plotly-geo python-igraph geopandas==0.8.1 @@ -27,7 +27,7 @@ datashader pyarrow cufflinks==0.17.3 kaleido -umap-learn -pooch +umap-learn==0.5.1 +pooch==1.2.0 wget nbconvert==5.6.1 From 2b28860a5c666b6571a1a8fc5e3c926d5b468705 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 20 Apr 2021 19:46:57 -0400 Subject: [PATCH 07/11] pin down some deps --- doc/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index bf177122f2c..6e2f295857a 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -16,7 +16,7 @@ psutil requests networkx squarify -scikit-image +scikit-image==0.18.1 scikit-learn sphinx sphinx_bootstrap_theme @@ -28,6 +28,6 @@ pyarrow cufflinks==0.17.3 kaleido umap-learn==0.5.1 -pooch==1.2.0 +pooch wget nbconvert==5.6.1 From bcc51a24e42d240be94504fb6cca4015c38a41ee Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 20 Apr 2021 19:58:02 -0400 Subject: [PATCH 08/11] imshow --- doc/python/imshow.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/doc/python/imshow.md b/doc/python/imshow.md index cf8639a65dd..1ca97b4b5f9 100644 --- a/doc/python/imshow.md +++ b/doc/python/imshow.md @@ -412,9 +412,7 @@ See the [tutorial on facet plots](/python/facet-plots/) for more information on ```python import plotly.express as px from skimage import io -from skimage.data import image_fetcher -path = image_fetcher.fetch('data/cells.tif') -data = io.imread(path) +data = io.imread("https://github.com/scikit-image/skimage-tutorials/raw/main/images/cells.tif") img = data[20:45:2] fig = px.imshow(img, facet_col=0, binary_string=True, facet_col_wrap=5) fig.show() @@ -446,9 +444,7 @@ For three-dimensional image datasets, obtained for example by MRI or CT in medic ```python import plotly.express as px from skimage import io -from skimage.data import image_fetcher -path = image_fetcher.fetch('data/cells.tif') -data = io.imread(path) +data = io.imread("https://github.com/scikit-image/skimage-tutorials/raw/main/images/cells.tif") img = data[25:40] fig = px.imshow(img, animation_frame=0, binary_string=True, labels=dict(animation_frame="slice")) fig.show() @@ -476,9 +472,7 @@ It is possible to view 4-dimensional datasets (for example, 3-D images evolving ```python import plotly.express as px from skimage import io -from skimage.data import image_fetcher -path = image_fetcher.fetch('data/cells.tif') -data = io.imread(path) +data = io.imread("https://github.com/scikit-image/skimage-tutorials/raw/main/images/cells.tif") data = data.reshape((15, 4, 256, 256))[5:] fig = px.imshow(data, animation_frame=0, facet_col=1, binary_string=True) fig.show() From 309217ceb03ce72e036680d2bc5180dd09d72838 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 20 Apr 2021 20:24:30 -0400 Subject: [PATCH 09/11] jiggling dependencies --- packages/python/plotly/setup.py | 2 +- packages/python/plotly/tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/python/plotly/setup.py b/packages/python/plotly/setup.py index 395111c03e9..b7df3e2ba64 100644 --- a/packages/python/plotly/setup.py +++ b/packages/python/plotly/setup.py @@ -245,7 +245,7 @@ def get_latest_publish_build_info(repo, branch): builds = [ j for j in branch_jobs - if j.get("workflows", {}).get("job_name", None) == "publish" + if j.get("workflows", {}).get("job_name", None) == "publish-dist" and j.get("status", None) == "success" ] build = builds[0] diff --git a/packages/python/plotly/tox.ini b/packages/python/plotly/tox.ini index 72169192a08..16d6a9fd1da 100644 --- a/packages/python/plotly/tox.ini +++ b/packages/python/plotly/tox.ini @@ -63,7 +63,7 @@ deps= pillow==5.2.0 backports.tempfile==1.0 optional: --editable=file:///{toxinidir}/../plotly-geo - optional: numpy==1.16.5 + optional: numpy==1.19.5 optional: ipython[all]==5.1.0 optional: ipywidgets==7.2.0 optional: ipykernel==4.8.2 From b4452474aafa9ff2cdd05dd2de0f7869e67c0475 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 20 Apr 2021 20:29:28 -0400 Subject: [PATCH 10/11] jiggling dependencies --- packages/python/plotly/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/plotly/tox.ini b/packages/python/plotly/tox.ini index 16d6a9fd1da..635cd9478c3 100644 --- a/packages/python/plotly/tox.ini +++ b/packages/python/plotly/tox.ini @@ -58,12 +58,12 @@ deps= retrying==1.3.3 pytest==3.5.1 pandas==0.24.2 + numpy==1.19.5 xarray==0.10.9 statsmodels==0.10.2 pillow==5.2.0 backports.tempfile==1.0 optional: --editable=file:///{toxinidir}/../plotly-geo - optional: numpy==1.19.5 optional: ipython[all]==5.1.0 optional: ipywidgets==7.2.0 optional: ipykernel==4.8.2 From 4c8556c2521dd8dd09bb44b6542251cfb2a82714 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Tue, 20 Apr 2021 20:35:40 -0400 Subject: [PATCH 11/11] prep for Plotly.js 2.0 --- .../plotly/tests/test_core/test_graph_objs/test_graph_objs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_graph_objs.py b/packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_graph_objs.py index 3b79dd62826..bec7d01feee 100644 --- a/packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_graph_objs.py +++ b/packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_graph_objs.py @@ -7,7 +7,6 @@ "AngularAxis", "Annotation", "Annotations", - "Area", "Bar", "Box", "ColorBar",