Skip to content

Commit

Permalink
added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lennybronner committed Aug 19, 2024
1 parent 47b3475 commit 4218811
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/elexmodel/models/BootstrapElectionModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,9 @@ def get_national_summary_estimates(
# for contests called for the RHS party. So this sum gives us the number of called contests for RHS
called_contests_rhs = np.nansum(1 - called_states_sorted_vals)

# Our values should not be lower than the number of called
# Since the values should be greater than the called_contests_lhs we max with that and since they
# should be less than the called_contests_rhs we min with that. Also we add in the base to account
# for uncontested races.
agg_pred = min(max(aggregate_dem_vals_pred, called_contests_lhs), called_contests_rhs) + base_to_add
agg_lower = min(max(interval_lower, called_contests_lhs), called_contests_rhs) + base_to_add
agg_upper = min(max(interval_upper, called_contests_lhs), called_contests_rhs) + base_to_add
Expand Down

0 comments on commit 4218811

Please sign in to comment.