Skip to content

Commit

Permalink
Changed slice to use NumpySafeJSONResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
OCopping committed Mar 14, 2022
1 parent 91f4e92 commit 41a08e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webapp/blueprints/slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import re
from fastapi import APIRouter
from ..utils import safe_json_dump, LOCK
from ..utils import NumpySafeJSONResponse, LOCK

router = APIRouter()

Expand Down Expand Up @@ -39,7 +39,7 @@ def get_slice(path: str, subpath: str = "/", slice: str = None):
try:
if subpath and isinstance(file[subpath], h5py.Dataset):
sliced = file[subpath][slice_start:slice_stop:slice_step]
return safe_json_dump(sliced)
return NumpySafeJSONResponse(sliced)
else:
# meta = metadata(file["/"])
print("Path not valid or not a dataset.")
Expand Down

0 comments on commit 41a08e4

Please sign in to comment.