You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assert"altair"instr(type(plot)), "Output is not of Altair type"
66
-
103
+
67
104
# Tests whether or not there are NaNs produced in the correlation values
68
-
assertplot.data['cor'].isnull().sum() ==0, "There are NaN produced as correlation values"
69
-
105
+
assert (
106
+
plot.data["cor"].isnull().sum() ==0
107
+
), "There are NaN produced as correlation values"
108
+
70
109
# Tests whether plot output scheme is one of the three given color schemes
71
-
plot_dict=plot.to_dict()
72
-
assertplot_dict["layer"][0]['encoding']['color']['scale']['scheme'] in ('purpleorange','blueorange', 'redblue'), "The plot color scheme is not one of the expected schemes"
73
-
110
+
plot_dict=plot.to_dict()
111
+
assertplot_dict["layer"][0]["encoding"]["color"]["scale"]["scheme"] in (
112
+
"purpleorange",
113
+
"blueorange",
114
+
"redblue",
115
+
), "The plot color scheme is not one of the expected schemes"
116
+
74
117
# Tests whether heatmap portion of plot is mark_rect()
75
-
assertplot_dict["layer"][0]['mark'] =='rect', "mark should be rect"
76
-
118
+
assertplot_dict["layer"][0]["mark"] =="rect", "mark should be rect"
119
+
77
120
# Tests whether heatmap and correlation values have the same referenced var column
78
-
assertplot_dict['layer'][0]['encoding']['x']['field'] ==plot_dict['layer'][1]['encoding']['x']['field'], "The heatmap and the correlation values are not referring to the same corresponding underlying variable x"
79
-
assertplot_dict['layer'][0]['encoding']['y']['field'] ==plot_dict['layer'][1]['encoding']['y']['field'], "The heatmap and the correlation values are not referring to the same corresponding underlying variable y"
80
-
121
+
assert (
122
+
plot_dict["layer"][0]["encoding"]["x"]["field"]
123
+
==plot_dict["layer"][1]["encoding"]["x"]["field"]
124
+
), "The heatmap and the correlation values are not referring to the same corresponding underlying variable x"
125
+
assert (
126
+
plot_dict["layer"][0]["encoding"]["y"]["field"]
127
+
==plot_dict["layer"][1]["encoding"]["y"]["field"]
128
+
), "The heatmap and the correlation values are not referring to the same corresponding underlying variable y"
129
+
81
130
# Tests whether axes is using correct calculated var column as reference
82
-
assertplot_dict['layer'][0]['encoding']['x']['field'] =='var1', "x should be referring to var1"
83
-
assertplot_dict['layer'][0]['encoding']['y']['field'] =='var2', "y should be referring to var2"
0 commit comments