Skip to content

Commit 5aa7f16

Browse files
committed
updates to dp_metrics indicator file
1 parent 127a43c commit 5aa7f16

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

main.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,6 @@ def setup_logging():
127127
h_console.setLevel(logging.INFO)
128128
h_console.setFormatter(f_simple)
129129

130-
# Source - https://stackoverflow.com/a/55248611
131-
# Posted by lotrgollum87, modified by community. See post 'Timeline' for change history
132-
# Retrieved 2026-02-10, License - CC BY-SA 4.0
133-
134130
# Create debug log file
135131
debug_log_filename = "outputs/debug.log"
136132
os.makedirs(os.path.dirname(debug_log_filename), exist_ok=True)

src/process.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -788,24 +788,26 @@ def is_filled(col):
788788
'num_applications_online':'sum',
789789
'num_applications_in_person':'sum',
790790
'num_phone_apps_enquiries':'sum',
791-
'num_applications_by_mail':'sum'
792-
}).reset_index().rename(columns={'fy_org_id_service_id':'total_services', 'org_id': 'total_orgs_ext'}),
791+
'num_applications_by_mail':'sum',
792+
'num_applications_total':'sum'
793+
}).rename(columns={'fy_org_id_service_id':'total_services', 'org_id': 'total_orgs'}).add_suffix('_ext').reset_index(),
793794
on='fiscal_yr',
794-
how='left',
795-
suffixes=('', '_ext')
795+
how='left'
796796
)
797797

798798
dp_filtered = si_dp[si_dp['external'] & ~si_dp['service_id'].isin(EXCLUDED_SERVICES_ID)]
799799
dp_metrics = dp_metrics.merge(
800800
dp_filtered.groupby('fiscal_yr').agg({
801801
'num_applications_online':'sum', # remove 1677
802802
'num_applications_in_person':'sum', # remove 669
803-
}).reset_index(),
803+
'num_applications_total':'sum' # removed both
804+
}).add_suffix('_ext_excl_services').reset_index(),
804805
on='fiscal_yr',
805-
how='left',
806-
suffixes=('', '_ext_excl_services')
806+
how='left'
807807
)
808808

809+
810+
809811
# === DATA PACK METRIC 7 ===
810812
# 7: External programs
811813
dp_filtered = si_dp[si_dp['external']].loc[:, ['service_id', 'fiscal_yr', 'program_id', 'org_id']].copy()

0 commit comments

Comments
 (0)