Skip to content

Commit

Permalink
Update qoi.py
Browse files Browse the repository at this point in the history
  • Loading branch information
anirban-chaudhuri committed Aug 10, 2024
1 parent 4f54dd3 commit 233ae7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyciemss/ouu/qoi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def obs_nday_average_qoi(
Note: last ndays timepoints is assumed to represent last n-days of simulation.
"""
dataQoI = samples[contexts[0]].detach().numpy()

dataQoI = np.atleast_2d(np.squeeze(dataQoI))
return np.mean(dataQoI[:, -ndays:], axis=1)


Expand All @@ -25,5 +25,5 @@ def obs_max_qoi(samples: Dict[str, torch.Tensor], contexts: List) -> np.ndarray:
samples[VARIABLE] is expected to have dimension (nreplicates, ntimepoints)
"""
dataQoI = samples[contexts[0]].detach().numpy()

dataQoI = np.atleast_2d(np.squeeze(dataQoI))
return np.max(dataQoI, axis=1)

0 comments on commit 233ae7c

Please sign in to comment.