Skip to content
Open
8 changes: 6 additions & 2 deletions src/ansys/fluent/core/examples/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from pathlib import Path
import re
import shutil
from typing import TypeAlias
import zipfile

import ansys.fluent.core as pyfluent
Expand Down Expand Up @@ -71,10 +72,13 @@ def _get_file_url(file_name: str, directory: str | None = None) -> str:
return f"https://github.com/ansys/example-data/raw/main/{file_name}"


PathType: TypeAlias = "os.PathLike[str | bytes] | str | bytes"


def _retrieve_file(
url: str,
file_name: str,
save_path: str | None = None,
save_path: PathType | None = None,
return_without_path: bool | None = False,
) -> str:
"""Download specified file from specified URL."""
Expand Down Expand Up @@ -121,7 +125,7 @@ def _retrieve_file(
def download_file(
file_name: str,
directory: str | None = None,
save_path: str | None = None,
save_path: PathType | None = None,
return_without_path: bool | None = None,
) -> str:
"""Download specified example file from the Ansys example data repository.
Expand Down
Loading