Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cleaner import checking #317

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

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
81fd207
Move `FigureFactory`/etc. into graph_objs package.
theengineear Oct 2, 2015
0c70300
Un-protect the `graph_objs` imports.
theengineear Oct 2, 2015
3bf507a
Add utf-8 encoding for ‘∩’ character in a comment?
theengineear Oct 2, 2015
4c6603f
pep:8ball: extra blank line
theengineear Oct 2, 2015
8b95a0b
Change FigureFactory import, auto refact was poor.
theengineear Oct 2, 2015
76d3ba2
Maintain backwards compat, but throw a warning.
theengineear Oct 2, 2015
647a3d3
More pep:8ball:
theengineear Oct 2, 2015
b0a02bd
:dolls: fixes.
theengineear Oct 2, 2015
4363436
A quick :cow2:-tip on unnecessary parentheses.
theengineear Oct 2, 2015
f3b7821
removing variables that are defined and not used.
theengineear Oct 2, 2015
33534cf
Fix mutable default args in call signature.
theengineear Oct 2, 2015
1192f62
Stop using dynamically-defined objects.
theengineear Oct 2, 2015
6428683
Return a `Figure` object from `create_dendrogram`.
theengineear Oct 2, 2015
e685d70
Fix suggested import to please the :dolls:
theengineear Oct 2, 2015
08c6dd1
Remove commented-out Distplot test.
theengineear Oct 2, 2015
6dba45a
Remove commented-out Distplot test.
theengineear Oct 2, 2015
62263b7
Merge branch 'move-figure-factory' into cleaner-import-checking
theengineear Oct 2, 2015
7cbd355
Add an `optional_imports` module.
theengineear Oct 2, 2015
25d334f
Refact all our `_*_imported` code \o/
theengineear Oct 2, 2015
03216fa
Remove duplicate `arrow_len` declaration.
theengineear Oct 2, 2015
5df9cad
Merge branch 'move-figure-factory' into cleaner-import-checking
theengineear Oct 2, 2015
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
Prev Previous commit
Next Next commit
Un-protect the graph_objs imports.
  • Loading branch information
theengineear committed Oct 2, 2015
commit 0c7030053a4da1c41d681eca4ed9cc39d83aaaa2
16 changes: 1 addition & 15 deletions plotly/graph_objs/figure_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from collections import OrderedDict

from plotly import exceptions
from plotly.graph_objs import graph_objs
from plotly.tools import (_numpy_imported, _scipy_imported,
_scipy__spatial_imported,
_scipy__cluster__hierarchy_imported)
Expand Down Expand Up @@ -274,8 +275,6 @@ def create_quiver(x, y, u, v, scale=.1, arrow_scale=.3,
py.plot(fig, filename='quiver')
```
"""
# TODO: protected until #282
from plotly.graph_objs import graph_objs
FigureFactory._validate_equal_length(x, y, u, v)
FigureFactory._validate_positive_scalars(arrow_scale=arrow_scale,
scale=scale)
Expand Down Expand Up @@ -377,8 +376,6 @@ def create_streamline(x, y, u, v,
py.plot(fig, filename='streamline')
```
"""
# TODO: protected until #282
from plotly.graph_objs import graph_objs
FigureFactory._validate_equal_length(x, y)
FigureFactory._validate_equal_length(u, v)
FigureFactory._validate_streamline(x, y)
Expand Down Expand Up @@ -605,8 +602,6 @@ def create_ohlc(open, high, low, close,
py.iplot(fig, filename='finance/simple-ohlc', validate=False)
```
"""
# TODO: protected until #282
from plotly.graph_objs import graph_objs
if dates is not None:
FigureFactory._validate_equal_length(open, high, low, close, dates)
else:
Expand Down Expand Up @@ -837,8 +832,6 @@ def create_candlestick(open, high, low, close,
py.iplot(fig, filename='finance/simple-candlestick', validate=False)
```
"""
# TODO: protected until #282
from plotly.graph_objs import graph_objs
if dates is not None:
FigureFactory._validate_equal_length(open, high, low, close, dates)
else:
Expand Down Expand Up @@ -982,8 +975,6 @@ def create_distplot(hist_data, group_labels,
validate=False)
```
"""
# TODO: protected until #282
from plotly.graph_objs import graph_objs
FigureFactory._validate_distplot(hist_data, curve_type)
FigureFactory._validate_equal_length(hist_data, group_labels)

Expand Down Expand Up @@ -1831,8 +1822,6 @@ class _Dendrogram(FigureFactory):

def __init__(self, X, orientation='bottom', labels=None, colorscale=None,
width="100%", height="100%", xaxis='xaxis', yaxis='yaxis'):
# TODO: protected until #282
from plotly.graph_objs import graph_objs
self.orientation = orientation
self.labels = labels
self.xaxis = xaxis
Expand Down Expand Up @@ -1979,8 +1968,6 @@ def get_dendrogram_traces(self, X, colorscale):
(e) P['leaves']: left-to-right traversal of the leaves

"""
# TODO: protected until #282
from plotly.graph_objs import graph_objs
d = scs.distance.pdist(X)
Z = sch.linkage(d, method='complete')
P = sch.dendrogram(Z, orientation=self.orientation,
Expand All @@ -1993,7 +1980,6 @@ def get_dendrogram_traces(self, X, colorscale):
colors = self.get_color_dict(colorscale)

trace_list = []

for i in range(len(icoord)):
# xs and ys are arrays of 4 points that make up the '∩' shapes
# of the dendrogram tree
Expand Down