Skip to content

Updates for new repo #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run unit tests (Python 3.8)
on: [ push ]

jobs:
python_38_chart_studio:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel
pip install -r ./test_requirements/requirements_38.txt
- name: Run unit tests
run: |
. venv/bin/activate
pytest -x chart_studio/tests/
timeout-minutes: 20

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016-2019 Plotly, Inc
Copyright (c) 2016-2025 Plotly, Inc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# chart-studio
This package contains utilities for interfacing with Plotly's Chart Studio service (both Chart Studio cloud and Chart Studio On-Prem). Prior to plotly.py version 4, This functionality was included in the `plotly` package under the `plotly.plotly` module. As part of plotly.py version 4, the Chart Studio functionality was removed from the `plotly` package and released in this `chart-studio` package.
The chart-studio Python package contains utilities for interfacing with Plotly's Chart Studio service (both Chart Studio cloud and Chart Studio On-Prem).

Prior to plotly.py version 4, these Chart Studio utilities were included in the `plotly` package under the `plotly.plotly` module. As part of plotly.py version 4, the Chart Studio functionality was removed from the `plotly` package and released in this `chart-studio` package.

This repository contains _only_ the chart-studio Python package; code for the Chart Studio service itself is located elsewhere.

_Note: chart-studio was previously housed in the [Plotly.py](https://github.com/plotly/plotly.py) repository [until early 2025](https://github.com/plotly/plotly.py/pull/4972). This repository retains the Git history for all chart-studio files, dating back to [mid-2019](https://github.com/plotly/plotly.py/pull/1604) when the Plotly.py directory structure was changed. If you want to follow the history of these files back further in time, start [here](https://github.com/plotly/plotly.py/commits/59e36cf850bdb2384ddaf40ac37ad79f691c610c/chart-studio-package/README.md?browsing_rename_history=true&new_path=packages/python/chart-studio/README.md&original_branch=master)._
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def test_update(self):
ax.plot([1, 2, 3])
title = "new title"
update = {"layout": {"title": title}}
url = py.plot_mpl(fig, update=update, filename="nosetests", auto_open=False)
# Note: Changed filename from "nosetests" to "nosetests2" because the
# previous filename was resulting in a recurring error --
# `chart_studio.exceptions.PlotlyRequestError: Sorry, a file named 'nosetests_grid' already exists`
url = py.plot_mpl(fig, update=update, filename="nosetests2", auto_open=False)
un = url.replace("https://plotly.com/~", "").split("/")[0]
fid = url.replace("https://plotly.com/~", "").split("/")[1]
pfig = py.get_figure(un, fid)
Expand Down
2 changes: 1 addition & 1 deletion chart_studio/tests/test_optional/test_utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from datetime import datetime as dt
import numpy as np

np_list = np.array([1, 2, 3, np.NaN, np.NAN, np.Inf, dt(2014, 1, 5)])
np_list = np.array([1, 2, 3, np.nan, np.nan, np.inf, dt(2014, 1, 5)])
numeric_list = [1, 2, 3]
mixed_list = [
1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,9 @@ def test_proper_escaping(self):
ak = "786r5mecv0"
url = "https://plotly.com/~PlotlyImageTest/13185/"
py.sign_in(un, ak)
py.get_figure(url)
# Note: raw=True added because the specified chart contains
# the property 'titlefont' which is no longer supported in
# plotly.py 6.0.0, so an error is raised when trying to create
# the chart object. raw=True just returns the raw JSON without
# trying to create the chart object.
py.get_figure(url, raw=True)
46 changes: 46 additions & 0 deletions release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## Release process - `chart-studio` package

The `chart-studio` package contains the utilities for interacting with
Chart Studio (both Cloud or On-Prem).

### Update version

Update the version of the `chart-studio` package in
`setup.py`.

This version is not intended to match the version of plotly.py.

### Update CHANGELOG

Add a new entry to the CHANGELOG at `CHANGELOG.md` and commit the changes.

### Tag Release

Create a new tag for the release

```bash
(plotly_dev) $ git checkout main
(plotly_dev) $ git stash
(plotly_dev) $ git pull origin main
(plotly_dev) $ git tag vX.Y.Z
(plotly_dev) $ git push origin vX.Y.Z
```

### Publishing to PYPI

Publish the final version to PyPI

```bash
(plotly_dev) $ python setup.py sdist bdist_wheel
(plotly_dev) $ twine upload dist/chart_studio-X.Y.Z.tar.gz
(plotly_dev) $ twine upload dist/chart_studio-X.Y.Z-py3-none-any.whl
```

### Publish to plotly anaconda channel

From `packages/python/plotly-geo`, build the conda package
```bash
(plotly_dev) $ conda build recipe/
```

Then upload to the plotly anaconda channel as described above.
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def readme():
maintainer="Jon Mease",
maintainer_email="[email protected]",
url="https://plot.ly/python/",
project_urls={"Github": "https://github.com/plotly/plotly.py"},
project_urls={"Github": "https://github.com/plotly/chart-studio"},
description="Utilities for interfacing with plotly's Chart Studio",
long_description=readme(),
long_description_content_type="text/markdown",
Expand All @@ -28,6 +28,11 @@ def readme():
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Visualization",
],
license="MIT",
Expand Down
11 changes: 0 additions & 11 deletions test_requirements/requirements_37.txt

This file was deleted.

11 changes: 11 additions & 0 deletions test_requirements/requirements_38.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
decorator
nose
requests
pytz
retrying
pytest
pandas
plotly
numpy
anywidget
matplotlib