-
Notifications
You must be signed in to change notification settings - Fork 6
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
Make sanitize section deletion non-recursive #107
Conversation
Before fixing the rest of the tests that use morphologies with zero length root sections, I wonder if raising an error is the desirable way to go. Alternatively, we could skip the root sections that have zero lengths and emit a warning. This less aggressive approach would allow to sanitize a morphology even if it has zero length root sections. The root sections would be left untouched. @mgeplf @FrancescoCasalegno @lidakanari @arnaudon @adrien-berchet |
But that we would end up with sanitized neurites (the ones whose root section has length > 0) and with not sanitized neurites (the ones with 0-length root section), which is a bit weird, isn't it? Or maybe we could still sanitize all the sections except the root when it has length = 0? |
I rephrased the last sentence. I meant to sanitize the length of all sections but the root ones. Sorry, for the confusion. |
Ah ok ok, sorry I miss understood. I agree with that then :) |
Hi @eleftherioszisis ! As far as I understand there is no 100% clear reason why cannot just have 0-length root sections ( Now, how do we handle those 0-length root sections during
So, since there was no agreement on the what is the most "logical" solution to the issue, I think that raising an Error may be a good solution. An alternative would be to create a parameter |
Sure, I prefer raising an error to adding a parameter too. I will keep it strict, thanks. |
I second raising an error; warning tend to get ignored, IMO, and parameters opens the pandoras box for having options for all the sanitization. |
@@ -6,68 +6,72 @@ | |||
DATA = Path(__file__).parent / 'data' | |||
|
|||
|
|||
def _run(command): |
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 changes in this module are just some refactoring mainly for not filtering the exception when an error is thrown and some formatting. You can ignore them.
When a zero length section is encountered, the sanitization deleted the entire subtree.
This change limits the deletion to the zero-length section only. If a root section with zero length is encountered, an error will be raised.
#99 #105 #106