Skip to content

Commit

Permalink
update variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
Kubvv committed Mar 26, 2024
1 parent 00eb2a5 commit e3cc5ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions pabutools/analysis/mesanalytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ def calculate_effective_supports(
dict[:py:class:`~pabutools.election.instance.Project`, int]
Dictionary of pairs (:py:class:`~pabutools.election.instance.Project`, effective support).
"""
effective_vote_counts: dict[Project, int] = {}
effective_supports: dict[Project, int] = {}
if final_budget:
instance.budget_limit = final_budget
for project in instance:
effective_vote_counts[project] = calculate_effective_support(
effective_supports[project] = calculate_effective_support(
instance, profile, project, mes_params
)

return effective_vote_counts
return effective_supports


def calculate_effective_support(
Expand Down Expand Up @@ -209,7 +209,7 @@ def calculate_effective_support(
mes_params["resoluteness"] = True
return method_of_equal_shares(
instance, profile, **mes_params
).details.skipped_project_eff_vote_count
).details.skipped_project_eff_support


def _create_project_loss(
Expand Down
10 changes: 5 additions & 5 deletions pabutools/rules/mes/mes_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ def mes_inner_algo(
if analytics and skipped_project:
cover = sum(voters[i].budget for i in skipped_project.supporter_indices)
new_eff = int(cover / skipped_project.cost * 100)
current_alloc.details.skipped_project_eff_vote_count = max(
new_eff, current_alloc.details.skipped_project_eff_vote_count
current_alloc.details.skipped_project_eff_support = max(
new_eff, current_alloc.details.skipped_project_eff_support
)
if resoluteness:
all_allocs.append(current_alloc)
Expand Down Expand Up @@ -459,8 +459,8 @@ def mes_inner_algo(
best_afford * skipped_project.supporters_sat(voters[i]),
)
new_eff = int(cover / skipped_project.cost * 100)
current_alloc.details.skipped_project_eff_vote_count = max(
new_eff, current_alloc.details.skipped_project_eff_vote_count
current_alloc.details.skipped_project_eff_support = max(
new_eff, current_alloc.details.skipped_project_eff_support
)
mes_inner_algo(
instance,
Expand Down Expand Up @@ -588,7 +588,7 @@ def method_of_equal_shares_scheme(
p for p in projects if p.name == skipped_project.name
)
projects = [p for p in projects if p.name != skipped_project.name]
budget_allocation.details.skipped_project_eff_vote_count = 0
budget_allocation.details.skipped_project_eff_support = 0

previous_outcome: BudgetAllocation | list[BudgetAllocation] = budget_allocation

Expand Down

0 comments on commit e3cc5ab

Please sign in to comment.