Skip to content

Commit

Permalink
Adapt to changed to dict like ActiviationDataModel
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnel committed Oct 13, 2024
1 parent a02b1e5 commit 3138c49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions glotaran/builtin/items/activation/data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def create_result(
concentrations: xr.DataArray,
) -> dict[str, xr.DataArray]:
gaussian_activations = {
key:a for a in model.activations.items() if isinstance(a, MultiGaussianActivation)
key:a for key, a in model.activations.items() if isinstance(a, MultiGaussianActivation)
}
if not len(gaussian_activations):
return {}
Expand All @@ -68,10 +68,10 @@ def create_result(
activation_shifts = []
activation_dispersions = []

has_shifts = any(a.shift is not None for a in gaussian_activations)
has_dispersions = any(a.dispersion_center is not None for a in gaussian_activations)
has_shifts = any(a.shift is not None for a in gaussian_activations.values())
has_dispersions = any(a.dispersion_center is not None for a in gaussian_activations.values())

for activation in gaussian_activations:
for _, activation in gaussian_activations.items():
activations.append(activation.calculate_function(model_axis))
activation_parameters.append(
cast(list[GaussianActivationParameters], activation.parameters())
Expand Down

0 comments on commit 3138c49

Please sign in to comment.