Skip to content

Commit

Permalink
Handling of evaluation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lfarv committed Jan 14, 2024
1 parent ccdaef6 commit f10efe1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyat/at/latticetools/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

__all__ = ['match']
__all__ = ["match"]

from typing import Optional

Expand Down
9 changes: 6 additions & 3 deletions pyat/at/latticetools/observablelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from __future__ import annotations

__all__ = [
"ObservableList",
"ObservableList",
]

from collections.abc import Iterable
Expand Down Expand Up @@ -388,7 +388,10 @@ def get_flat_shape(self, *obsnames: str):
Args:
*obsnames: names of selected observables (Default all)
"""
vals = (reduce(lambda x, y: x * y, shp, 1) for shp in self._substitute("_shape", *obsnames))
vals = (
reduce(lambda x, y: x * y, shp, 1)
for shp in self._substitute("_shape", *obsnames)
)
return (sum(vals),)

def get_values(self, *obsnames: str, err=Ellipsis) -> list:
Expand Down Expand Up @@ -531,4 +534,4 @@ def get_sum_residuals(self, *obsnames: str, err=Ellipsis) -> float:
)
flat_weights = property(get_flat_weights, doc="1-D array of Observable weights")
residuals = property(get_residuals, doc="Residuals of all observable")
sum_residuals = property(get_sum_residuals, doc="Sum of all residual values")
sum_residuals = property(get_sum_residuals, doc="Sum of all residual values")

0 comments on commit f10efe1

Please sign in to comment.