mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-30 01:48:12 +08:00
Minimum working iterator version
Checkpointing. This is a minimum working version using the iterator. I basically hacked consuming the iterator since I want to switch directions, but this is a good place to come back to.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import json
|
||||
from numpy import float32, integer
|
||||
from flask import make_response, jsonify
|
||||
from flask import make_response, jsonify, Response
|
||||
|
||||
class Float32JSONEncoder(json.JSONEncoder):
|
||||
def default(self, obj):
|
||||
@@ -31,4 +31,13 @@ def make_payload(data, errormessage="", errorcode=200):
|
||||
}
|
||||
}), errorcode)
|
||||
|
||||
def make_streaming_response(data_generator, errorcode=200, content_type="application/json"):
|
||||
# TODO headers
|
||||
return Response(data_generator, status=errorcode, content_type=content_type)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user