Skip to content

helpers

Helper functions for netcdf file.

derived_rainfall_tas

derived_rainfall_tas() -> str

Sample rainfall from Tasmania.

Source code in src/efts_io/helpers.py
45
46
47
48
def derived_rainfall_tas() -> str:
    """Sample rainfall from Tasmania."""
    sample_data_file = "derived_rainfall_tas.nc"
    return get_sample_data_path(sample_data_file)

get_sample_data_path

get_sample_data_path(file_name: str) -> str

Retrieve the path to a sample data file included in the package.

Parameters:

  • file_name (str) –

    The name of the sample data file.

Returns:

  • str ( str ) –

    The path to the sample data file.

Source code in src/efts_io/helpers.py
33
34
35
36
37
38
39
40
41
42
43
def get_sample_data_path(file_name: str) -> str:
    """Retrieve the path to a sample data file included in the package.

    Args:
        file_name (str): The name of the sample data file.

    Returns:
        str: The path to the sample data file.
    """
    with importlib.resources.path("efts_io.data", file_name) as data_path:
        return str(data_path)