-
Notifications
You must be signed in to change notification settings - Fork 8
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
refactor(spm): initial refactor of internals to work with new API #114
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
if TYPE_CHECKING: | ||
from numpy.typing import DTypeLike, NDArray | ||
|
||
Shape = Tuple[int, ...] |
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.
Moved to spec.py to avoid unnecessarily importing the native core module when only these simple types are required.
I haven't yet completed a full end-to-end tests (re-run the example notebooks) will the real API running, some more changes may come if I find any issues with that. Otherwise the core migration has been completed. |
what do you think about adding |
Interface remains largely the same, with some deprecations and changes to return values for asset endpoints
Mocks client functions rather than API requests. This is not the greatest, but mocking the HTTP requests would have been way more complicated
@Puratinamu will do for controllers, but how would you do this for datasets? Something like this?:
|
That sounds good. |
20a6d37
to
168f3a3
Compare
Including better changelog
@@ -1,5 +1,37 @@ | |||
# Changelog | |||
|
|||
## Next |
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.
Discussed with Rich , all of these are OK as long as they're well documented
Ready for another round of review, might have to do another look over the docs closer to deployment to ensure they're still accurate. |
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.
looks good, few more small things
cryosparc/tools.py
Outdated
@@ -83,25 +87,24 @@ class CryoSPARC: | |||
``base_port + 5`` should be accessible on the network. |
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.
do the port numbers mentioned here have to change with the port number shuffling in SPM?
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.
Good catch, will reword
# TODO: limit find to one workspace | ||
workspaces = self.api.workspaces.find(project_uid=[project_uid], order=-1) |
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 is this TODO not implemented?
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.
The find
endpoint doesn't currently accept a limit
argument, none of the find
endpoints do. They definitely should, but as a larger pagination task.
if workspace_uid is None: | ||
# TODO: limit find to one workspace | ||
workspaces = self.api.workspaces.find(project_uid=[project_uid], order=-1) | ||
workspace = workspaces[0] if workspaces else self.api.workspaces.create(project_uid, title=title) |
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 makes the title of the workspace the same as the title of the output? Maybe it should be something more generic like "Tools Workspace for <title>"? similarly for the job
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.
We just need some title in a rare case like this, and I'd prefer not to make up a naming convention like this in English - imagining a scenario where someone in Germany records all their project and workspace titles in German, but suddenly sees "Tools Workspace for Ergebnisse der Datenanalyse" or something like that. I know we already do this in some places, but I'd like to minimize this if we don't have to.
Move everything relevant into submodules, as per review feedback at #114 (comment)
CryoSPARC.cli
,.vis
,.rtp
with single.api
key