-
Notifications
You must be signed in to change notification settings - Fork 24
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
Download Sample Datasets #3725
Download Sample Datasets #3725
Conversation
@fm3 I added a first version of a sample datasets modal that shows the available sample datasets and allows to add them to webKnossos. To make it easy to test, I added a button in the dataset view. I noticed that it seems like the downloading status is never reported. When triggering the download, the status remains "available" for some seconds and then switches to "present" directly. Or maybe the downloading state is only there very briefly (I'm polling every 500ms), ideally it would be set directly after triggering the download :) The remaining functionality works very well! 🎉 Threre's still stuff missing in the frontend:
|
Thanks @daniel-wer ! Also, if the first request fails, the download wasn’t started (there are a couple of checks first), which is also not reflected in the modal’s behavior right now, it will be polling indefinitely. |
Is it guaranteed, that when requesting the sample dataset status after triggering the download of dataset X (and having waited for the response), that the status for X === "available" if and only if the download request failed or could it be that the status for X is STILL available, because the internal data structures were not updated yet?
I fixed that :) |
I shoud think so, yes.
Cool, thanks! |
|
… to add dataset view which allows to add sample datasets
I added the option to add Sample Datasets to a couple of spots (as we discussed):
I think this is ready for a first review round. Any feedback regarding the design, copy and functionality appreciated :) |
Note that the current backend version expects |
the docs link to |
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.
Nice work! I'll approve once the proper hosting is done :)
|
||
const SampleDatasetsModal = ({ destroy, onOk, organizationName }: Props) => { | ||
const [pendingDatasets, setPendingDatasets] = useState([]); | ||
const [datastores] = useDatastores(); |
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.
Could useDatastores
directly return datastores
without the array wrapper or do hooks dictate/encourage the current way?
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.
Yes it absolutely could (and probably should). At first I wanted to maintain the hooks pattern of returning [value, valueSetter], but that didn't really work out ^^
|
||
useInterval(fetchDatasets, pendingDatasets.length ? 1000 : null); | ||
|
||
const handleSampleDatasetDownload = async (name: string) => { |
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.
I'm wondering whether it makes sense to move handleSampleDatasetDownload
, the pendingDatasets
definition and the useDatastores
call into the useSampleDatasets
hook. At the moment, it feels a bit weird that failedDatasets
are provided by the useSampleDatasets
hook, but the pendingDatasets
have to be maintained at an higher level.
handleSampleDatasetDownload
would be another return argument of useSampleDatasets
then.
This would clean up the view logic here a bit, but obviously the useSampleDatasets
hook would get longer. I'd argue, that the abstraction level is more "even", though. What do you think?
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.
I struggled with that as well, thinking along the same lines ^^ I'll give this option a try and see what I can do to clean this up a little bit :)
organizationName: string, | ||
}; | ||
|
||
function useDatastores(): [Array<APIDataStore>] { |
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.
I imagine that these ten lines of code will be useful quite a lot in the future (independent of entity type, of course). We don't have to do it now, but I'd think that something like const datastores = useAsyncGet(getDataStores, [])
would be a good abstraction (naming is debatable).
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.
I created a generic useFetch
method and included a third parameter for the dependencies (for useEffect) :)
|
…loads still running works as expected
@daniel-wer I added the three datasets from above. Could you display the description in the front-end? I added it as |
@fm3 I took care of the descriptions :) |
There’s two layers named “color_2” in the datasource-properties.json in FD0144_wkw.zip. @normanrz could you update it? I suppose one of them should be “color_3”. Error handling for this is not great, but I don’t know a quick way to fix that. Created #3845 to track.
|
Thanks for fixing that @normanrz! one last thing: the real bounding box for that dataset (FD0144_wkw) seems to be smaller (I don’t see data for z>=164) so to optimize the user experience we might want to add that to the datasource-properties.json. Shouldn’t block the PR, though |
fixed |
Cool, thanks! I updated the docs. If you have no objections @philippotto @normanrz I suggest we can merge this today |
Identify a dataset that your interested in and click on `Start Skeleton Tracing` to create a new skeleton annotation. | ||
webKnossos will launch the main annotation screen allowing you to navigate your dataset and place markers to reconstruct skeletons. | ||
To get started with your first annotation, navigate to the `Datasets` tab on your [dashboard](./dashboard.md). | ||
Identify a dataset that your interested in and click on `Start Skeleton Tracing` to create a new skeleton annotation. |
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.
I know that you only changed the whitespace here, but it should be you are
🙈
Docs look good to me 👍 |
URL of deployed dev instance (used for testing):
Steps to test:
GET http://localhost:9000/data/datasets/sample/Connectomics_Department?token=secretScmBoyToken
andPOST http://localhost:9000/data/datasets/sample/Connectomics_Department/Sample_Cremi_dsA_plus/download?token=secretScmBoyToken
Issues:
[ ] Updated migration guide if applicable