misc: apply black 22.1.0

This commit is contained in:
Frédéric Péters 2022-03-01 19:43:28 +01:00
parent a6998ea746
commit d2c0be0396
4 changed files with 12 additions and 15 deletions

View File

@ -115,7 +115,7 @@ def simplify(s):
def num2deg(xtile, ytile, zoom):
# http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Python
n = 2.0 ** zoom
n = 2.0**zoom
lon_deg = xtile / n * 360.0 - 180.0
lat_rad = math.atan(math.sinh(math.pi * (1 - 2 * ytile / n)))
lat_deg = math.degrees(lat_rad)

View File

@ -22,7 +22,7 @@ class InfinitePaginator(Paginator):
@cached_property
def count(self):
return 2 ** 32
return 2**32
@cached_property
def page_range(self):

View File

@ -208,12 +208,12 @@ class JSONSchemaFromXMLSchema(object):
isinstance(validator, xmlschema.validators.XsdTotalDigitsFacet)
and simple_type.base_type.name == xmlschema.qnames.XSD_DECIMAL
):
schema['exclusiveMaximum'] = 10 ** validator.value
schema['exclusiveMaximum'] = 10**validator.value
elif (
isinstance(validator, xmlschema.validators.XsdFractionDigitsFacet)
and simple_type.base_type.name == xmlschema.qnames.XSD_DECIMAL
):
schema['multipleOf'] = 1 / 10.0 ** validator.value
schema['multipleOf'] = 1 / 10.0**validator.value
else:
raise NotImplementedError(validator)
if simple_type.patterns:

View File

@ -65,17 +65,14 @@ def test_unflatten_dict():
def test_unflatten_array():
assert (
unflatten(
{
'0' + SEP + 'b' + SEP + '0': 1,
'1' + SEP + 'c' + SEP + '1': 'a',
'0' + SEP + 'b' + SEP + '1': True,
'1' + SEP + 'c' + SEP + '0': [1],
}
)
== [{'b': [1, True]}, {'c': [[1], 'a']}]
)
assert unflatten(
{
'0' + SEP + 'b' + SEP + '0': 1,
'1' + SEP + 'c' + SEP + '1': 'a',
'0' + SEP + 'b' + SEP + '1': True,
'1' + SEP + 'c' + SEP + '0': [1],
}
) == [{'b': [1, True]}, {'c': [[1], 'a']}]
def test_unflatten_missing_final_index():