-
Notifications
You must be signed in to change notification settings - Fork 11
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
SkeletonClient changes, mainly simplification of output formats #265
Conversation
…really what we want?
…f the skeletonization time.
del sk_json['vertex_properties'] | ||
return sk_json | ||
if endpoint_format == "flatdict": | ||
assert self._server_version >= Version("0.6.0") |
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.
This should raise a more informative exception telling the user to contact their system administrator to ask them to upgrade their skeleton service to at least 0.6.0
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.
@fcollman But this is a genuine assertion, a verification that the code is performing correctly. The function only receives "dict" and "swc" as inputs (see the function signature). Then on line 475, "dict" is translated to one of two internal formats ("jsoncompressed" or "flatdict") based on the server version. Later on, at the line you indicated in your comment, I am merely confirming (asserting) that the internal format has been assigned correctly based on the server version.
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.
@fcollman To clarify, the API, from the user's perspective outside CAVEclient, doesn't offer "flatdict" as an option. They user asks for "dict" or "swc". Those are their options. These are translated to internal formats that communicate with the server concisely to indicate which format the server should deliver. More to the point, the server really only delivers one kind of dict at at time, but it depends on which version of the server is deployed. There is no "choosing" between dictionary formats from the CAVEclient's perspective (much less from the user's perspective, removed another level of abstraction outside CAVEclient). So, this is an assertion that the code is translating the API format to the correct internal format based on which server version is available.
As for warning the user that their server is out of date, that is handled by other code earlier in the function.
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! make sense didn't read carefully enough
No description provided.