From 16ce2804d1cc3cab06534ede39b7ea2190ea08ad Mon Sep 17 00:00:00 2001 From: Eitan Lees Date: Thu, 17 Sep 2020 18:06:03 -0400 Subject: [PATCH] maint: black formatting --- altair/utils/data.py | 2 +- altair/utils/schemapi.py | 4 +++- altair/utils/tests/test_mimebundle.py | 6 +++++- altair/vegalite/v3/tests/test_api.py | 29 ++++++++++++++++++++++----- altair/vegalite/v4/tests/test_api.py | 29 ++++++++++++++++++++++----- tools/schemapi/schemapi.py | 4 +++- 6 files changed, 60 insertions(+), 14 deletions(-) diff --git a/altair/utils/data.py b/altair/utils/data.py index 89b31e0b8..3ef50b068 100644 --- a/altair/utils/data.py +++ b/altair/utils/data.py @@ -232,7 +232,7 @@ def pipe(data, *funcs): def curry(*args, **kwargs): - """ Curry a callable function + """Curry a callable function Deprecated: use toolz.curried.curry() instead. """ diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py index 6d519c3b0..d5d6ceec5 100644 --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -551,7 +551,9 @@ def _passthrough(*args, **kwds): continue else: return self.from_dict( - dct, schema=possible_schema, rootschema=rootschema, + dct, + schema=possible_schema, + rootschema=rootschema, ) if isinstance(dct, dict): diff --git a/altair/utils/tests/test_mimebundle.py b/altair/utils/tests/test_mimebundle.py index 56f7cd497..9c5a9458a 100644 --- a/altair/utils/tests/test_mimebundle.py +++ b/altair/utils/tests/test_mimebundle.py @@ -183,5 +183,9 @@ def test_spec_to_vega_mimebundle(vega_spec): def test_spec_to_json_mimebundle(): - bundle = spec_to_mimebundle(spec=vegalite_spec, mode="vega-lite", format="json",) + bundle = spec_to_mimebundle( + spec=vegalite_spec, + mode="vega-lite", + format="json", + ) assert bundle == {"application/json": vegalite_spec} diff --git a/altair/vegalite/v3/tests/test_api.py b/altair/vegalite/v3/tests/test_api.py index ae6c88074..e8f072b81 100644 --- a/altair/vegalite/v3/tests/test_api.py +++ b/altair/vegalite/v3/tests/test_api.py @@ -38,7 +38,15 @@ def _make_chart_type(chart_type): "color": list("AAAABBBB"), } ) - base = alt.Chart(data).mark_point().encode(x="x", y="y", color="color",) + base = ( + alt.Chart(data) + .mark_point() + .encode( + x="x", + y="y", + color="color", + ) + ) if chart_type in ["layer", "hconcat", "vconcat", "concat"]: func = getattr(alt, chart_type) @@ -290,7 +298,10 @@ def test_facet_basic(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode(x="x:Q", y="y:Q",) + .encode( + x="x:Q", + y="y:Q", + ) .facet("category:N", columns=2) ) @@ -304,7 +315,10 @@ def test_facet_basic(): chart2 = ( alt.Chart("data.csv") .mark_point() - .encode(x="x:Q", y="y:Q",) + .encode( + x="x:Q", + y="y:Q", + ) .facet(row="category1:Q", column="category2:Q") ) @@ -729,7 +743,10 @@ def test_repeat(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode(x=alt.X(alt.repeat(), type="quantitative"), y="y:Q",) + .encode( + x=alt.X(alt.repeat(), type="quantitative"), + y="y:Q", + ) .repeat(["A", "B", "C", "D"], columns=2) ) @@ -856,7 +873,9 @@ def test_layer_errors(): def test_resolve(chart_type): chart = _make_chart_type(chart_type) chart = ( - chart.resolve_scale(x="independent",) + chart.resolve_scale( + x="independent", + ) .resolve_legend(color="independent") .resolve_axis(y="independent") ) diff --git a/altair/vegalite/v4/tests/test_api.py b/altair/vegalite/v4/tests/test_api.py index 84574bc5e..f0217888c 100644 --- a/altair/vegalite/v4/tests/test_api.py +++ b/altair/vegalite/v4/tests/test_api.py @@ -37,7 +37,15 @@ def _make_chart_type(chart_type): "color": list("AAAABBBB"), } ) - base = alt.Chart(data).mark_point().encode(x="x", y="y", color="color",) + base = ( + alt.Chart(data) + .mark_point() + .encode( + x="x", + y="y", + color="color", + ) + ) if chart_type in ["layer", "hconcat", "vconcat", "concat"]: func = getattr(alt, chart_type) @@ -289,7 +297,10 @@ def test_facet_basic(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode(x="x:Q", y="y:Q",) + .encode( + x="x:Q", + y="y:Q", + ) .facet("category:N", columns=2) ) @@ -303,7 +314,10 @@ def test_facet_basic(): chart2 = ( alt.Chart("data.csv") .mark_point() - .encode(x="x:Q", y="y:Q",) + .encode( + x="x:Q", + y="y:Q", + ) .facet(row="category1:Q", column="category2:Q") ) @@ -738,7 +752,10 @@ def test_repeat(): chart1 = ( alt.Chart("data.csv") .mark_point() - .encode(x=alt.X(alt.repeat(), type="quantitative"), y="y:Q",) + .encode( + x=alt.X(alt.repeat(), type="quantitative"), + y="y:Q", + ) .repeat(["A", "B", "C", "D"], columns=2) ) @@ -865,7 +882,9 @@ def test_layer_errors(): def test_resolve(chart_type): chart = _make_chart_type(chart_type) chart = ( - chart.resolve_scale(x="independent",) + chart.resolve_scale( + x="independent", + ) .resolve_legend(color="independent") .resolve_axis(y="independent") ) diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py index eb78108fe..1a3225691 100644 --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -549,7 +549,9 @@ def _passthrough(*args, **kwds): continue else: return self.from_dict( - dct, schema=possible_schema, rootschema=rootschema, + dct, + schema=possible_schema, + rootschema=rootschema, ) if isinstance(dct, dict):