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

Writing morphs we can't read in v3.3.7 #484

Open
mgeplf opened this issue Dec 13, 2023 · 5 comments
Open

Writing morphs we can't read in v3.3.7 #484

mgeplf opened this issue Dec 13, 2023 · 5 comments

Comments

@mgeplf
Copy link
Contributor

mgeplf commented Dec 13, 2023

@adrien-berchet noted that the following doesn't allow reading:

from morphio import Morphology

morph = Morphology(
    """
    1 1  0  0 0 1. -1
    2 3  0  0 0 1.  1
    3 3  0  5 0 1.  2
    4 3 -5  5 0 1.5 3
    5 3  6  5 0 1.5 3
    6 2  0  0 0 1.  1
    7 2  0 -4 0 1.  6
    8 2  6 -4 0 2.  7
    9 2 -5 -4 0 2.  7
    """,
    extension="swc")

morph.as_mutable().write("test.h5")
Morphology("test.h5")

An warning is emitted on writing:

Soma must be a contour for ASC and H5: see https://github.com/BlueBrain/MorphIO/issues/457

But on reading, it throws an exeption:

RawDataError: Morphology contour with only a single point is not valid: test.h5
@mgeplf
Copy link
Contributor Author

mgeplf commented Dec 13, 2023

We're doing the opposite of Postel's law - being strict on reading, but liberal on writing...

@adrien-berchet
Copy link
Member

A small update: the behavior is similar for ASC files.

@mgeplf
Copy link
Contributor Author

mgeplf commented Mar 19, 2024

Do you have an example?

@adrien-berchet
Copy link
Member

Yes: you just have to replace "test.h5" by "test.asc" in the first snippet :)

@mgeplf
Copy link
Contributor Author

mgeplf commented Mar 19, 2024

Ah, I forgot we were only raising a "warning" for single point somas when writing, sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants