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

Bokeh plotter #714

Merged
merged 16 commits into from
Nov 9, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions ctapipe/tools/bokeh/file_viewer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,5 +392,13 @@ def on_dl1_widget_change(self, _, __, ___):
self._updating_dl1 = False


exe = BokehFileViewer()
exe.run()
def main():
exe = BokehFileViewer()
exe.run()


if 'bk_script' in __name__:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is very unusual. What is this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To run a bokeh server you have to execute bokeh serve on the script instead of python. When you do this, __name__ equals something like "bk_script_dc88af7ef51b4e0d85854896dd662ed0", where the third term seems to be random.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, there may be a way to avoid having to use bokeh serve if I can understand how to utilise this: http://bokeh.pydata.org/en/latest/docs/user_guide/server.html#embedding-bokeh-server-as-a-library

main()

if __name__ == '__main__':
main()