Skip to content

Commit

Permalink
Update style requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed Mar 1, 2022
1 parent fe48f59 commit 8deb57e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/ambv/black
rev: 20.8b1
rev: 22.1.0
hooks:
- id: black

- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
rev: 3.9.2
hooks:
- id: flake8

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,5 @@ def get_nr_primary_components(self, threshold):
data_matrix = self.get_data_matrix()
data_matrix = data_matrix - data_matrix.mean(axis=0)
_, s, _ = np.linalg.svd(data_matrix.astype(np.float), full_matrices=False)
variance_ratio = np.cumsum(s ** 2) / np.sum(s ** 2)
variance_ratio = np.cumsum(s**2) / np.sum(s**2)
return len([1 for i in variance_ratio[:-1] if i < threshold]) + 1, s
4 changes: 2 additions & 2 deletions tests/jobs/misfit_preprocessor/test_misfit_preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def generate_simulated_responses(
new_parameters = np.random.uniform(0, 10, 3 * ensemble_size)
new_parameters.resize(ensemble_size, 3)
simulated[f"poly_{poly_idx}"] = {
(state, state): sum((new_parameters * np.array((state ** 2, state, 1))).T)
(state, state): sum((new_parameters * np.array((state**2, state, 1))).T)
for state in states
}

Expand Down Expand Up @@ -120,7 +120,7 @@ def generate_measurements(num_polynomials, poly_states=None, ensemble_size=10000
poly_states = [range(3) for _ in range(num_polynomials)]

forward_polynomials = [
lambda a, b, c, x: a * x ** 2 + b * x + c for _ in range(num_polynomials)
lambda a, b, c, x: a * x**2 + b * x + c for _ in range(num_polynomials)
]

def parameter_distribution():
Expand Down
2 changes: 1 addition & 1 deletion tests/jobs/misfit_preprocessor/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_default_spearman_threshold(criterion, default_threshold):

@pytest.mark.parametrize(
"depth",
[1, 2, 10 ** 10],
[1, 2, 10**10],
)
def test_valid_depth(depth):
config_data = {"fcluster": {"depth": depth}}
Expand Down
2 changes: 1 addition & 1 deletion tests/legacy_test_data/poly_normal/poly_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def _load_coeffs(filename):


def _evaluate(coeffs, x):
return coeffs["a"] * x ** 2 + coeffs["b"] * x + coeffs["c"]
return coeffs["a"] * x**2 + coeffs["b"] * x + coeffs["c"]


if __name__ == "__main__":
Expand Down

0 comments on commit 8deb57e

Please sign in to comment.