@@ -51,15 +51,15 @@ def build_test_dict_string(value_string, pretty=False):
5151
5252
5353def check_roundtrip (value , engine , pretty ):
54- encoded = pio .to_plotly_json (value , engine = engine , pretty = pretty )
55- decoded = pio .from_plotly_json (encoded , engine = engine )
56- reencoded = pio .to_plotly_json (decoded , engine = engine , pretty = pretty )
54+ encoded = pio .to_json_plotly (value , engine = engine , pretty = pretty )
55+ decoded = pio .from_json_plotly (encoded , engine = engine )
56+ reencoded = pio .to_json_plotly (decoded , engine = engine , pretty = pretty )
5757 assert encoded == reencoded
5858
5959 # Check from_plotly_json with bytes on Python 3
6060 if sys .version_info .major == 3 :
6161 encoded_bytes = encoded .encode ("utf8" )
62- decoded_from_bytes = pio .from_plotly_json (encoded_bytes , engine = engine )
62+ decoded_from_bytes = pio .from_json_plotly (encoded_bytes , engine = engine )
6363 assert decoded == decoded_from_bytes
6464
6565
@@ -124,15 +124,15 @@ def datetime_array(request, datetime_value):
124124# Encoding tests
125125def test_graph_object_input (engine , pretty ):
126126 scatter = go .Scatter (x = [1 , 2 , 3 ], y = np .array ([4 , 5 , 6 ]))
127- result = pio .to_plotly_json (scatter , engine = engine )
127+ result = pio .to_json_plotly (scatter , engine = engine )
128128 expected = """{"type":"scatter","x":[1,2,3],"y":[4,5,6]}"""
129129 assert result == expected
130130 check_roundtrip (result , engine = engine , pretty = pretty )
131131
132132
133133def test_numeric_numpy_encoding (numeric_numpy_array , engine , pretty ):
134134 value = build_test_dict (numeric_numpy_array )
135- result = pio .to_plotly_json (value , engine = engine , pretty = pretty )
135+ result = pio .to_json_plotly (value , engine = engine , pretty = pretty )
136136
137137 array_str = to_json_test (numeric_numpy_array .tolist ())
138138 expected = build_test_dict_string (array_str , pretty = pretty )
@@ -142,7 +142,7 @@ def test_numeric_numpy_encoding(numeric_numpy_array, engine, pretty):
142142
143143def test_object_numpy_encoding (object_numpy_array , engine , pretty ):
144144 value = build_test_dict (object_numpy_array )
145- result = pio .to_plotly_json (value , engine = engine , pretty = pretty )
145+ result = pio .to_json_plotly (value , engine = engine , pretty = pretty )
146146
147147 array_str = to_json_test (object_numpy_array .tolist ())
148148 expected = build_test_dict_string (array_str )
@@ -155,15 +155,15 @@ def test_datetime(datetime_value, engine, pretty):
155155 pytest .skip ("legacy encoder doesn't strip timezone from scalar datetimes" )
156156
157157 value = build_test_dict (datetime_value )
158- result = pio .to_plotly_json (value , engine = engine , pretty = pretty )
158+ result = pio .to_json_plotly (value , engine = engine , pretty = pretty )
159159 expected = build_test_dict_string ('"{}"' .format (isoformat_test (datetime_value )))
160160 assert result == expected
161161 check_roundtrip (result , engine = engine , pretty = pretty )
162162
163163
164164def test_datetime_arrays (datetime_array , engine , pretty ):
165165 value = build_test_dict (datetime_array )
166- result = pio .to_plotly_json (value , engine = engine )
166+ result = pio .to_json_plotly (value , engine = engine )
167167
168168 if isinstance (datetime_array , pd .Series ):
169169 dt_values = [d .isoformat () for d in datetime_array .dt .to_pydatetime ().tolist ()]
0 commit comments