Skip to content

Commit cda537f

Browse files
[pre-commit.ci] pre-commit autoupdate (#1280)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black-pre-commit-mirror: 25.12.0 → 26.1.0](psf/black-pre-commit-mirror@25.12.0...26.1.0) - [github.com/kynan/nbstripout: 0.8.2 → 0.9.0](kynan/nbstripout@0.8.2...0.9.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 60df120 commit cda537f

6 files changed

Lines changed: 30 additions & 64 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ repos:
1212
args: ["--maxkb=500"]
1313

1414
- repo: https://github.com/psf/black-pre-commit-mirror
15-
rev: 25.12.0
15+
rev: 26.1.0
1616
hooks:
1717
- id: black-jupyter
1818

@@ -27,6 +27,6 @@ repos:
2727
]
2828

2929
- repo: https://github.com/kynan/nbstripout
30-
rev: 0.8.2
30+
rev: 0.9.0
3131
hooks:
3232
- id: nbstripout

docs/maplibre/dashboard.ipynb

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,38 +49,30 @@
4949
"\n",
5050
"# Customize dialog\n",
5151
"tw.set_help_title(\"About this dashboard\")\n",
52-
"tw.set_help_content(\n",
53-
" widgets.HTML(\n",
54-
" \"\"\"\n",
52+
"tw.set_help_content(widgets.HTML(\"\"\"\n",
5553
" <p><b>Shortcuts</b></p>\n",
5654
" <ul>\n",
5755
" <li>1 / 2 / 3 — switch tabs</li>\n",
5856
" <li>R — refresh</li>\n",
5957
" <li>? — help</li>\n",
6058
" </ul>\n",
61-
" \"\"\"\n",
62-
" )\n",
63-
")\n",
59+
" \"\"\"))\n",
6460
"\n",
6561
"m = leafmap.Map(\n",
6662
" projection=\"globe\", style=\"liberty\", sidebar_visible=True, height=\"800px\"\n",
6763
")\n",
6864
"m.create_container()\n",
6965
"\n",
70-
"home_tab = widgets.HTML(\n",
71-
" \"\"\"\n",
66+
"home_tab = widgets.HTML(\"\"\"\n",
7267
" <h1>Welcome to the Leafmap Visualization Dashboard</h1>\n",
7368
" <p>This is the home tab.</p>\n",
7469
" <img src=\"https://assets.gishub.org/images/geog-312.png\" width=\"100%\">\n",
75-
" \"\"\"\n",
76-
")\n",
70+
" \"\"\")\n",
7771
"\n",
78-
"settings_tab = widgets.HTML(\n",
79-
" \"\"\"\n",
72+
"settings_tab = widgets.HTML(\"\"\"\n",
8073
" <h1>Settings</h1>\n",
8174
" <p>This is the settings tab.</p>\n",
82-
" \"\"\"\n",
83-
")\n",
75+
" \"\"\")\n",
8476
"\n",
8577
"tw.set_tab_content(0, home_tab)\n",
8678
"tw.set_tab_content(1, m.container)\n",

docs/notebooks/92_maplibre.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,6 @@
697697
"from maplibre import Layer, LayerType, Map, MapOptions\n",
698698
"from maplibre.sources import GeoJSONSource\n",
699699
"\n",
700-
"\n",
701700
"bg_layer = Layer(\n",
702701
" type=LayerType.BACKGROUND,\n",
703702
" id=\"background\",\n",

docs/workshops/HGAC_2024.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2814,7 +2814,6 @@
28142814
"source": [
28152815
"import numpy as np\n",
28162816
"\n",
2817-
"\n",
28182817
"# Generate the icon data\n",
28192818
"width = 64 # The image will be 64 pixels square\n",
28202819
"height = 64\n",

leafmap/foliumap.py

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -837,8 +837,7 @@ def add_opacity_control(
837837
"""
838838

839839
class _OpacityControl(JSCSSMixin, Layer):
840-
_template = Template(
841-
"""
840+
_template = Template("""
842841
{% macro head(this, kwargs) %}
843842
<style>
844843
.leaflet-control.leafmap-opacity-control {
@@ -1022,8 +1021,7 @@ class _OpacityControl(JSCSSMixin, Layer):
10221021
}
10231022
})();
10241023
{% endmacro %}
1025-
"""
1026-
)
1024+
""")
10271025

10281026
def __init__(
10291027
self,
@@ -2436,15 +2434,11 @@ def add_title(
24362434
if style is None:
24372435
title_html = """
24382436
<h3 align={} style="font-size:{}"><b>{}</b></h3>
2439-
""".format(
2440-
align, font_size, title
2441-
)
2437+
""".format(align, font_size, title)
24422438
else:
24432439
title_html = """
24442440
<h3 align={} style={}><b>{}</b></h3>
2445-
""".format(
2446-
align, style, title
2447-
)
2441+
""".format(align, style, title)
24482442
self.get_root().html.add_child(folium.Element(title_html))
24492443

24502444
def static_map(
@@ -3990,15 +3984,13 @@ class SplitControl(Layer):
39903984
>>> sidebyside.add_to(m)
39913985
"""
39923986

3993-
_template = Template(
3994-
"""
3987+
_template = Template("""
39953988
{% macro script(this, kwargs) %}
39963989
var {{ this.get_name() }} = L.control.sideBySide(
39973990
{{ this.layer_left.get_name() }}, {{ this.layer_right.get_name() }}
39983991
).addTo({{ this._parent.get_name() }});
39993992
{% endmacro %}
4000-
"""
4001-
)
3993+
""")
40023994

40033995
def __init__(
40043996
self, layer_left, layer_right, name=None, overlay=True, control=True, show=True
@@ -4046,15 +4038,13 @@ class SideBySideLayers(JSCSSMixin, Layer):
40464038
>>> sidebyside.add_to(m)
40474039
"""
40484040

4049-
_template = Template(
4050-
"""
4041+
_template = Template("""
40514042
{% macro script(this, kwargs) %}
40524043
var {{ this.get_name() }} = L.control.sideBySide(
40534044
{{ this.layer_left.get_name() }}, {{ this.layer_right.get_name() }}
40544045
).addTo({{ this._parent.get_name() }});
40554046
{% endmacro %}
4056-
"""
4057-
)
4047+
""")
40584048

40594049
default_js = [
40604050
(
@@ -4076,8 +4066,7 @@ class CustomControl(MacroElement):
40764066
40774067
"""
40784068

4079-
_template = Template(
4080-
"""
4069+
_template = Template("""
40814070
{% macro script(this, kwargs) %}
40824071
L.Control.CustomControl = L.Control.extend({
40834072
onAdd: function(map) {
@@ -4096,8 +4085,7 @@ class CustomControl(MacroElement):
40964085
{ position: "{{ this.position }}" }
40974086
).addTo({{ this._parent.get_name() }});
40984087
{% endmacro %}
4099-
"""
4100-
)
4088+
""")
41014089

41024090
def __init__(self, html, position="bottomleft"):
41034091
def escape_backticks(text):
@@ -4114,8 +4102,7 @@ def escape_backticks(text):
41144102
class FloatText(MacroElement):
41154103
"""Adds a floating image in HTML canvas on top of the map."""
41164104

4117-
_template = Template(
4118-
"""
4105+
_template = Template("""
41194106
{% macro header(this,kwargs) %}
41204107
<style>
41214108
#{{this.get_name()}} {
@@ -4153,8 +4140,7 @@ class FloatText(MacroElement):
41534140
}
41544141
</style>
41554142
{% endmacro %}
4156-
"""
4157-
)
4143+
""")
41584144

41594145
def __init__(self, text, bottom=75, left=75):
41604146
super(FloatText, self).__init__()
@@ -4347,8 +4333,7 @@ def random_color(feature):
43474333
class GeoTIFFLayer(JSCSSMixin, Layer):
43484334
"""Leaflet layer that renders Cloud Optimized GeoTIFFs client-side."""
43494335

4350-
_template = Template(
4351-
"""
4336+
_template = Template("""
43524337
{% macro script(this, kwargs) %}
43534338
var {{ this.get_name() }} = L.layerGroup();
43544339
{% if this.control %}
@@ -4540,8 +4525,7 @@ class GeoTIFFLayer(JSCSSMixin, Layer):
45404525
}
45414526
})();
45424527
{% endmacro %}
4543-
"""
4544-
)
4528+
""")
45454529

45464530
default_js = [
45474531
("proj4", "https://cdn.jsdelivr.net/npm/proj4@2.8.1/dist/proj4.js"),
@@ -4621,8 +4605,7 @@ class PMTilesLayer(JSCSSMixin, Layer):
46214605
Adapted from https://github.com/jtmiclat/folium-pmtiles. Credits to @jtmiclat.
46224606
"""
46234607

4624-
_template = Template(
4625-
"""
4608+
_template = Template("""
46264609
{% macro script(this, kwargs) -%}
46274610
var protocol = new pmtiles.Protocol();
46284611
maplibregl.addProtocol("pmtiles", protocol.tile);
@@ -4639,8 +4622,7 @@ class PMTilesLayer(JSCSSMixin, Layer):
46394622
}).addTo({{ this._parent.get_name() }});
46404623
46414624
{%- endmacro %}
4642-
"""
4643-
)
4625+
""")
46444626
default_css = [
46454627
("maplibre_css", "https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.css")
46464628
]
@@ -4705,8 +4687,7 @@ class PMTilesMapLibreTooltip(JSCSSMixin, MacroElement):
47054687
Adapted from https://github.com/jtmiclat/folium-pmtiles. Credits to @jtmiclat.
47064688
"""
47074689

4708-
_template = Template(
4709-
"""
4690+
_template = Template("""
47104691
{% macro header(this, kwargs) %}
47114692
<style>
47124693
.maplibregl-popup {
@@ -4773,8 +4754,7 @@ class PMTilesMapLibreTooltip(JSCSSMixin, MacroElement):
47734754
setTooltipForPMTilesMapLibreLayer_{{ this.get_name() }}({{ this._parent.get_name() }});
47744755
});
47754756
{%- endmacro %}
4776-
"""
4777-
)
4757+
""")
47784758

47794759
def __init__(self, name=None, **kwargs):
47804760
# super().__init__(name=name if name else "PMTilesTooltip", **kwargs)

leafmap/map_widgets.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,14 +1085,12 @@ def __init__(
10851085
)
10861086

10871087
# Help dialog (default content)
1088-
default_help = widgets.HTML(
1089-
"""
1088+
default_help = widgets.HTML("""
10901089
<div style="line-height:1.5">
10911090
<h3 style="margin:0 0 .5rem 0">Help</h3>
10921091
<p>Add your own help content via <code>set_help_content(widget)</code>.</p>
10931092
</div>
1094-
"""
1095-
)
1093+
""")
10961094
self._help_title = v.CardTitle(class_="text-h6", children=["Help"])
10971095
self._help_cardtext = v.CardText(class_="py-4", children=[default_help])
10981096
self._help_close_btn = v.Btn(text=True, color="primary", children=["Close"])
@@ -1113,17 +1111,15 @@ def __init__(
11131111
# Global style
11141112
self._style = v.Html(
11151113
tag="style",
1116-
children=[
1117-
"""
1114+
children=["""
11181115
.rounded-xl { border-radius: 16px; }
11191116
.v-tab { border-radius: 8px; margin-right: 6px; }
11201117
.v-tab--active { background: rgba(33,150,243,.08); }
11211118
.v-data-table { background: white; }
11221119
.mdi-spin { -webkit-animation: mdi-spin 2s infinite linear; animation: mdi-spin 2s infinite linear; }
11231120
@-webkit-keyframes mdi-spin { 0% { -webkit-transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); } }
11241121
@keyframes mdi-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
1125-
"""
1126-
],
1122+
"""],
11271123
)
11281124

11291125
# Build initial tabs

0 commit comments

Comments
 (0)