Skip to content

Commit

Permalink
scale down minute salary when scale up to effective capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
BinglingICL committed Sep 5, 2024
1 parent d735bd3 commit c5dcdc2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/tlo/methods/healthsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,11 @@ def _rescale_capabilities_to_capture_effective_capability(self):
# Note: Currently relying on module variable rather than parameter for
# scale_to_effective_capabilities, in order to facilitate testing. However
# this may eventually come into conflict with the Switcher functions.

# In addition, for Class HRExpansionByOfficerType,
# for the purpose of keep cost not scaled, need to scale down minute salary when capabilities are scaled up

minute_salary = self.parameters['minute_salary']
pattern = r"FacilityID_(\w+)_Officer_(\w+)"
for officer in self._daily_capabilities.keys():
matches = re.match(pattern, officer)
Expand All @@ -1079,6 +1084,9 @@ def _rescale_capabilities_to_capture_effective_capability(self):
)
if rescaling_factor > 1 and rescaling_factor != float("inf"):
self._daily_capabilities[officer] *= rescaling_factor
minute_salary.loc[(minute_salary.Facility_ID == facility_id)
& (minute_salary.Officer_Type_Code == officer_type),
'Minute_Salary_USD'] /= rescaling_factor

def update_consumables_availability_to_represent_merging_of_levels_1b_and_2(self, df_original):
"""To represent that facility levels '1b' and '2' are merged together under the label '2', we replace the
Expand Down

1 comment on commit c5dcdc2

@marghe-molaro
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @BinglingICL, in this function you need to modify self.parameters['minute_salary'], because that's what will be later used by your HRExpansionByOfficerType function. If you update minute_salary this will not reflect on the self.parameters

Please sign in to comment.