Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a palette of arbitrary size for large trends #172

Merged
merged 4 commits into from
Nov 10, 2019

Conversation

dechamps
Copy link
Contributor

Spectral6 only has 6 colours. zip() will stop as soon as the palette is exceeded, leading to a HTTP 500 error when loading the trend:

ERROR:tornado.application:Uncaught exception GET /trends/autoload.js?bokeh-autoload-element=1001&bokeh-app-path=/trends&bokeh-absolute-url=http://10.173.6.1:5006/trends (10.173.6.1)
HTTPServerRequest(protocol='http', host='10.173.6.1:5006', method='GET', uri='/trends/autoload.js?bokeh-autoload-element=1001&bokeh-app-path=/trends&bokeh-absolute-url=http://10.173.6.1:5006/trends', version='HTTP/1.1', remote_ip='10.173.6.1')
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/tornado/web.py", line 1699, in _execute
    result = await result
  File "/usr/local/lib/python3.7/dist-packages/tornado/gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "/usr/local/lib/python3.7/dist-packages/bokeh/server/views/autoload_js_handler.py", line 60, in et
    session = yield self.get_session()
  File "/usr/local/lib/python3.7/dist-packages/tornado/gen.py", line 735, in run
    value = future.result()
  File "/usr/local/lib/python3.7/dist-packages/tornado/gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "/usr/local/lib/python3.7/dist-packages/bokeh/server/views/session_handler.py", line 79, in get_session
    session = yield self.application_context.create_session_if_needed(session_id, self.request)
  File "/usr/local/lib/python3.7/dist-packages/tornado/gen.py", line 735, in run
    value = future.result()
  File "/usr/local/lib/python3.7/dist-packages/tornado/gen.py", line 748, in run
    yielded = self.gen.send(value)
  File "/usr/local/lib/python3.7/dist-packages/bokeh/server/contexts.py", line 222, in create_session_if_needed
    self._application.initialize_document(doc)
  File "/usr/local/lib/python3.7/dist-packages/bokeh/application/application.py", line 178, in initialize_document
    h.modify_document(doc)
  File "/home/e-t172/dev/BAC0/BAC0/web/BokehRenderer.py", line 246, in modify_document
    self.build_plot()
  File "/home/e-t172/dev/BAC0/BAC0/web/BokehRenderer.py", line 142, in build_plot
    color=color_mapper[each.name],
KeyError: '20-06/Screen Status'

@coveralls
Copy link

coveralls commented Nov 10, 2019

Coverage Status

Coverage decreased (-0.03%) to 47.537% when pulling 6c63d4d on dechamps:palette into 65e1476 on ChristianTremblay:master.

Spectral6 only has 6 colors. zip() will stop as soon as the palette is exceeded,
leading to a HTTP 500 error when loading the trend:

	ERROR:tornado.application:Uncaught exception GET /trends/autoload.js?bokeh-autoload-element=1001&bokeh-app-path=/trends&bokeh-absolute-url=http://10.173.6.1:5006/trends (10.173.6.1)
	HTTPServerRequest(protocol='http', host='10.173.6.1:5006', method='GET', uri='/trends/autoload.js?bokeh-autoload-element=1001&bokeh-app-path=/trends&bokeh-absolute-url=http://10.173.6.1:5006/trends', version='HTTP/1.1', remote_ip='10.173.6.1')
	Traceback (most recent call last):
	  File "/usr/local/lib/python3.7/dist-packages/tornado/web.py", line 1699, in _execute
	    result = await result
	  File "/usr/local/lib/python3.7/dist-packages/tornado/gen.py", line 742, in run
	    yielded = self.gen.throw(*exc_info)  # type: ignore
	  File "/usr/local/lib/python3.7/dist-packages/bokeh/server/views/autoload_js_handler.py", line 60, in get
	    session = yield self.get_session()
	  File "/usr/local/lib/python3.7/dist-packages/tornado/gen.py", line 735, in run
	    value = future.result()
	  File "/usr/local/lib/python3.7/dist-packages/tornado/gen.py", line 742, in run
	    yielded = self.gen.throw(*exc_info)  # type: ignore
	  File "/usr/local/lib/python3.7/dist-packages/bokeh/server/views/session_handler.py", line 79, in get_session
	    session = yield self.application_context.create_session_if_needed(session_id, self.request)
	  File "/usr/local/lib/python3.7/dist-packages/tornado/gen.py", line 735, in run
	    value = future.result()
	  File "/usr/local/lib/python3.7/dist-packages/tornado/gen.py", line 748, in run
	    yielded = self.gen.send(value)
	  File "/usr/local/lib/python3.7/dist-packages/bokeh/server/contexts.py", line 222, in create_session_if_needed
	    self._application.initialize_document(doc)
	  File "/usr/local/lib/python3.7/dist-packages/bokeh/application/application.py", line 178, in initialize_document
	    h.modify_document(doc)
	  File "/home/e-t172/dev/BAC0/BAC0/web/BokehRenderer.py", line 246, in modify_document
	    self.build_plot()
	  File "/home/e-t172/dev/BAC0/BAC0/web/BokehRenderer.py", line 142, in build_plot
	    color=color_mapper[each.name],
	KeyError: '20-06/Screen Status'
@ChristianTremblay
Copy link
Owner

Yeah, I guess it was not the best choice :)

@ChristianTremblay ChristianTremblay merged commit 3d96f1e into ChristianTremblay:develop Nov 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants