wolfhece.pydownloader
Author: HECE - University of Liege, Pierre Archambeau Date: 2025
Copyright (c) 2025 University of Liege. All rights reserved.
This script and its content are protected by copyright law. Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.
Module Contents
- class wolfhece.pydownloader.DownloadType(*args, **kwds)[source]
Bases:
enum.Enum
Enum to define the type of download.
- class wolfhece.pydownloader.DownloadFiles(*args, **kwds)[source]
Bases:
enum.Enum
Enum to define the files to download.
- class wolfhece.pydownloader.DonwloadDirectories(*args, **kwds)[source]
Bases:
enum.Enum
Enum to define the directories for downloads.
- wolfhece.pydownloader.GITLAB_EXAMPLE = 'https://gitlab.uliege.be/HECE/wolf_examples/-/raw/main'[source]
- wolfhece.pydownloader.GITLAB_EXAMPLE_GPU = 'https://gitlab.uliege.be/HECE/wolfgpu_examples/-/raw/main'[source]
- wolfhece.pydownloader.clean_url(url: str) str [source]
Clean the URL by removing any query parameters or fragments.
- Parameters:
url (str) – The URL to clean.
- Returns:
The cleaned URL.
- Return type:
str
- wolfhece.pydownloader.download_file(url: str, destination: str | pathlib.Path = None, download_type: DownloadType = DownloadType.HTTP, load_from_cache: bool = True) None [source]
Download a file from the specified URL to the destination path.
- Parameters:
url (str) – The URL of the file to download.
destination (Union[str, Path]) – The path where the file will be saved.
download_type (DownloadType) – The type of download (HTTP, HTTPS, FTP).
- Returns:
None
- Raises:
requests.HTTPError – If the HTTP request fails.
- wolfhece.pydownloader.toys_dataset(dir: str, file: str, load_from_cache: bool = True)[source]
Download toy files from the WOLFHECE dataset.
- Parameters:
dir (str) – The directory where the file will be saved.
file (str) – The name of the file to download.
- Returns:
The path to the downloaded file.
- wolfhece.pydownloader.download_gpu_simulation(url: str, destination: str | pathlib.Path, load_from_cache: bool = True)[source]
Download a GPU simulation file from the WOLFHECE dataset.
- Parameters:
url (str) – The URL of the GPU simulation file to download.
destination (str | Path) – The path where the file will be saved.
load_from_cache (bool) – If True, will not download the file if it already exists.
- wolfhece.pydownloader.toys_gpu_dataset(dir: str, dirweb: str = None, load_from_cache: bool = True)[source]
Download toy simulatoin files from the WOLFHECE dataset for GPU.
- Parameters:
dir (str) – The directory where the file will be saved.
dirweb (str) – The directory of the files to download.
- Returns:
The path to the downloaded file.