Coverage for mlair/configuration/ifs_settings.py: 38%

6 statements  

« prev     ^ index     » next       coverage.py v6.4.2, created at 2023-06-30 10:22 +0000

1"""Settings to access not public era5 data.""" 

2 

3from typing import Tuple 

4 

5 

6def ifs_settings(sampling="daily", ifs_data_path=None, ifs_file_names=None) -> Tuple[str, str]: 

7 """ 

8 Check for sampling as only hourly resolution is supported by ifs and return path on HPC systems. 

9 

10 :param sampling: temporal resolution to load data for, only hourly supported (default "daily") 

11 

12 :return: HPC path 

13 """ 

14 if sampling == "hourly": # pragma: no branch 

15 IFS_DATA_PATH = ifs_data_path or "." 

16 FILE_NAMES = ifs_file_names or "*.nc" 

17 else: 

18 raise NameError(f"Given sampling {sampling} is not supported, only hourly sampling can be used.") 

19 return IFS_DATA_PATH, FILE_NAMES