Skip to main content

ophth_ds_utils

Utility functions for interacting with ophthalmology datasources.

Module​

Functions​

make_path_absolute​

def make_path_absolute(    file_path: str | os.PathLike[str], parent_folder: str | os.PathLike[str],) ‑> pathlib.Path:

Makes a relative file path absolute with respect to a parent folder.

Does not change an already absolute file path.

make_path_relative​

def make_path_relative(    file_path: str | os.PathLike[str], parent_folder: str | os.PathLike[str],) ‑> pathlib.Path:

Makes an absolute file path relative with respect to a parent folder.

Does not change an already relative file path.

Uses path_relative_to_base so that paths under symlinked subfolders of parent_folder are still correctly expressed as relative (resolve first, then symlink-aware fallback when enabled in config).

Classes​

NoParserForFileExtension​

class NoParserForFileExtension(*args, **kwargs):

Indicates no parser was specified for a file extension.