mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-01 11:18:11 +08:00
Add user-generated annotations tests to the server (#1164)
* Add user-generated annotations tests to the server Partially completes https://github.com/chanzuckerberg/cellxgene/issues/969 * Auto-format python code * @skip_if: passing lambdas > than property strings * Respond to feedback from @bkmartinjr
This commit is contained in:
@@ -92,20 +92,18 @@ def jsonify_numpy(data):
|
||||
def dtype_to_schema(dtype):
|
||||
schema = {}
|
||||
if dtype == np.float32:
|
||||
schema['type'] = 'float32'
|
||||
schema["type"] = "float32"
|
||||
elif dtype == np.int32:
|
||||
schema['type'] = 'int32'
|
||||
schema["type"] = "int32"
|
||||
elif dtype == np.bool_:
|
||||
schema['type'] = 'boolean'
|
||||
schema["type"] = "boolean"
|
||||
elif dtype == np.str:
|
||||
schema['type'] = 'string'
|
||||
schema["type"] = "string"
|
||||
elif dtype == "category":
|
||||
schema["type"] = "categorical"
|
||||
schema["categories"] = dtype.categories.tolist()
|
||||
else:
|
||||
raise TypeError(
|
||||
f"Annotations of type {dtype} are unsupported."
|
||||
)
|
||||
raise TypeError(f"Annotations of type {dtype} are unsupported.")
|
||||
return schema
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user