Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/readers/morphologySWC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ class SWCBuilder
throw RawDataError(err_.ERROR_SELF_PARENT(sample.id));
}

if (sample.type >= SECTION_OUT_OF_RANGE_START || sample.type <= 0) {
if (sample.type >= SECTION_OUT_OF_RANGE_START || sample.type < 0) {
details::ErrorMessages err_(path_);
throw RawDataError(
err_.ERROR_UNSUPPORTED_SECTION_TYPE(sample.lineNumber, sample.type));
Expand Down
10 changes: 10 additions & 0 deletions tests/test_1_swc.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,3 +660,13 @@ def test_WarningHandlerCollector():
Morphology("", extension="swc", warning_handler=warnings1)
assert len(warnings0.get_all()) == 2
assert len(warnings1.get_all()) == 1


def test_0_defined():
contents =('''
1 1 5 2 2 3 -1
2 0 4 2 1 1 1
''')
m = Morphology(contents, "swc")
assert m.sections[0].type == morphio.SectionType.undefined

Loading