Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed May 27, 2021
1 parent 7645233 commit c34d809
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/uhi/numpy_plottable.py
Expand Up @@ -258,17 +258,17 @@ def variances(self) -> np.ndarray:
return self.values()

def counts(self) -> np.ndarray:
if self.hasWeights:
sumw = self.values()
return np.divide( # type: ignore
sumw ** 2,
self.variances(),
out=np.zeros_like(sumw, dtype=np.float64),
where=sumw != 0,
)
else:
if not self.hasWeights:
return self.values()

sumw = self.values()
return np.divide( # type: ignore
sumw ** 2,
self.variances(),
out=np.zeros_like(sumw, dtype=np.float64),
where=sumw != 0,
)


if TYPE_CHECKING:
# Verify that the above class is a valid PlottableHistogram
Expand Down

0 comments on commit c34d809

Please sign in to comment.