Skip to content

Commit e9a81c8

Browse files
committed
fix: order of operations
1 parent 0fb5123 commit e9a81c8

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

timeseries/app/main.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ async def info():
4545
return info_dict
4646

4747

48-
@app.get("/test-sentry")
49-
async def test_sentry():
50-
raise Exception("Testing sentry integration")
51-
52-
5348
@app.exception_handler(TimeseriesTimeoutError)
5449
async def timeseries_timeout_error_handler(
5550
request: Request, exc: TimeseriesTimeoutError

timeseries/app/schemas/timeseries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def rolling_z_score(xs, width):
3838
for i in numba.prange(n):
3939
m = np.nanmean(xs[i : (i + width)])
4040
s = np.nanstd(xs[i : (i + width)])
41-
results[i] = np.nan if s == 0 else xs[i + width] - m / s
41+
results[i] = np.nan if s == 0 else (xs[i + width] - m) / s
4242
return results
4343
""" FIXME: consider converting xs numpy array into a pandas DataFrame and use something like the following
4444
from https://stackoverflow.com/questions/47164950/compute-rolling-z-score-in-pandas-dataframe

0 commit comments

Comments
 (0)