Update Black version.

This commit is contained in:
Sergey Vartanov 2022-04-03 22:57:41 +03:00
parent 8863c67126
commit e85e98e92c
5 changed files with 8 additions and 8 deletions

View file

@ -33,7 +33,7 @@ Install the project in editable mode:
pip install -e .
```
Install formatter, linter and test system: `pip install black~=21.4b0 flake8 mypy pytest pytest-cov`.
Install formatter, linter and test system: `pip install black flake8 mypy pytest pytest-cov`.
Be sure to enable Git hooks:

View file

@ -18,7 +18,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black~=21.4b0 flake8 pytest
pip install black flake8 pytest
pip install -r requirements.txt
pip install .
- name: Check code style with Black
@ -41,7 +41,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black~=21.4b0 flake8 pytest
pip install black flake8 pytest
pip install -r requirements.txt
pip install .
- name: Check code style with Black

View file

@ -30,7 +30,7 @@ Install the project in editable mode:
\code {pip install -e .} {shell}
Install formatter, linter and test system\: \m {pip install black~=21.4b0 flake8 mypy pytest pytest-cov}.
Install formatter, linter and test system\: \m {pip install black flake8 mypy pytest pytest-cov}.
Be sure to enable Git hooks:

View file

@ -38,7 +38,7 @@ def osm_zoom_level_to_pixels_per_meter(
function allows any non-negative float value
:param equator_length: celestial body equator length in meters
"""
return 2.0 ** zoom_level / equator_length * 256.0
return 2.0**zoom_level / equator_length * 256.0
class Flinger:
@ -56,7 +56,7 @@ class Flinger:
:param equator_length: celestial body equator length in meters
"""
self.geo_boundaries: BoundaryBox = geo_boundaries
self.ratio: float = 2.0 ** zoom_level * 256.0 / 360.0
self.ratio: float = 2.0**zoom_level * 256.0 / 360.0
self.size: np.ndarray = self.ratio * (
pseudo_mercator(self.geo_boundaries.max_())
- pseudo_mercator(self.geo_boundaries.min_())

View file

@ -55,7 +55,7 @@ class Tile:
:param zoom_level: zoom level in OpenStreetMap terminology
"""
lat_rad: np.ndarray = np.radians(coordinates[0])
scale: float = 2.0 ** zoom_level
scale: float = 2.0**zoom_level
x: int = int((coordinates[1] + 180.0) / 360.0 * scale)
y: int = int((1.0 - np.arcsinh(np.tan(lat_rad)) / np.pi) / 2.0 * scale)
return cls(x, y, zoom_level)
@ -66,7 +66,7 @@ class Tile:
Code from https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
"""
scale: float = 2.0 ** self.zoom_level
scale: float = 2.0**self.zoom_level
lon_deg: float = self.x / scale * 360.0 - 180.0
lat_rad: float = np.arctan(np.sinh(np.pi * (1 - 2 * self.y / scale)))
lat_deg: np.ndarray = np.degrees(lat_rad)