|
32 | 32 |
|
33 | 33 | from tlo.methods.consumables import check_format_of_consumables_file
|
34 | 34 |
|
35 |
| -# Set local Dropbox source |
36 |
| -path_to_dropbox = Path( # <-- point to the TLO dropbox locally |
37 |
| - '/Users/sm2511/Dropbox/Thanzi la Onse' |
38 |
| -) |
39 |
| - |
40 | 35 | # define a timestamp for script outputs
|
41 | 36 | timestamp = datetime.datetime.now().strftime("_%Y_%m_%d_%H_%M")
|
42 | 37 |
|
|
55 | 50 | #------------------------------------------------------
|
56 | 51 | tlo_availability_df = pd.read_csv(path_for_new_resourcefiles / "ResourceFile_Consumables_availability_small.csv")
|
57 | 52 | # Drop any scenario data previously included in the resourcefile
|
58 |
| -tlo_availability_df = tlo_availability_df[['Facility_ID', 'month', 'item_code', 'available_prop']] |
| 53 | +tlo_availability_df = tlo_availability_df[['Facility_ID', 'month', 'item_category', 'item_code', 'available_prop']] |
59 | 54 |
|
60 | 55 | # 1.1.1 Attach district, facility level, program to this dataset
|
61 | 56 | #----------------------------------------------------------------
|
|
66 | 61 | tlo_availability_df = tlo_availability_df.merge(mfl[['District', 'Facility_Level', 'Facility_ID']],
|
67 | 62 | on = ['Facility_ID'], how='left')
|
68 | 63 |
|
69 |
| -# 1.1.2 Attach programs |
70 |
| -programs = pd.read_csv(path_for_new_resourcefiles / "ResourceFile_Consumables_availability_and_usage.csv")[['category', 'item_code', 'module_name']] |
71 |
| -# TODO See if programs can be extracted from a different location as ResourceFile_Consumables_availability_and_usage.csv is now deprecated in master |
72 |
| -programs = programs.drop_duplicates('item_code') |
73 |
| -# manually add category for the two consumables for which it is missing |
74 |
| -tlo_availability_df = tlo_availability_df.merge(programs, on = ['item_code'], how = 'left') |
75 |
| - |
76 | 64 | # 1.2 Import scenario data
|
77 | 65 | #------------------------------------------------------
|
78 | 66 | scenario_availability_df = pd.read_csv(outputfilepath / "regression_analysis/predictions/predicted_consumable_availability_regression_scenarios.csv")
|
|
0 commit comments