Coverage for src / prepare_times_nz / utilities / filepaths.py: 100%

23 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-01 22:14 +0000

1""" 

2This file surfaces our directory locations for anything else to reference 

3 

4This way any scripts can use these without hardcoding, 

5which ensures consistent locations for the whole system 

6We use Path variables to ensure consistency across separate environments. 

7 

8Note that this file expects to be in a specific location to find _REPO_ROOT 

9That means if this file is moved, the _REPO_ROOT definition will need to change 

10 

11Note that output and data intermediate directories are currently wiped on each run 

12THese are based on the addresses defined in this file. 

13 

14""" 

15 

16from pathlib import Path 

17 

18_THIS_DIR = Path(__file__).resolve().parent 

19_REPO_ROOT = _THIS_DIR.parent.parent.parent 

20 

21# main directories 

22PREP_LIBRARY_LOCATION = _THIS_DIR 

23PREP_LOCATION = _REPO_ROOT 

24TIMES_LOCATION = _REPO_ROOT.parent 

25 

26# Data directories (Top-level) 

27OUTPUT_LOCATION = PREP_LOCATION / "output" 

28DATA_INTERMEDIATE = PREP_LOCATION / "data_intermediate" 

29DATA_RAW = PREP_LOCATION / "data_raw" 

30 

31# Data raw subfolders 

32 

33ASSUMPTIONS = DATA_RAW / "coded_assumptions" 

34EXTERNAL_DATA = DATA_RAW / "external_data" 

35CONCORDANCES = DATA_RAW / "concordances" 

36 

37# Data intermediate subfolders 

38 

39STAGE_0_DATA = DATA_INTERMEDIATE / "stage_0_config" 

40STAGE_1_DATA = DATA_INTERMEDIATE / "stage_1_input_data" 

41STAGE_2_DATA = DATA_INTERMEDIATE / "stage_2_baseyear_data" 

42STAGE_3_DATA = DATA_INTERMEDIATE / "stage_3_scenario_data" 

43STAGE_4_DATA = DATA_INTERMEDIATE / "stage_4_veda_format" 

44 

45# Scripts 

46 

47STAGE_0_SCRIPTS = PREP_LOCATION / "scripts/stage_0_settings" 

48STAGE_1_SCRIPTS = PREP_LOCATION / "scripts/stage_1_prep_raw_data" 

49STAGE_2_SCRIPTS = PREP_LOCATION / "scripts/stage_2_baseyear" 

50STAGE_3_SCRIPTS = PREP_LOCATION / "scripts/stage_3_scenarios" 

51STAGE_4_SCRIPTS = PREP_LOCATION / "scripts/stage_4_veda_format" 

52 

53# Other 

54 

55ANALYSIS = PREP_LOCATION / "analysis"