Skip to content

Commit 36a17d7

Browse files
committed
minor changes after refactoring
1 parent 3f1597e commit 36a17d7

File tree

4 files changed

+32
-11
lines changed

4 files changed

+32
-11
lines changed

.github/workflows/catalog_executor.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,19 @@ jobs:
2828
- name: Run script
2929
shell: bash -l {0}
3030
run: |
31-
JOB_ID=$(sbatch catalogues/catalog_executor.sh | grep -o '[0-9]\+')
31+
# Ensure the script exists and is executable, then submit via SLURM
32+
SCRIPT_PATH="scripts/catalogue/catalog_executor.sh"
33+
if [ ! -f "$SCRIPT_PATH" ]; then
34+
echo "ERROR: $SCRIPT_PATH not found"
35+
ls -la scripts/catalogue || true
36+
exit 1
37+
fi
38+
chmod +x "$SCRIPT_PATH" || true
39+
JOB_ID=$(sbatch "$SCRIPT_PATH" | grep -o '[0-9]\+')
3240
echo "Job ID: $JOB_ID"
3341
echo "JOB_ID=$JOB_ID" >> $GITHUB_ENV
3442
echo "Esperando a que termine el job $JOB_ID..."
43+
# Wait until the job disappears from the squeue
3544
while squeue -j $JOB_ID | grep -q $JOB_ID; do
3645
sleep 10
3746
done

catalogues/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
![derived-era5-single-levels-daily-statistics_catalogue.png](images/derived-era5-single-levels-daily-statistics_catalogue.png)
66

7+
## insitu-gridded-observations-europe catalogue
8+
9+
![insitu-gridded-observations-europe_catalogue.png](images/insitu-gridded-observations-europe_catalogue.png)
10+
711
## reanalysis-cerra-land catalogue
812

913
![reanalysis-cerra-land_catalogue.png](images/reanalysis-cerra-land_catalogue.png)

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ dependencies:
2929
- ibicus
3030
- seaborn
3131
- tqdm
32+
- git+https://github.com/ecmwf-projects/c3s-atlas.git

scripts/catalogue/generate_resumen.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
import os
22
import pandas as pd
33

4-
# Carpeta donde están las imágenes
5-
images_folder = "images"
6-
# CSV con la información completa
7-
all_catalogues_csv = "catalogues/all_catalogues.csv"
8-
# Nombre del fichero Markdown
9-
md_file = "README.md"
4+
# Paths corrected to match produce_catalog.py output
5+
# produce_catalog.py saves images to ../../catalogues/images
6+
images_folder = "../../catalogues/images"
7+
# produce_catalog.py writes the concatenated CSV to ../../catalogues/catalogues/all_catalogues.csv
8+
all_catalogues_csv = "../../catalogues/catalogues/all_catalogues.csv"
9+
# Write the generated markdown into the catalogues folder
10+
md_file = "../../catalogues/README.md"
1011

1112
with open(md_file, "w", encoding="utf-8") as f:
1213
f.write("# Catalogue Overview\n\n")
1314

1415
# Añadir imágenes
15-
image_files = sorted([img for img in os.listdir(images_folder) if img.endswith(".png")])
16-
for img in image_files:
17-
f.write(f"## {img.replace('_', ' ').replace('.png','')}\n\n")
18-
f.write(f"![{img}]({images_folder}/{img})\n\n")
16+
if os.path.exists(images_folder):
17+
image_files = sorted([img for img in os.listdir(images_folder) if img.endswith(".png")])
18+
for img in image_files:
19+
title = img.replace('_', ' ').replace('.png','')
20+
# Use relative path from the markdown file to the images
21+
rel_path = os.path.relpath(os.path.join(images_folder, img), os.path.dirname(md_file))
22+
f.write(f"## {title}\n\n")
23+
f.write(f"![{img}]({rel_path})\n\n")
24+
else:
25+
f.write("No images folder found.\n\n")
1926

2027
# Añadir la tabla final
2128
if os.path.exists(all_catalogues_csv):

0 commit comments

Comments
 (0)