Skip to content

Commit

Permalink
🩹 Fix missing matrix scaling in OptimizationMatrix.from_linked_data
Browse files Browse the repository at this point in the history
Using dataset_scale (defined in scheme at experiment level for each dataset) to scale the optimization matrix when dealing with linked dataset.

This is on top of undoing the scaling of the raw data in the previous commit.
  • Loading branch information
jsnel committed Jun 2, 2024
1 parent f6a09de commit 48d1a5b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions glotaran/optimization/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def from_linked_data(
return [
cls.link(
[
matrices[label].at_index(index)
matrices[label].at_index(index).scale(linked_data.scales[label])
for label, index in zip(
linked_data.group_definitions[linked_data.group_labels[global_index]],
linked_data.data_indices[global_index],
Expand Down Expand Up @@ -268,12 +268,12 @@ def weight(self, weight: ArrayLike) -> OptimizationMatrix:
self.array = self.array[np.newaxis, :, :] * weight.T[:, :, np.newaxis]
return self

def scale(self, scale: float) -> OptimizationMatrix:
def scale(self, scale: float | Parameter) -> OptimizationMatrix:
"""Create a matrix container with a scaled matrix.
Parameters
----------
scale : float
scale : float | Parameter
The scale.
Returns
Expand Down

0 comments on commit 48d1a5b

Please sign in to comment.