Add PerspectiveManager remote API for Python, Tornado server example#743
Merged
Add PerspectiveManager remote API for Python, Tornado server example#743
Conversation
…xample tornado server
Codecov Report
@@ Coverage Diff @@
## master #743 +/- ##
==========================================
- Coverage 93.36% 91.32% -2.05%
==========================================
Files 61 63 +2
Lines 2970 3169 +199
==========================================
+ Hits 2773 2894 +121
- Misses 197 275 +78
Continue to review full report at Codecov.
|
Member
|
Thanks for the PR! Looks great! |
timkpaine
reviewed
Sep 28, 2019
| import pandas as pd | ||
| import sys | ||
| import os | ||
| sys.path.insert(1, os.path.join(sys.path[0], '..')) |
timkpaine
reviewed
Sep 28, 2019
| # call the underlying method on the Table or View | ||
| getattr(table_or_view, method)(callback, *msg.get("args", [])) | ||
| else: | ||
| print("callback not found for remote call {}".format(msg)) |
Member
There was a problem hiding this comment.
avoid prints, use logging if you want to print
| if msg["cmd"] == "view_method": | ||
| del self._views[msg["name"]] | ||
| except Exception as error: | ||
| print(self._make_error_message(msg["id"], error)) |
| else: | ||
| print("callback not found for remote call {}".format(msg)) | ||
| except Exception as error: | ||
| print(self._make_error_message(msg["id"], error)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the PerspectiveManager class, which parses JSON messages from a client perspective and allows for operations in perspective-python on a dataset in python memory, streamed through a WebSocket to a client perspective operating in the browser.
This configuration is not subject to browser memory constraints or the 2GB WebAssembly memory limit, and takes advantage of TBB for parallel processing on the server side. Configuration has been tested locally with 10 million rows, streamed with zero lag to the browser.
Additionally, this has the side benefit of allowing us to serve dataframes and Numpy array-based datasets to the client through the python API.