Skip to content

V4 chart studio extraction #1597

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 34 commits into from
Jun 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
19fe225
Rename chart_studio -> chartstudio and move under chartstudio-package
jonmmease Jun 3, 2019
3afb898
Move plotly package under plotly-package directory
jonmmease Jun 3, 2019
1a76d05
Move codegen, submodules, templategen to plotly-package directory
jonmmease Jun 3, 2019
a24cb7b
Move figure_factory module to separate distribution package
jonmmease Jun 3, 2019
9d524ff
remove unused example images directory
jonmmease Jun 3, 2019
bb02777
plotly-figurefactory-package to plotly-figure-factory-package
jonmmease Jun 3, 2019
315fce6
chartstudio -> chart_studio package name
jonmmease Jun 3, 2019
31d9583
optional import of chart_studio in src validator
jonmmease Jun 3, 2019
c8b566e
Move figure factory tests to plotly-figure-factory-package
jonmmease Jun 3, 2019
ccf1080
Split out plotly/package_data into the appropriate distribution package
jonmmease Jun 3, 2019
d39c29a
Update setup.py packages
jonmmease Jun 3, 2019
c247ab5
Update codegen for new directory structure
jonmmease Jun 3, 2019
1ca95d2
Update setup.py tasks for new directory structure
jonmmease Jun 3, 2019
279d116
Move plotlywidget.json
jonmmease Jun 3, 2019
41da4a5
Add license file per subproject
jonmmease Jun 3, 2019
8836283
Move figure_factory module back into plotly package and extract the
jonmmease Jun 5, 2019
3346a24
Update tox testing config for new directory structure
jonmmease Jun 5, 2019
5f2b0dd
Remove legacy graph_reference module
jonmmease Jun 5, 2019
3ae9c56
Update test_offline to not depend on working directory
jonmmease Jun 5, 2019
8ee5025
Update config.yml test
jonmmease Jun 5, 2019
38032c9
Update test_offline paths
jonmmease Jun 5, 2019
e22f2b6
CI updates
jonmmease Jun 5, 2019
a445a6f
Remove Legacy graph_objs validate function
jonmmease Jun 5, 2019
9c64f2d
Remove plotly.tests import in chart_studio tests
jonmmease Jun 5, 2019
887ada3
Install plotly-geo-package
jonmmease Jun 5, 2019
adc343a
Try again with plotly-geo-package local dependency
jonmmease Jun 5, 2019
f86c1dd
Use local dependency on plotly in tox.ini for chart_studio
jonmmease Jun 5, 2019
066f34b
Fix orca test paths
jonmmease Jun 5, 2019
c6a0419
fix code gen path to plot-schema
jonmmease Jun 5, 2019
1aa2f66
Fix path in orca testing
jonmmease Jun 5, 2019
84b1d2a
Update plotlywidget build paths
jonmmease Jun 5, 2019
ff4a2b2
Fix dev_build paths
jonmmease Jun 5, 2019
d9d9142
fix to_image test paths
jonmmease Jun 5, 2019
df82c4c
Fix write_image paths
jonmmease Jun 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
51 changes: 27 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
command: 'sudo pip install tox'
- run:
name: Test with tox
command: 'tox -e py27-core'
command: 'cd plotly-package; tox -e py27-core'
no_output_timeout: 20m

python-3.5-core:
Expand All @@ -31,7 +31,7 @@ jobs:
command: 'sudo pip install tox'
- run:
name: Test with tox
command: 'tox -e py35-core'
command: 'cd plotly-package; tox -e py35-core'
no_output_timeout: 20m

python-3.6-core:
Expand All @@ -47,7 +47,7 @@ jobs:
command: 'sudo pip install tox'
- run:
name: Test with tox
command: 'tox -e py36-core'
command: 'cd plotly-package; tox -e py36-core'
no_output_timeout: 20m

python-3.7-core:
Expand All @@ -63,7 +63,7 @@ jobs:
command: 'sudo pip install tox'
- run:
name: Test with tox
command: 'tox -e py37-core'
command: 'cd plotly-package; tox -e py37-core'
no_output_timeout: 20m

# Optional
Expand All @@ -80,11 +80,11 @@ jobs:
command: 'sudo pip install tox'
- run:
name: Install npm dependencies
command: cd plotly/tests/test_optional/test_jupyter && npm install
command: cd plotly-package/plotly/tests/test_optional/test_jupyter && npm install
no_output_timeout: 20m
- run:
name: Test with tox
command: 'tox -e py27-optional'
command: 'cd plotly-package; tox -e py27-optional'
no_output_timeout: 20m

python-3.5-optional:
Expand All @@ -100,11 +100,11 @@ jobs:
command: 'sudo pip install tox'
- run:
name: Install npm dependencies
command: cd plotly/tests/test_optional/test_jupyter && npm install
command: cd plotly-package/plotly/tests/test_optional/test_jupyter && npm install
no_output_timeout: 20m
- run:
name: Test with tox
command: 'tox -e py35-optional'
command: 'cd plotly-package; tox -e py35-optional'
no_output_timeout: 20m

python-3.6-optional:
Expand All @@ -120,11 +120,11 @@ jobs:
command: 'sudo pip install tox'
- run:
name: Install npm dependencies
command: cd plotly/tests/test_optional/test_jupyter && npm install
command: cd plotly-package/plotly/tests/test_optional/test_jupyter && npm install
no_output_timeout: 20m
- run:
name: Test with tox
command: 'tox -e py36-optional'
command: 'cd plotly-package; tox -e py36-optional'
no_output_timeout: 20m

python-3.7-optional:
Expand All @@ -140,11 +140,11 @@ jobs:
command: 'sudo pip install tox'
- run:
name: Install npm dependencies
command: cd plotly/tests/test_optional/test_jupyter && npm install
command: cd plotly-package/plotly/tests/test_optional/test_jupyter && npm install
no_output_timeout: 20m
- run:
name: Test with tox
command: 'tox -e py37-optional'
command: 'cd plotly-package; tox -e py37-optional'
no_output_timeout: 20m

# Plot.ly
Expand All @@ -161,7 +161,7 @@ jobs:
command: 'sudo pip install tox'
- run:
name: Test with tox
command: 'tox -e py27-plot_ly'
command: 'cd chart-studio-package; tox -e py27-plot_ly'
no_output_timeout: 20m

python-3.5-plot_ly:
Expand All @@ -177,7 +177,7 @@ jobs:
command: 'sudo pip install tox'
- run:
name: Test with tox
command: 'tox -e py35-plot_ly'
command: 'cd chart-studio-package; tox -e py35-plot_ly'
no_output_timeout: 20m

python-3.7-plot_ly:
Expand All @@ -193,7 +193,7 @@ jobs:
command: 'sudo pip install tox'
- run:
name: Test with tox
command: 'tox -e py37-plot_ly'
command: 'cd chart-studio-package; tox -e py37-plot_ly'
no_output_timeout: 20m

python-2-7-orca:
Expand All @@ -220,8 +220,8 @@ jobs:
command: |
. /home/circleci/miniconda/etc/profile.d/conda.sh
conda activate circle_optional
pytest --disable-warnings plotly/tests/test_core
pytest plotly/tests/test_orca
pytest --disable-warnings plotly-package/plotly/tests/test_core
pytest plotly-package/plotly/tests/test_orca

- store_artifacts:
path: plotly/tests/test_orca/images/linux/failed
Expand Down Expand Up @@ -250,8 +250,8 @@ jobs:
command: |
. /home/circleci/miniconda/etc/profile.d/conda.sh
conda activate circle_optional
pytest --disable-warnings plotly/tests/test_core
pytest plotly/tests/test_orca
pytest --disable-warnings plotly-package/plotly/tests/test_core
pytest plotly-package/plotly/tests/test_orca

- store_artifacts:
path: plotly/tests/test_orca/images/linux/failed
Expand Down Expand Up @@ -280,8 +280,8 @@ jobs:
command: |
. /home/circleci/miniconda/etc/profile.d/conda.sh
conda activate circle_optional
pytest --disable-warnings plotly/tests/test_core
pytest plotly/tests/test_orca
pytest --disable-warnings plotly-package/plotly/tests/test_core
pytest plotly-package/plotly/tests/test_orca

- store_artifacts:
path: plotly/tests/test_orca/images/linux/failed
Expand All @@ -300,19 +300,21 @@ jobs:
command: 'sudo pip install tox requests yapf pytz decorator retrying inflect'
- run:
name: Update plotlywidget version
command: 'python setup.py updateplotlywidgetversion'
command: 'cd plotly-package; python setup.py updateplotlywidgetversion'
- run:
name: Update plotly.js to dev
command: 'python setup.py updateplotlyjsdev'
command: 'cd plotly-package; python setup.py updateplotlyjsdev'
- run:
name: Test with tox
command: |
cd plotly-package
locale
tox -e py37-core -- -a '!nodev'
no_output_timeout: 20m
- run:
name: Commit
command: |
cd plotly-package
sudo mkdir /dist
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
Expand All @@ -322,6 +324,7 @@ jobs:
- run:
name: Build source distribution package
command: |
cd plotly-package
python setup.py sdist
sudo cp dist/* /dist
when: always
Expand All @@ -334,7 +337,7 @@ jobs:
sudo cp ./plotlywidget* /dist
when: always
- store_artifacts:
path: /dist
path: plotly-package/dist

workflows:
version: 2
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ plotly.egg-info/

plotly/tests/test_orca/images/*/failed
plotly/tests/test_orca/images/*/tmp
/plotly-package/plotly/tests/test_core/test_offline/plotly.min.js
/plotly-package/plotly/tests/test_core/test_offline/temp-plot.html
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@

import _plotly_utils.utils
from chart_studio.grid_objs import Column
from plotly import utils
from plotly.tests.test_optional.test_utils.test_utils import numeric_list, \
mixed_list, np_list
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)])
numeric_list = [1, 2, 3]
mixed_list = [1, 'A', dt(2014, 1, 5), dt(2014, 1, 5, 1, 1, 1),
dt(2014, 1, 5, 1, 1, 1, 1)]


class TestJSONEncoder(TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ def stash_session(self):

def restore_session(self):
session._session.clear() # clear and update to preserve references.
session._session.update(self._session)
session._session.update(self._session)
Original file line number Diff line number Diff line change
Expand Up @@ -396,4 +396,4 @@ def __init__(self, url, width, height):
super(PlotlyDisplay, self).__init__(data=self.embed_code)

def _repr_html_(self):
return self.embed_code
return self.embed_code
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Load JS widget code
# No officially recommended way to do this in any other way
# http://mail.scipy.org/pipermail/ipython-dev/2014-April/013835.html
js_widget_code = pkgutil.get_data('plotly',
js_widget_code = pkgutil.get_data('chart_studio',
'package_data/graphWidget.js'
).decode('utf-8')

Expand Down
51 changes: 51 additions & 0 deletions chart-studio-package/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from setuptools import setup
import os


def readme():
parent_dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(parent_dir, 'README.md')) as f:
return f.read()


setup(
name="chart-studio",
version="1.0.0a1",
author="Chris P",
author_email="[email protected]",
maintainer="Jon Mease",
maintainer_email="[email protected]",
url="https://plot.ly/python/",
project_urls={"Github": "https://github.com/plotly/plotly.py"},
description="An open-source, interactive graphing library for Python",
long_description=readme(),
long_description_content_type="text/markdown",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Scientific/Engineering :: Visualization",
],
license="MIT",
packages=[
"chart_studio",
"chart_studio.api",
"chart_studio.api.v1",
"chart_studio.api.v2",
"chart_studio.dashboard_objs",
"chart_studio.grid_objs",
"chart_studio.plotly",
"chart_studio.plotly.chunked_requests",
"chart_studio.presentation_objs",
"chart_studio.widgets",
],
package_data={'chart_studio': ['package_data/*']},
install_requires=["plotly", "requests", "retrying>=1.3.3", "six"],
zip_safe=False,
)
File renamed without changes.
File renamed without changes.
87 changes: 87 additions & 0 deletions chart-studio-package/tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
; Tox is a testing tool that manages virtualenvs for testing multiple Python
; environments in a consistent/controlled way.

; SETTING ENVIRONMENT VARIABLES AND TOX TESTING VARIABLES
;
; You can limit tox testing to certain environments via the `-e` (envlist)
; command line option:
; tox -e py27-core,py34-core
; OR, you can just set the `TOXENV` environment variable, which is handy:
; TOXENV=py27-core,py34-core
;
; Integrating with the virtualenvs in Circle CI is a bit of a pain. For
; whatever reason the "executable" `python35` (at the time of writing) cannot
; be activated directly. Instead the circle.yml file specifies the actual
; binary directly. Because of this, you too have to set the following env
; variables:
; PLOTLY_TOX_PYTHON_27=python2.7
; PLOTLY_TOX_PYTHON_34=python3.4
; ...
; These will be specific to your machine and may not look like the ones above.
; If you're not testing with all the python versions (see TOXENV above),
; there's no need to install and map other versions.

; PASSING ADDITONAL ARGUMENTS TO TEST COMMANDS
; The {posargs} is tox-specific and passes in any command line args after `--`.
; For example, given the testing command in *this* file:
; nosetests {posargs} -x plotly/tests/test_core
;
; The following command:
; tox -- -a '!slow'
;
; Tells tox to call:
; nosetests -a '!slow' -x plotly/tests/test_core
;
; Which is a nice way to skip slow tests for faster testing cycles.

[tox]
; The py{A,B,C}-{X,Y} generates a matrix of envs:
; pyA-X,pyA-Y,pyB-X,pyB-Y,pyC-X,pyC-Y
envlist = py{27,34,37}-plot_ly

; Note that envs can be targeted by deps using the <target>: dep syntax.
; Only one dep is allowed per line as of the time of writing. The <target>
; can be a `-` (hyphen) concatenated string of the environments to target
; with the given dep.

; These commands are general and will be run for *all* environments.
[testenv]
passenv=PLOTLY_TOX_*
whitelist_externals=
mkdir
deps=
coverage==4.3.1
decorator==4.0.9
mock==2.0.0
nose==1.3.7
requests==2.12.4
six==1.10.0
pytz==2016.10
retrying==1.3.3
pytest==3.5.1
backports.tempfile==1.0
pandas==0.23.2
numpy==1.14.3
ipywidgets==7.2.0
matplotlib==2.2.3
--editable=file:///{toxinidir}/../plotly-package


; Plot.ly environments
[testenv:py27-plot_ly]
basepython={env:PLOTLY_TOX_PYTHON_27:}
commands=
python --version
nosetests {posargs} -x chart_studio/tests/

[testenv:py35-plot_ly]
basepython={env:PLOTLY_TOX_PYTHON_35:}
commands=
python --version
nosetests {posargs} -x chart_studio/tests/

[testenv:py37-plot_ly]
basepython={env:PLOTLY_TOX_PYTHON_37:}
commands=
python --version
nosetests {posargs} -x chart_studio/tests/
Binary file removed example_images/simple_scatter.png
Binary file not shown.
Binary file removed example_images/subplot_methods.png
Binary file not shown.
6 changes: 4 additions & 2 deletions js/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ module.exports = [
entry: './src/extension.js',
output: {
filename: 'extension.js',
path: path.resolve(__dirname, '..', 'plotlywidget', 'static'),
path: path.resolve(
__dirname, '..', 'plotly-package', 'plotlywidget', 'static'),
libraryTarget: 'amd'
}
},
Expand All @@ -34,7 +35,8 @@ module.exports = [
entry: './src/index.js',
output: {
filename: 'index.js',
path: path.resolve(__dirname, '..', 'plotlywidget', 'static'),
path: path.resolve(
__dirname, '..', 'plotly-package', 'plotlywidget', 'static'),
libraryTarget: 'amd'
},
node: {
Expand Down
Loading