Skip to content

Commit f6fca60

Browse files
committed
fix black style
1 parent c6dd96c commit f6fca60

File tree

1 file changed

+27
-29
lines changed

1 file changed

+27
-29
lines changed

generate_gallery.py

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -252,22 +252,30 @@ def generate_gallery_pages(notebook_tags, output_dir="notebooks"):
252252
categories = {
253253
"sentinel": {
254254
"title": "Sentinel Data",
255-
"description": "Notebooks showcasing Sentinel mission data processing and analysis",
255+
"description": (
256+
"Notebooks showcasing Sentinel mission data processing and analysis"
257+
),
256258
"file": f"{output_dir}/gallery-sentinel.md",
257259
},
258260
"topics": {
259261
"title": "Application Topics",
260-
"description": "Notebooks organized by Earth observation application domains",
262+
"description": (
263+
"Notebooks organized by Earth observation application domains"
264+
),
261265
"file": f"{output_dir}/gallery-topics.md",
262266
},
263267
"tools": {
264268
"title": "Tools & Libraries",
265-
"description": "Notebooks demonstrating different software tools and libraries",
269+
"description": (
270+
"Notebooks demonstrating different software tools and libraries"
271+
),
266272
"file": f"{output_dir}/gallery-tools.md",
267273
},
268274
"tutorials": {
269275
"title": "Tutorials",
270-
"description": "Notebooks demonstrating the main workflows for accessing and processing data",
276+
"description": (
277+
"Notebooks demonstrating the main workflows for accessing and processing data"
278+
),
271279
"file": f"{output_dir}/gallery-tutorials.md",
272280
},
273281
}
@@ -277,8 +285,7 @@ def generate_gallery_pages(notebook_tags, output_dir="notebooks"):
277285

278286
# Generate main gallery index
279287
with open(f"{output_dir}/gallery.md", "w") as f:
280-
f.write(
281-
"""---
288+
f.write("""---
282289
title: Notebook Gallery
283290
---
284291
@@ -289,15 +296,13 @@ def generate_gallery_pages(notebook_tags, output_dir="notebooks"):
289296
:columns: 1 1 2 3
290297
```
291298
292-
"""
293-
)
299+
""")
294300

295301
f.write("<!-- Generated by gallery plugin -->\n")
296302

297303
# Generate Sentinel category page
298304
with open(categories["sentinel"]["file"], "w") as f:
299-
f.write(
300-
f"""---
305+
f.write(f"""---
301306
title: {categories["sentinel"]["title"]}
302307
---
303308
@@ -326,13 +331,11 @@ def generate_gallery_pages(notebook_tags, output_dir="notebooks"):
326331
:columns: 1 1 2 3
327332
```
328333
329-
"""
330-
)
334+
""")
331335

332336
# Generate Topics category page
333337
with open(categories["topics"]["file"], "w") as f:
334-
f.write(
335-
f"""---
338+
f.write(f"""---
336339
title: {categories["topics"]["title"]}
337340
---
338341
@@ -368,13 +371,11 @@ def generate_gallery_pages(notebook_tags, output_dir="notebooks"):
368371
:columns: 1 1 2 3
369372
```
370373
371-
"""
372-
)
374+
""")
373375

374376
# Generate Tools category page
375377
with open(categories["tools"]["file"], "w") as f:
376-
f.write(
377-
f"""---
378+
f.write(f"""---
378379
title: {categories["tools"]["title"]}
379380
---
380381
@@ -417,13 +418,11 @@ def generate_gallery_pages(notebook_tags, output_dir="notebooks"):
417418
:columns: 1 1 2 3
418419
```
419420
420-
"""
421-
)
421+
""")
422422

423423
# Generate Tutorials category page
424424
with open(categories["tutorials"]["file"], "w") as f:
425-
f.write(
426-
"""---
425+
f.write("""---
427426
title: Tutorials
428427
---
429428
@@ -444,8 +443,7 @@ def generate_gallery_pages(notebook_tags, output_dir="notebooks"):
444443
:category: basic
445444
:columns: 1 1 2 3
446445
```
447-
"""
448-
)
446+
""")
449447

450448

451449
def analyze_notebook_content(notebook_tags):
@@ -563,8 +561,7 @@ def print_tag_examples():
563561

564562
print("\n🟢 YAML Frontmatter (Recommended)")
565563
print("Add this to the FIRST markdown cell of your notebook:")
566-
print(
567-
"""
564+
print("""
568565
---
569566
title: Your Notebook Title
570567
subtitle: Descriptive subtitle for gallery
@@ -583,8 +580,7 @@ def print_tag_examples():
583580
584581
# Your Notebook Content Starts Here
585582
...
586-
"""
587-
)
583+
""")
588584

589585
print("\n📝 Available tag categories:")
590586
print(" Sentinel: sentinel-1, sentinel-2, sentinel-3")
@@ -659,7 +655,9 @@ def parse_arguments():
659655
if args.verbose:
660656
print("\n📋 Tagged notebooks:")
661657
for path, meta in sorted(notebook_tags.items()):
662-
frontmatter_indicator = " 🏷️" if meta.get("has_explicit_tags") else " 🤖"
658+
frontmatter_indicator = (
659+
" 🏷️" if meta.get("has_explicit_tags") else " 🤖"
660+
)
663661
print(f" 📓 {path}{frontmatter_indicator}")
664662
print(f" 📂 {meta['folder']}")
665663
print(f" 🏷️ {', '.join(meta['tags'])}")

0 commit comments

Comments
 (0)