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

SkeletonClient changes, mainly simplification of output formats #265

Merged
merged 30 commits into from
Nov 18, 2024

Conversation

kebwi
Copy link
Collaborator

@kebwi kebwi commented Nov 12, 2024

No description provided.

del sk_json['vertex_properties']
return sk_json
if endpoint_format == "flatdict":
assert self._server_version >= Version("0.6.0")
Copy link
Collaborator

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

Copy link
Collaborator Author

@kebwi kebwi Nov 18, 2024

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.

Copy link
Collaborator Author

@kebwi kebwi Nov 18, 2024

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.

Copy link
Collaborator

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

@fcollman fcollman merged commit e37c616 into master Nov 18, 2024
16 checks passed
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.

3 participants