-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support morphology containers #274
Conversation
0291bb1
to
76b6c67
Compare
* when the `alternative-morphs` has an `h5` version use the `morphio.Container`, to both load from a directory of from a file
76b6c67
to
3fb37a7
Compare
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.
Thank you!
if extension == "h5" and Path(morph_dir).is_file(): | ||
raise BluepySnapError( | ||
f"'{morph_dir}' is a morphology container, so a directory does not exist" | ||
) |
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.
If the circuit is using a h5 container instead of a directory, I wonder if we want to raise an error anytime that get_morphology_dir
or get_filepath
are called, regardless of the extension specified as a parameter?
Probably in the medium/long term those functions could be deprecated, but need to check in what use cases they are needed at the moment.
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.
You mean if it's the only alternaive-morphology
?
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.
Yeah, but after checking better it's already good as is, because the container file is retrieved only with extension=h5
with pytest.raises(BluepySnapError): | ||
test_obj.get_morphology_dir(extension="h5") | ||
|
||
with pytest.raises(BluepySnapError): | ||
test_obj.get_filepath(node_id, extension="h5") |
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.
Minor, but the specific reason of BluepySnapError could be checked with match=...
morphio.Container
, to both load from a directory or from a file