From 15ca69cf64a46e55836c44b6bd14b22a7fa5702b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:25:13 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.9 → v0.2.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.9...v0.2.0) - [github.com/psf/black: 23.12.1 → 24.1.1](https://github.com/psf/black/compare/23.12.1...24.1.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1e0ea02de5..66a862b663 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,12 +15,12 @@ repos: files: requirements-dev.txt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.9 + rev: v0.2.0 hooks: - id: ruff - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black language_version: python3 From 44f1b2899214bb756790c69f60153d630c5ec722 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:27:59 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- folium/features.py | 12 ++++++------ folium/map.py | 1 + folium/raster_layers.py | 1 + folium/vector_layers.py | 1 + tests/test_map.py | 1 + tests/test_raster_layers.py | 1 + 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/folium/features.py b/folium/features.py index 586ce22110..f216a7b08b 100644 --- a/folium/features.py +++ b/folium/features.py @@ -517,9 +517,9 @@ class GeoJson(Layer): >>> # Provide a style_function that color all states green but Alabama. >>> style_function = lambda x: { - ... "fillColor": "#0000ff" - ... if x["properties"]["name"] == "Alabama" - ... else "#00ff00" + ... "fillColor": ( + ... "#0000ff" if x["properties"]["name"] == "Alabama" else "#00ff00" + ... ) ... } >>> GeoJson(geojson, style_function=style_function) @@ -947,9 +947,9 @@ class TopoJson(JSCSSMixin, Layer): >>> # Provide a style_function that color all states green but Alabama. >>> style_function = lambda x: { - ... "fillColor": "#0000ff" - ... if x["properties"]["name"] == "Alabama" - ... else "#00ff00" + ... "fillColor": ( + ... "#0000ff" if x["properties"]["name"] == "Alabama" else "#00ff00" + ... ) ... } >>> TopoJson(topo_json, "object.myobject", style_function=style_function) diff --git a/folium/map.py b/folium/map.py index e3356c2754..01ac7d2ede 100644 --- a/folium/map.py +++ b/folium/map.py @@ -2,6 +2,7 @@ Classes for drawing maps. """ + import warnings from collections import OrderedDict from typing import Dict, List, Optional, Sequence, Tuple, Type, Union diff --git a/folium/raster_layers.py b/folium/raster_layers.py index ea0e6d1809..ababe3fa94 100644 --- a/folium/raster_layers.py +++ b/folium/raster_layers.py @@ -2,6 +2,7 @@ Wraps leaflet TileLayer, WmsTileLayer (TileLayer.WMS), ImageOverlay, and VideoOverlay """ + from typing import Any, Callable, Optional, Union import xyzservices diff --git a/folium/vector_layers.py b/folium/vector_layers.py index 6e03506101..9f535467a4 100644 --- a/folium/vector_layers.py +++ b/folium/vector_layers.py @@ -2,6 +2,7 @@ Wraps leaflet Polyline, Polygon, Rectangle, Circle, and CircleMarker """ + from typing import List, Optional, Sequence, Union from branca.element import MacroElement diff --git a/tests/test_map.py b/tests/test_map.py index d38aa998fb..e67022d188 100644 --- a/tests/test_map.py +++ b/tests/test_map.py @@ -3,6 +3,7 @@ ---------------- """ + import warnings import numpy as np diff --git a/tests/test_raster_layers.py b/tests/test_raster_layers.py index 600d876647..dcef20c3aa 100644 --- a/tests/test_raster_layers.py +++ b/tests/test_raster_layers.py @@ -3,6 +3,7 @@ ------------------ """ + import pytest import xyzservices from jinja2 import Template