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

If NeuroVault collection doesn't contain effect request, error is somewhat cryptic #586

Closed
adelavega opened this issue Oct 20, 2021 · 5 comments
Labels
neurovault Issues/PRs related to NeuroVault.

Comments

@adelavega
Copy link
Member

sample_size = sample_sizes[0]

Minor issue, if you request a NeuroVault image from a collection and there is no match, the error is fairly cryptic (IndexError I believe).

@tsalo tsalo added the neurovault Issues/PRs related to NeuroVault. label Oct 20, 2021
@tsalo
Copy link
Member

tsalo commented Oct 20, 2021

Would something like the following work right before the sample_sizes check?

if all(not v for v in dataset_dict[f"study-{coll_name}"]["contrasts"][contrast_name]["images"].values()):
    LGR.warning(f"No valid images found for collection {coll_name} contrast {contrast_name}")
    continue

@adelavega
Copy link
Member Author

Yes, and or just an exception. Probably it shouldn't continue if after the for loop no images are found. Or at least it should not try to check sample_sizes since it will be an empty list.

@tsalo
Copy link
Member

tsalo commented Oct 20, 2021

Oh wait... @jdkent's changes in #580 will solve this issue, I think. He went with an exception.

@adelavega
Copy link
Member Author

Hah! I'm even on that branch but 24 hours too old

@jdkent
Copy link
Member

jdkent commented Oct 20, 2021

closed with #580!

@jdkent jdkent closed this as completed Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
neurovault Issues/PRs related to NeuroVault.
Projects
None yet
Development

No branches or pull requests

3 participants