Skip to content

Commit

Permalink
clean up precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
jjcherian committed Oct 24, 2024
1 parent 2dd0b66 commit 304c353
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/elexmodel/models/BootstrapElectionModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ def __init__(self, model_settings={}):
self.rhs_called_threshold = -0.005

# this is the correlation structure we impose when we sample from the contest level random effects
self.contest_correlations = model_settings.get(
"contest_correlations", []
)
self.contest_correlations = model_settings.get("contest_correlations", [])

# Assume that we have a baseline normalized margin
# (D^{Y'} - R^{Y'}) / (D^{Y'} + R^{Y'}) is one of the covariates
Expand Down
4 changes: 3 additions & 1 deletion tests/models/test_bootstrap_election_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def test_estimate_epsilon(bootstrap_election_model):
epsilon_hat = bootstrap_election_model._estimate_epsilon(residuals, aggregate_indicator)
assert np.isclose(epsilon_hat[0], (residuals[0] + residuals[1]) / 2)
assert np.isclose(epsilon_hat[1], (residuals[2] + residuals[3]) / 2)
assert np.isclose(epsilon_hat[2], 0) # since the aggrgate indicator for that row only has one 1 which is less than 2
assert np.isclose(
epsilon_hat[2], 0
) # since the aggrgate indicator for that row only has one 1 which is less than 2


def test_estimate_delta(bootstrap_election_model):
Expand Down

0 comments on commit 304c353

Please sign in to comment.