Skip to content

Commit d37b6c9

Browse files
committed
black (new version)
1 parent 7227a50 commit d37b6c9

File tree

18 files changed

+44
-42
lines changed

18 files changed

+44
-42
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
*.gz
66

7+
*~
8+
79
# Don't ignore dataset files
810
!*.csv.gz
911

Diff for: packages/python/chart-studio/chart_studio/tests/test_optional/test_utils/test_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_column_json_encoding(self):
2727
json_columns = _json.dumps(
2828
columns, cls=_plotly_utils.utils.PlotlyJSONEncoder, sort_keys=True
2929
)
30-
print (json_columns)
30+
print(json_columns)
3131
assert (
3232
'[{"data": [1, 2, 3], "name": "col 1"}, '
3333
'{"data": [1, "A", "2014-01-05T00:00:00", '

Diff for: packages/python/plotly/_plotly_utils/colors/plotlyjs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
# Create variable named after each scale that contains the sequence of colors only
175175
for scale_name, scale_pairs in _plotlyjs_scales.items():
176176
scale_sequence = [c[1] for c in scale_pairs]
177-
exec (
177+
exec(
178178
"{scale_name} = {scale_sequence}".format(
179179
scale_name=scale_name, scale_sequence=scale_sequence
180180
)

Diff for: packages/python/plotly/plotly/_version.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,20 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=
8989
if e.errno == errno.ENOENT:
9090
continue
9191
if verbose:
92-
print ("unable to run %s" % dispcmd)
93-
print (e)
92+
print("unable to run %s" % dispcmd)
93+
print(e)
9494
return None, None
9595
else:
9696
if verbose:
97-
print ("unable to find command, tried %s" % (commands,))
97+
print("unable to find command, tried %s" % (commands,))
9898
return None, None
9999
stdout = p.communicate()[0].strip()
100100
if sys.version_info[0] >= 3:
101101
stdout = stdout.decode()
102102
if p.returncode != 0:
103103
if verbose:
104-
print ("unable to run %s (error)" % dispcmd)
105-
print ("stdout was %s" % stdout)
104+
print("unable to run %s (error)" % dispcmd)
105+
print("stdout was %s" % stdout)
106106
return None, p.returncode
107107
return stdout, p.returncode
108108

@@ -131,7 +131,7 @@ def versions_from_parentdir(parentdir_prefix, root, verbose):
131131
root = os.path.dirname(root) # up a level
132132

133133
if verbose:
134-
print (
134+
print(
135135
"Tried directories %s but none started with prefix %s"
136136
% (str(rootdirs), parentdir_prefix)
137137
)
@@ -184,7 +184,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
184184
refnames = keywords["refnames"].strip()
185185
if refnames.startswith("$Format"):
186186
if verbose:
187-
print ("keywords are unexpanded, not using")
187+
print("keywords are unexpanded, not using")
188188
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
189189
refs = set([r.strip() for r in refnames.strip("()").split(",")])
190190
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
@@ -201,15 +201,15 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
201201
# "stabilization", as well as "HEAD" and "master".
202202
tags = set([r for r in refs if re.search(r"\d", r)])
203203
if verbose:
204-
print ("discarding '%s', no digits" % ",".join(refs - tags))
204+
print("discarding '%s', no digits" % ",".join(refs - tags))
205205
if verbose:
206-
print ("likely tags: %s" % ",".join(sorted(tags)))
206+
print("likely tags: %s" % ",".join(sorted(tags)))
207207
for ref in sorted(tags):
208208
# sorting will prefer e.g. "2.0" over "2.0rc1"
209209
if ref.startswith(tag_prefix):
210210
r = ref[len(tag_prefix) :]
211211
if verbose:
212-
print ("picking %s" % r)
212+
print("picking %s" % r)
213213
return {
214214
"version": r,
215215
"full-revisionid": keywords["full"].strip(),
@@ -219,7 +219,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
219219
}
220220
# no suitable tags, so version is "0+unknown", but full hex is still there
221221
if verbose:
222-
print ("no suitable tags, using unknown + full revision id")
222+
print("no suitable tags, using unknown + full revision id")
223223
return {
224224
"version": "0+unknown",
225225
"full-revisionid": keywords["full"].strip(),
@@ -244,7 +244,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
244244
out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root, hide_stderr=True)
245245
if rc != 0:
246246
if verbose:
247-
print ("Directory %s not under git control" % root)
247+
print("Directory %s not under git control" % root)
248248
raise NotThisMethod("'git rev-parse --git-dir' returned error")
249249

250250
# if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]
@@ -301,7 +301,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
301301
if not full_tag.startswith(tag_prefix):
302302
if verbose:
303303
fmt = "tag '%s' doesn't start with prefix '%s'"
304-
print (fmt % (full_tag, tag_prefix))
304+
print(fmt % (full_tag, tag_prefix))
305305
pieces["error"] = "tag '%s' doesn't start with prefix '%s'" % (
306306
full_tag,
307307
tag_prefix,

Diff for: packages/python/plotly/plotly/basedatatypes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def _ipython_display_(self):
436436
if pio.renderers.render_on_display and pio.renderers.default:
437437
pio.show(self)
438438
else:
439-
print (repr(self))
439+
print(repr(self))
440440

441441
def update(self, dict1=None, overwrite=False, **kwargs):
442442
"""
@@ -1751,7 +1751,7 @@ def print_grid(self):
17511751
raise Exception(
17521752
"Use plotly.tools.make_subplots " "to create a subplot grid."
17531753
)
1754-
print (self._grid_str)
1754+
print(self._grid_str)
17551755

17561756
def append_trace(self, trace, row, col):
17571757
"""

Diff for: packages/python/plotly/plotly/subplots.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ def _checks(item, defaults):
787787

788788
# Handle displaying grid information
789789
if print_grid:
790-
print (grid_str)
790+
print(grid_str)
791791

792792
# Build resulting figure
793793
fig = go.Figure(layout=layout)

Diff for: packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_instantiate_hierarchy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_construct_datatypes(self):
2424
try:
2525
v = obj()
2626
except Exception:
27-
print (
27+
print(
2828
"Failed to construct {obj} in module {module}".format(
2929
obj=obj, module=datatypes_module
3030
)

Diff for: packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_scatter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
def test_trivial():
16-
print (Scatter())
16+
print(Scatter())
1717
assert Scatter().to_plotly_json() == dict(type="scatter")
1818

1919

Diff for: packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_update.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class TestUpdateMethod(TestCase):
1212
def setUp(self):
13-
print ("Setup!")
13+
print("Setup!")
1414

1515
def test_update_dict(self):
1616
title = "this"

Diff for: packages/python/plotly/plotly/tests/test_io/test_renderers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def perform_request(url):
235235
request_responses.append(requests.get(url))
236236

237237
def open_url(url, new=0, autoraise=True):
238-
print ("open url")
238+
print("open url")
239239
# Perform request in thread so that we don't block
240240
request_thread = threading.Thread(target=lambda: perform_request(url))
241241
request_thread.daemon = True

Diff for: packages/python/plotly/plotly/tests/test_optional/optional_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
def run_fig(fig):
2222
renderer = PlotlyRenderer()
2323
exporter = Exporter(renderer)
24-
print (exporter)
24+
print(exporter)
2525
exporter.run(fig)
2626
return renderer
2727

Diff for: packages/python/plotly/plotly/tests/test_optional/test_figure_factory/test_figure_factory.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4305,5 +4305,5 @@ def test_optional_arguments(self):
43054305
**arg_set
43064306
)
43074307
# This test does not work for ilr interpolation
4308-
print (len(fig.data))
4308+
print(len(fig.data))
43094309
assert len(fig.data) == ncontours + 2 + arg_set["showscale"]

Diff for: packages/python/plotly/plotly/tests/test_optional/test_matplotlylib/test_date_times.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def test_normal_mpl_dates(self):
4545
# convert this figure to plotly's graph_objs
4646
pfig = tls.mpl_to_plotly(fig)
4747

48-
print (date_strings)
49-
print (pfig["data"][0]["x"])
48+
print(date_strings)
49+
print(pfig["data"][0]["x"])
5050
# we use the same format here, so we expect equality here
5151
self.assertEqual(fig.axes[0].lines[0].get_xydata()[0][0], 7.33776000e05)
5252
self.assertEqual(tuple(pfig["data"][0]["x"]), tuple(date_strings))

Diff for: packages/python/plotly/plotly/tests/test_optional/test_matplotlylib/test_scatter.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def test_simple_scatter():
2222
d1, d2 = strip_dict_params(
2323
data_dict, SIMPLE_SCATTER["data"][data_no], ignore=["uid"]
2424
)
25-
print (d1)
26-
print ("\n")
27-
print (d2)
25+
print(d1)
26+
print("\n")
27+
print(d2)
2828
assert d1 == d2
2929

3030
equivalent, msg = compare_dict(
@@ -43,9 +43,9 @@ def test_double_scatter():
4343
d1, d2 = strip_dict_params(
4444
data_dict, DOUBLE_SCATTER["data"][data_no], ignore=["uid"]
4545
)
46-
print (d1)
47-
print ("\n")
48-
print (d2)
46+
print(d1)
47+
print("\n")
48+
print(d2)
4949
assert d1 == d2
5050

5151
equivalent, msg = compare_dict(

Diff for: packages/python/plotly/plotly/tests/test_optional/test_utils/test_utils.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ def test_datetime_json_encoding(self):
226226

227227
def test_pandas_json_encoding(self):
228228
j1 = _json.dumps(df["col 1"], cls=utils.PlotlyJSONEncoder)
229-
print (j1)
230-
print ("\n")
229+
print(j1)
230+
print("\n")
231231
assert j1 == '[1, 2, 3, "2014-01-05T00:00:00", null, null, null]'
232232

233233
# Test that data wasn't mutated
@@ -257,7 +257,7 @@ def test_pandas_json_encoding(self):
257257
def test_numpy_masked_json_encoding(self):
258258
l = [1, 2, np.ma.core.masked]
259259
j1 = _json.dumps(l, cls=utils.PlotlyJSONEncoder)
260-
print (j1)
260+
print(j1)
261261
assert j1 == "[1, 2, null]"
262262

263263
def test_numpy_dates(self):
@@ -300,6 +300,6 @@ def test_masked_constants_example():
300300
jy = _json.dumps(
301301
renderer.plotly_fig["data"][1]["y"], cls=utils.PlotlyJSONEncoder
302302
)
303-
print (jy)
303+
print(jy)
304304
array = _json.loads(jy)
305305
assert array == [-398.11793027, -398.11792966, -398.11786308, None]

Diff for: packages/python/plotly/plotly/tests/test_orca/test_to_image.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# ---------
1717
project_root = os.path.dirname(os.path.realpath(plotly.__file__))
1818
images_root = os.path.join(project_root, "tests", "test_orca", "images")
19-
print (images_root)
19+
print(images_root)
2020
if sys.platform.startswith("linux"):
2121
images_dir = os.path.join(images_root, "linux")
2222
elif sys.platform == "darwin":
@@ -174,7 +174,7 @@ def assert_image_bytes(img_bytes, file_name, _raise=True):
174174

175175
except (OSError, AssertionError) as e:
176176
failed_path = os.path.join(failed_dir, file_name)
177-
print ('Saving failed image to "{failed_path}"'.format(failed_path=failed_path))
177+
print('Saving failed image to "{failed_path}"'.format(failed_path=failed_path))
178178

179179
if not os.path.exists(failed_dir):
180180
os.mkdir(failed_dir)

Diff for: packages/python/plotly/plotly/tools.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def mpl_to_plotly(fig, resize=False, strip_style=False, verbose=False):
115115
if strip_style:
116116
renderer.strip_style()
117117
if verbose:
118-
print (renderer.msg)
118+
print(renderer.msg)
119119
return renderer.plotly_fig
120120
else:
121121
warnings.warn(
@@ -221,7 +221,7 @@ def get_subplots(rows=1, columns=1, print_grid=False, **kwargs):
221221
plot_num += 1
222222

223223
if print_grid:
224-
print ("This is the format of your plot grid!")
224+
print("This is the format of your plot grid!")
225225
grid_string = ""
226226
plot = 1
227227
for rrr in range(rows):
@@ -230,7 +230,7 @@ def get_subplots(rows=1, columns=1, print_grid=False, **kwargs):
230230
grid_line += "[{0}]\t".format(plot)
231231
plot += 1
232232
grid_string = grid_line + "\n" + grid_string
233-
print (grid_string)
233+
print(grid_string)
234234

235235
return graph_objs.Figure(fig) # forces us to validate what we just did...
236236

Diff for: test/percy/plotly-express.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import plotly.express as px
1010

11-
print (px.data.iris.__doc__)
11+
print(px.data.iris.__doc__)
1212
px.data.iris().head()
1313

1414
# #### Scatter and Line plots

0 commit comments

Comments
 (0)