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:
Matt Weiden
2020-02-23 15:32:13 -08:00
committed by GitHub
parent fb1f0c6469
commit c7f2032dd7
65 changed files with 377 additions and 223 deletions
+5 -7
View File
@@ -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