-
Notifications
You must be signed in to change notification settings - Fork 47
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 rockets python client #587
Conversation
ca51f8d
to
3abd3c4
Compare
from .api_generator import build_api | ||
from .base import BaseClient | ||
from .utils import obtain_registry, convert_snapshot_response_to_PIL, SCHEMA_ENDPOINT | ||
from . import utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not move what you have at .
in utils
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I see that it is there, so why import that one differently? Why not:
from .utils import obtain_registry, convert_snapshot_response_to_PIL, SCHEMA_ENDPOINT, in_notebook
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a trap! The mocking otherwise does not work if the method is not used via its module name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
brayns/common/types.h
Outdated
{ | ||
SYNC, | ||
ASYNC | ||
} type{SYNC}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few things here:
- I feel that SYNC/ASYNC is somewhat confusing with the way the methods can be used be the client (a SYNC request can still be called in an async fashion by the async client)... What it really tries to say is "standard rpc" / "rpc that can be cancelled with progress report"; although I don't know how to express that succinctly...
- any reason to use
enum
instead ofenum class
? - style: I'm not a big fan of this compact notation that's doing two things at once, it's easy to miss the class member hiding here, I'd rather write this in two lines, but that's personal.
brayns/common/types.h
Outdated
}; | ||
|
||
/** Description for RPC with one parameter. */ | ||
struct RpcParameterDescription | ||
struct RpcParameterDescription : public RpcDescription |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(public is default for struct)
python/brayns/base.py
Outdated
self.version.patch]) | ||
return "Brayns version {0} running on {1}".format(version, self.http_url) | ||
|
||
def set_colormap(self, palette, intensity=1, opacity=1, data_range=(0, 256)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0,256 -> 0,255? Or is the range interpreted as [0,256[ (not included) ?
python/brayns/base.py
Outdated
def function_builder(): | ||
"""Wrapper for returning the animation_slider() function.""" | ||
def animation_slider(): | ||
""".Show slider to control animation""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. misplaced :-)
python/brayns/client.py
Outdated
schemas)) | ||
# pylint: enable=protected-access,cell-var-from-loop | ||
schemas_dict[request.params['endpoint']] = response[0].result | ||
build_api(self, registry, schemas_dict) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code duplicated from AsyncClient? Move to base class?
3abd3c4
to
77cd02d
Compare
- add new AsyncClient - improve code generation - add more tests
77cd02d
to
cad051e
Compare
retest this please |
Need a review again actually |
No description provided.