File size: 1,591 Bytes
0ab0788
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from huggingface_hub import snapshot_download
import os
import traceback

cache_path = os.path.expanduser("~/.cache/huggingface/hub")

try:
    print("Téléchargement des métadonnées...")
    snapshot_download(
        repo_id="ncsdecoopman/ExtremePrecipit",
        repo_type="dataset",
        revision="main",
        local_dir="data",
        cache_dir=cache_path,
        allow_patterns=["metadonnees/*"]
    )

    print("Téléchargement des reliefs...")
    snapshot_download(
        repo_id="ncsdecoopman/ExtremePrecipit",
        repo_type="dataset",
        revision="main",
        local_dir="data",
        cache_dir=cache_path,
        allow_patterns=["external/*"]
    )
     
    for echelle in ["quotidien", "horaire"]:
        print(f"Téléchargement des statistiques AROMES (mod)... - Echelle {echelle}")
        snapshot_download(
            repo_id="ncsdecoopman/ExtremePrecipit",
            repo_type="dataset",
            revision="main",
            local_dir="data",
            cache_dir=cache_path,
            allow_patterns=["statisticals/modelised*"]
        )

        print(f"Téléchargement des statistiques STATIONS observées... - Echelle {echelle}")
        snapshot_download(
            repo_id="ncsdecoopman/ExtremePrecipit",
            repo_type="dataset",
            revision="main",
            local_dir="data",
            cache_dir=cache_path,
            allow_patterns=["statisticals/observed*"]
        )   

except Exception as e:
    print("Erreur pendant le téléchargement :")
    traceback.print_exc()
    raise SystemExit(1)