Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-andersson committed Feb 2, 2024
1 parent e76b652 commit 5aa6789
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ dist/*
.tox/
_build
*.png
deepsensor.egg-info/
6 changes: 3 additions & 3 deletions deepsensor/active_learning/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,9 @@ def _search(self, acquisition_fn: AcquisitionFunction):
self.X_s_mask.data
] = importances
else:
self.acquisition_fn_ds.loc[
self.iteration, task["time"]
] = importances.reshape(self.acquisition_fn_ds.shape[-2:])
self.acquisition_fn_ds.loc[self.iteration, task["time"]] = (
importances.reshape(self.acquisition_fn_ds.shape[-2:])
)

return np.mean(importances_list, axis=0)

Expand Down
1 change: 0 additions & 1 deletion deepsensor/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Configuration file for deepsensor
"""


DEFAULT_LAB_EPSILON = 1e-6
"""
Magnitude of diagonal to regularise matrices with in ``backends`` library used
Expand Down
8 changes: 4 additions & 4 deletions deepsensor/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,10 @@ def unnormalise_pred_array(arr, **kwargs):
if unnormalise:
if param == "samples":
for sample_i in range(n_samples):
prediction_arrs["samples"][
sample_i
] = unnormalise_pred_array(
prediction_arrs["samples"][sample_i]
prediction_arrs["samples"][sample_i] = (
unnormalise_pred_array(
prediction_arrs["samples"][sample_i]
)
)
elif param in scale_and_offset_params:
prediction_arrs[param] = unnormalise_pred_array(arr)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ def test_prediction_shapes_highlevel(self, target_dim):
tasks,
X_t=self.da,
n_samples=n_samples,
unnormalise=True
if target_dim == 1
else False, # TODO fix unnormalising for multiple equally named targets
unnormalise=(
True if target_dim == 1 else False
), # TODO fix unnormalising for multiple equally named targets
)
assert [isinstance(ds, xr.Dataset) for ds in pred.values()]
for var_ID in pred:
Expand Down

0 comments on commit 5aa6789

Please sign in to comment.