From 304c353e4c0006498ca7bdd0f36e0854da4134a6 Mon Sep 17 00:00:00 2001 From: John Cherian Date: Thu, 24 Oct 2024 15:11:14 -0700 Subject: [PATCH] clean up precommit --- src/elexmodel/models/BootstrapElectionModel.py | 4 +--- tests/models/test_bootstrap_election_model.py | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/elexmodel/models/BootstrapElectionModel.py b/src/elexmodel/models/BootstrapElectionModel.py index fba0ff0c..120109ba 100644 --- a/src/elexmodel/models/BootstrapElectionModel.py +++ b/src/elexmodel/models/BootstrapElectionModel.py @@ -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 diff --git a/tests/models/test_bootstrap_election_model.py b/tests/models/test_bootstrap_election_model.py index bdf63e1a..5bd0edc9 100644 --- a/tests/models/test_bootstrap_election_model.py +++ b/tests/models/test_bootstrap_election_model.py @@ -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):