8000 Merge branch 'master' of https://github.com/plotly/python-api into co… · henrypan/python-api@656d4ce · GitHub
[go: up one dir, main page]

Skip to content

Commit 656d4ce

Browse files
committed
Merge branch 'master' of https://github.com/plotly/python-api into config_plot_option
2 parents 93234cb + afe8b56 commit 656d4ce

File tree

93 files changed

+2444
-779
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2444
-779
lines changed

circle.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ machine:
22
environment:
33
PLOTLY_PACKAGE_ROOT: /home/ubuntu/python-api
44
PLOTLY_CONFIG_DIR: ${HOME}/.plotly
5-
PLOTLY_PYTHON_VERSIONS: 2.6.8 2.7.8 3.3.3 3.4.1
5+
PLOTLY_PYTHON_VERSIONS: 2.7.8 3.3.3 3.4.1
66
PLOTLY_CORE_REQUIREMENTS_FILE: ${PLOTLY_PACKAGE_ROOT}/requirements.txt
77
PLOTLY_OPTIONAL_REQUIREMENTS_FILE: ${PLOTLY_PACKAGE_ROOT}/optional-requirements.txt
8-
PLOTLY_OPTIONAL_REQUIREMENTS_FILE_2_6: ${PLOTLY_PACKAGE_ROOT}/optional-requirements-2-6.txt
98
dependencies:
109
override:
1110

circle/setup.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,8 @@ for version in ${PLOTLY_PYTHON_VERSIONS[@]}; do
3333
pip install -r ${PLOTLY_CORE_REQUIREMENTS_FILE} ||
3434
error_exit "${LINENO}: can't install core reqs for Python ${version}"
3535

36-
# handle funkiness around python 2.6
37-
if [ ${version:0:3} == '2.6' ]
38-
then
39-
pip install -e '.[PY2.6]' ||
40-
error_exit "${LINENO}: can't install extras for Python ${version}"
41-
pip install -r ${PLOTLY_OPTIONAL_REQUIREMENTS_FILE_2_6} ||
42-
error_exit "${LINENO}: can't install optional for Python ${version}"
43-
else
44-
pip install -r ${PLOTLY_OPTIONAL_REQUIREMENTS_FILE} ||
45-
error_exit "${LINENO}: can't install optional for Python ${version}"
46-
fi
36+
pip install -r ${PLOTLY_OPTIONAL_REQUIREMENTS_FILE} ||
37+
error_exit "${LINENO}: can't install optional for Python ${version}"
4738

4839
# install some test tools
4940
pip install nose coverage ||

optional-requirements-2-6.txt

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

plotly/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@
2828

2929
from __future__ import absolute_import
3030

31-
from plotly import plotly, graph_objs, grid_objs, tools, utils, session
31+
from plotly import (plotly, graph_objs, grid_objs, tools, utils, session,
32+
offline)
3233
from plotly.version import __version__

plotly/exceptions.py

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,14 @@
1515
1616
1717
"""
18-
import sys
19-
import six
18+
import json
2019

21-
if sys.version[:3] == '2.6':
22-
import simplejson as json
23-
else:
24-
import json
25-
26-
## Base Plotly Error ##
2720

21+
# Base Plotly Error
2822
class PlotlyError(Exception):
2923
pass
3024

3125

32-
3326
class InputError(PlotlyError):
3427
pass
3528

@@ -63,8 +56,7 @@ def __str__(self):
6356
return self.message
6457

6558

66-
## Grid Errors ##
67-
59+
# Grid Errors #
6860
COLUMN_NOT_YET_UPLOADED_MESSAGE = (
6961
"Hm... it looks like your column '{column_name}' hasn't "
7062
"been uploaded to Plotly yet. You need to upload your "
@@ -79,14 +71,14 @@ def __str__(self):
7971
"can't have duplicate column names. Rename "
8072
"the column \"{0}\" and try again."
8173
)
82-
## Would Cause Server Errors ##
74+
75+
# Would Cause Server Errors
8376

8477
class PlotlyEmptyDataError(PlotlyError):
8578
pass
8679

8780

88-
## Graph Objects Errors ##
89-
81+
# Graph Objects Errors
9082
class PlotlyGraphObjectError(PlotlyError):
9183
def __init__(self, message='', path=None, notes=None, plain_message=''):
9284
self.message = message
@@ -202,8 +194,7 @@ def __init__(self, obj='', index='', **kwargs):
202194
**kwargs)
203195

204196

205-
## Local Config Errors ##
206-
197+
# Local Config Errors
207198
class PlotlyLocalError(PlotlyError):
208199
pass
209200

@@ -224,8 +215,7 @@ def __init__(self):
224215
super(PlotlyLocalCredentialsError, self).__init__(message)
225216

226217

227-
## Server Errors ##
228-
218+
# Server Errors
229219
class PlotlyServerError(PlotlyError):
230220
pass
231221

plotly/graph_objs/graph_objs.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,19 @@
2424
"""
2525
from __future__ import absolute_import
2626

27+
import copy
28+
import sys
2729
import warnings
30+
from collections import OrderedDict
31+
2832
import six
33+
34+
from plotly import exceptions, utils
2935
from plotly.graph_objs import graph_objs_tools
3036
from plotly.graph_objs.graph_objs_tools import (
3137
INFO, OBJ_MAP, NAME_TO_KEY, KEY_TO_NAME
3238
)
3339

34-
from plotly import exceptions
35-
from plotly import utils
36-
37-
import copy
38-
import sys
39-
if sys.version[:3] == '2.6':
40-
from ordereddict import OrderedDict
41-
else:
42-
from collections import OrderedDict
43-
4440
__all__ = None
4541

4642

plotly/graph_objs/graph_objs_tools.py

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
11
from __future__ import absolute_import
2-
from plotly import utils
3-
import textwrap
2+
3+
import json
44
import os
5-
import sys
6-
if sys.version[:3] == '2.6':
7-
try:
8-
from ordereddict import OrderedDict
9-
import simplejson as json
10-
except ImportError:
11-
raise ImportError(
12-
"Looks like you're running Python 2.6. Plotly expects newer "
13-
"standard library versions of ordereddict and json. You can "
14-
"simply upgrade with these 'extras' with the following terminal "
15-
"command:\npip install 'plotly[PY2.6]'"
16-
)
17-
else:
18-
from collections import OrderedDict
19-
import json
5+
import textwrap
6+
from collections import OrderedDict
7+
from pkg_resources import resource_string
8+
209
import six
2110

22-
from pkg_resources import resource_string
11+
from plotly import utils
2312

2413

2514
# Define graph reference loader

plotly/grid_objs/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
=========
44
55
"""
6+
from __future__ import absolute_import
67

7-
8-
from . grid_objs import Grid, Column
8+
from plotly.grid_objs.grid_objs import Grid, Column

plotly/grid_objs/grid_objs.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,10 @@
55
"""
66
from __future__ import absolute_import
77

8-
import sys
8+
import json
99
from collections import MutableSequence
10-
from plotly import exceptions
11-
from plotly import utils
1210

13-
if sys.version[:3] == '2.6':
14-
import simplejson as json
15-
else:
16-
import json
11+
from plotly import exceptions, utils
1712

1813
__all__ = None
1914

plotly/matplotlylib/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@
99
'tools' module or 'plotly' package.
1010
1111
"""
12-
from . renderer import PlotlyRenderer
13-
from . mplexporter import Exporter
12+
from __future__ import absolute_import
13+
14+
from plotly.matplotlylib.renderer import PlotlyRenderer
15+
from plotly.matplotlylib.mplexporter import Exporter

0 commit comments

Comments
 (0)
0