Skip to content

Commit 698313b

Browse files
authored
Merge pull request #81 from anniegbryant/main
update infinity notation for infotheory + add a "max_time" estimator to the barycentre SPI
2 parents de76e1d + 0c751c6 commit 698313b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pyspi/statistics/distance.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ def __init__(self, mode="euclidean", squared=False, statistic="mean"):
237237
self._statfn = lambda x: np.nanmean(self._preproc(x))
238238
elif statistic == "max":
239239
self._statfn = lambda x: np.nanmax(self._preproc(x))
240+
elif statistic == "max_time":
241+
self._statfn = lambda x: np.argmax(self._preproc(x))
240242
else:
241243
raise NameError(f"Unknown statistic: {statistic}")
242244

pyspi/statistics/infotheory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def _compute_joint_entropy(self, data, i, j):
180180

181181
key = self._getkey()
182182
if key not in data.joint_entropy:
183-
data.joint_entropy[key] = np.full((data.n_processes, data.n_processes), -np.infty)
183+
data.joint_entropy[key] = np.full((data.n_processes, data.n_processes), -np.inf)
184184

185185
if data.joint_entropy[key][i, j] == -np.inf:
186186
x, y = data.to_numpy()[[i, j]]

0 commit comments

Comments
 (0)