8000 Test fixes 2 by Kully · Pull Request #994 · plotly/plotly.py · GitHub
[go: up one dir, main page]

Skip to content

Test fixes 2 #994

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 28 commits into from
May 7, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3cef6d3
remove get_data, strip_style and to_string test files
Kully Apr 23, 2018
ce3b723
fixed test_frames
Kully Apr 23, 2018
7378270
test_data working
Kully Apr 23, 2018
fbdcb62
remove test_graph_objs_tools as graph_objs_tools doesn't exist
Kully Apr 23, 2018
39d036d
move strip_dict_params to plotly/test/utils.py
Kully Apr 23, 2018
53bcdec
fixed most of test_update
Kully Apr 24, 2018
c88ef40
Merge branch 'ipyplotly_integration' into test-fixes-2
Kully Apr 24, 2018
75b0ffc
Merge branch 'ipyplotly_integration' of https://github.com/plotly/plo…
Kully Apr 25, 2018
c2821a6
all test_core tests passing (sans streaming tests)
Kully Apr 26, 2018
f7c75cc
removed graph_objs as only to_dataframe is there - unsupported method…
Kully Apr 26, 2018
c228895
test_core tests working sans matplotlylib datatypes stuff
Kully Apr 26, 2018
22f15c0
update axis scales
Kully Apr 26, 2018
57a56aa
scatter - fixed test_scatter
Kully Apr 27, 2018
0fc2727
working on matplotlylib...
Kully Apr 30, 2018
6f8dcf4
convert dashed to dash in matplotlylib tools // fix test_lines
Kully Apr 30, 2018
20ecb25
test_date_times
Kully Apr 30, 2018
f024f57
fixed test_bars
Kully Apr 30, 2018
47622f5
remove commented x=... line
Kully Apr 30, 2018
390c4f2
axis_scales
Kully May 1, 2018
6d5dd92
annotations
Kully May 1, 2018
f70202d
subplots in matplotlylib
Kully May 1, 2018
6455837
fixed all streaming tests w/o server error to interupt \n playing wit…
Kully May 1, 2018
0fedc1b
working on using admin buildly account
Kully May 1, 2018
6ed70db
corrected coerce stream trace to dict if BaseTraceType line
Kully May 2, 2018
c891d75
mid stream write validation error
Kully May 2, 2018
77ca1b2
move print statements around
Kully May 2, 2018
f09a5ec
fixed streaming tests//no validation within stream.write
Kully May 2, 2018
0b5a98c
remove print statement
Kully May 2, 2018
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
10000
Prev Previous commit
Next Next commit
scatter - fixed test_scatter
  • Loading branch information
Kully committed Apr 27, 2018
commit 57a56aaa87680719f10966805951ac09be44993a
8 changes: 4 additions & 4 deletions plotly/matplotlylib/mpltools.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def convert_symbol(mpl_symbol):
elif mpl_symbol in SYMBOL_MAP:
return SYMBOL_MAP[mpl_symbol]
else:
return 'dot' # default
return 'circle' # default


def hex_to_rgb(value):
Expand Down Expand Up @@ -548,7 +548,7 @@ def mpl_dates_to_datestrings(dates, mpl_formatter):
DASH_MAP = {
'10,0': 'solid',
'6,6': 'dash',
'2,2': 'dot',
'2,2': 'circle',
'4,4,2,4': 'dashdot',
'none': 'solid'
}
Expand All @@ -567,15 +567,15 @@ def mpl_dates_to_datestrings(dates, mpl_formatter):
}

SYMBOL_MAP = {
'o': 'dot',
'o': 'circle',
'v': 'triangle-down',
'^': 'triangle-up',
'<': 'triangle-left',
'>': 'triangle-right',
's': 'square',
'+': 'cross',
'x': 'x',
'*': 'x', # no star yet in plotly!!
'*': 'star',
'D': 'diamond',
'd': 'diamond',
}
Expand Down
10 changes: 5 additions & 5 deletions plotly/tests/test_optional/temp-plot.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plotly/tests/test_optional/test_matplotlylib/data/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
name='one',
mode='markers',
marker=Marker(
symbol='dot',
symbol='circle',
line=Line(
color='#000000',
width=0.5
Expand Down
46 changes: 20 additions & 26 deletions plotly/tests/test_optional/test_matplotlylib/data/scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
Marker, Scatter, XAxis, YAxis)

D = dict(
x1=[1, 2, 2, 4, 5, 6, 1, 7, 8, 5 ,3],
x1=[1, 2, 2, 4, 5, 6, 1, 7, 8, 5, 3],
y1=[5, 3, 7, 2, 9, 7, 8, 4, 5, 9, 2],
x2=[-1, 1, -0.3, -0.6, 0.4, 0.8, -0.1, 0.7],
y2=[-0.5, 0.4, 0.7, -0.6, 0.3, -1, 0, 0.3]
)


SIMPLE_SCATTER = Figure(
data=Data([
Scatter(
x=[1.0, 2.0, 2.0, 4.0, 5.0, 6.0, 1.0, 7.0, 8.0, 5.0, 3.0],
y=[5.0, 3.0, 7.0, 2.0, 9.0, 7.0, 8.0, 4.0, 5.0, 9.0, 2.0],
mode='markers',
marker=Marker(
symbol='dot',
symbol='circle',
line=Line(
color='rgba(0,0,0,1.0)',
color='rgba(31,119,180,1.0)',
width=1.0
),
size=4.4721359549995796,
color='rgba(0,0,255,1.0)',
opacity=1.0
size=6.0,
color='rgba(31,119,180,1.0)',
),
xaxis='x1',
yaxis='y1'
Expand All @@ -37,39 +37,39 @@
margin=Margin(
l=80,
r=63,
b=47,
t=47,
b=52,
t=57,
pad=0
),
hovermode='closest',
showlegend=False,
xaxis1=XAxis(
domain=[0.0, 1.0],
range=[0.0, 9.0],
range=[0.64334677419354847, 8.3566532258064505],
type='linear',
showline=True,
ticks='inside',
nticks=10,
showgrid=False,
zeroline=False,
tickfont=Font(
size=12.0
size=10.0
),
anchor='y1',
side='bottom',
mirror='ticks'
),
yaxis1=YAxis(
domain=[0.0, 1.0],
range=[1.0, 10.0],
range=[1.6410714285714287, 9.3589285714285726],
type='linear',
showline=True,
ticks='inside',
nticks=10,
showgrid=False,
zeroline=False,
tickfont=Font(
size=12.0
size=10.0
),
anchor='x1',
side='left',
Expand All @@ -92,18 +92,13 @@
),
size=11.0,
color='rgba(255,0,0,0.5)',
opacity=0.5
),
xaxis='x1',
yaxis='y1'
),
Scatter(
x=[-1.0, 1.0, -0.29999999999999999, -0.59999999999999998,
0.40000000000000002, 0.80000000000000004, -0.10000000000000001,
0.69999999999999996],
y=[-0.5, 0.40000000000000002, 0.69999999999999996,
-0.59999999999999998, 0.29999999999999999, -1.0, 0.0,
0.29999999999999999],
x=[-1.0, 1.0, -0.3, -0.6, 0.4, 0.8, -0.1, 0.7],
y=[-0.5, 0.4, 0.7, -0.6, 0.3, -1.0, 0.0, 0.3],
mode='markers',
marker=Marker(
symbol='square',
Expand All @@ -113,7 +108,6 @@
),
size=8.0,
color='rgba(128,0,128,0.5)',
opacity=0.5
),
xaxis='x1',
yaxis='y1'
Expand All @@ -126,39 +120,39 @@
margin=Margin(
l=80,
r=63,
b=47,
t=47,
b=52,
t=57,
pad=0
),
hovermode='closest',
showlegend=False,
xaxis1=XAxis(
domain=[0.0, 1.0],
range=[-2.0, 10.0],
range=[-1.5159626203173777, 8.4647578206295506],
type='linear',
showline=True,
ticks='inside',
nticks=7,
showgrid=False,
zeroline=False,
tickfont=Font(
size=12.0
size=10.0
),
anchor='y1',
side='bottom',
mirror='ticks'
),
yaxis1=YAxis(
domain=[0.0, 1.0],
range=[-2.0, 10.0],
range=[-1.588616071428572, 9.5198093820861693],
type='linear',
showline=True,
ticks='inside',
nticks=7,
showgrid=False,
zeroline=False,
tickfont=Font(
size=12.0
size=10.0
),
anchor='x1',
side='left',
Expand Down
14 changes: 7 additions & 7 deletions plotly/tests/test_optional/test_matplotlylib/test_scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from nose.plugins.attrib import attr

from plotly import optional_imports
from plotly.tests.utils import compare_dict
from plotly.tests.utils import compare_dict, strip_dict_params
from plotly.tests.test_optional.optional_utils import run_fig
from plotly.tests.test_optional.test_matplotlylib.data.scatter import *

Expand All @@ -23,9 +23,9 @@ def test_simple_scatter():
ax.scatter(D['x1'], D['y1'])
renderer = run_fig(fig)
for data_no, data_dict in enumerate(renderer.plotly_fig['data']):
equivalent, msg = compare_dict(data_dict,
SIMPLE_SCATTER['data'][data_no])
assert equivalent, msg
d1, d2 = strip_dict_params(data_dict, SIMPLE_SCATTER['data'][data_no], ignore=['uid'])
assert d1 == d2

equivalent, msg = compare_dict(renderer.plotly_fig['layout'],
SIMPLE_SCATTER['layout'])
assert equivalent, msg
Expand All @@ -38,9 +38,9 @@ def test_double_scatter():
ax.scatter(D['x2'], D['y2'], color='purple', s=64, marker='s', alpha=0.5)
renderer = run_fig(fig)
for data_no, data_dict in enumerate(renderer.plotly_fig['data']):
equivalent, msg = compare_dict(data_dict,
DOUBLE_SCATTER['data'][data_no])
assert equivalent, msg
d1, d2 = strip_dict_params(data_dict, DOUBLE_SCATTER['data'][data_no], ignore=['uid'])
assert d1 == d2

equivalent, msg = compare_dict(renderer.plotly_fig['layout'],
DOUBLE_SCATTER['layout'])
assert equivalent, msg
0