If the color-columns
in tests/testdata/images/settings.yaml
refer to a csv column that can be parsed as numbers instead of strings then the microscopium server will fail to launch.
It is important to have this be allowed, because often you want to group things by say, animal number.
How to reproduce
If you edit tests/testdata/images/settings.yaml
and change the line that says:
color-columns:
categorical:
- gene
and change it to say this instead:
color-columns:
categorical:
- x.umap
And then you can launch the web app with:
python -m microscopium.serve tests/testdata/images/data.csv -c tests/testdata/images/settings.yaml
Error message
You don't see an error until you try to load/refresh localhost in your browser. Then you see a: 500: Internal Server Error
and the traceback in the terminal is:
$ python -m microscopium.serve tests/testdata/images/data.csv -c tests/testdata/images/settings.yaml
ready!
WARNING:bokeh.server.util:Host wildcard '*' will allow connections originating from multiple (or possibly all) hostnames or IPs. Use non-wildcard values to restrict access explicitly
ERROR:tornado.application:Uncaught exception GET / (::1)
HTTPServerRequest(protocol='http', host='localhost:5000', method='GET', uri='/', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/tornado/web.py", line 1699, in _execute
result = await result
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/tornado/gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/bokeh/server/views/doc_handler.py", line 55, in get
session = yield self.get_session()
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/tornado/gen.py", line 735, in run
value = future.result()
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/tornado/gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/bokeh/server/views/session_handler.py", line 77, in get_session
session = yield self.application_context.create_session_if_needed(session_id, self.request)
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/tornado/gen.py", line 735, in run
value = future.result()
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/tornado/gen.py", line 748, in run
yielded = self.gen.send(value)
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/bokeh/server/contexts.py", line 215, in create_session_if_needed
self._application.initialize_document(doc)
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/bokeh/application/application.py", line 178, in initialize_document
h.modify_document(doc)
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/bokeh/application/handlers/function.py", line 133, in modify_document
self._func(doc)
File "/Users/genevieve/Documents/GitHub/microscopium-universe/microscopium-feature/microscopium/serve.py", line 349, in makedoc
embed = embedding(source, settings)
File "/Users/genevieve/Documents/GitHub/microscopium-universe/microscopium-feature/microscopium/serve.py", line 204, in embedding
group_filter = GroupFilter(column_name=color_column, group=group)
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/bokeh/models/filters.py", line 111, in __init__
super(GroupFilter, self).__init__(**kw)
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/bokeh/models/filters.py", line 62, in __init__
super(Filter, self).__init__(**kw)
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/bokeh/model.py", line 307, in __init__
super(Model, self).__init__(**kwargs)
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/bokeh/core/has_props.py", line 253, in __init__
setattr(self, name, value)
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/bokeh/core/has_props.py", line 280, in __setattr__
super(HasProps, self).__setattr__(name, value)
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/bokeh/core/property/descriptors.py", line 545, in __set__
self._internal_set(obj, value, setter=setter)
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/bokeh/core/property/descriptors.py", line 766, in _internal_set
value = self.property.prepare_value(obj, self.name, value)
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/bokeh/core/property/bases.py", line 327, in prepare_value
raise e
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/bokeh/core/property/bases.py", line 320, in prepare_value
self.validate(value)
File "/Users/genevieve/anaconda3/envs/microscopium/lib/python3.6/site-packages/bokeh/core/property/bases.py", line 452, in validate
raise ValueError(msg)
ValueError: expected a value of type str, got -0.4722998308884122 of type float64
ERROR:tornado.access:500 GET / (::1) 41.45ms