Repository: BlueBrain/MorphIO (language: python)

Issue:
issue with swc morphology
This morphology is not loadable in morphio: [fail.swc.zip](https://github.com/BlueBrain/MorphIO/files/9044455/fail.swc.zip)
with error:
```
MissingParentError: 
test_2.swc:1770:error
Sample id: 1770 refers to non-existant parent ID: 0
```
while when the last line is removed from the file, it can be loaded, and result in a single axon morphology. 

@lidakanari @eleftherioszisis , would you have any idea what is going on? It is a morphology for @YannRoussel 


Discussion / hints:
Very strange, I will look into.  I can repro with that file.
It appears `sscanf` from https://github.com/BlueBrain/MorphIO/blob/d4931369266bc24c5f283c7d04d779d02e3ae4a7/src/readers/morphologySWC.cpp#L32 is reading the line:
```
1770 2 186.598095783431 -0.0017926065475997177 71.47192685817814 0.1144 1769
```
as (not: I'm not printing as many sigfig):
```
1770                   2          186.598099           -0.001793           77.000000           71.471924                   0
```
Very peculiar... I don't have any insights from my side. the file seems to be as expected from the file format point of view
It's the `20`s in the format string; looks like it's been there from the Brion SWC parser days:
https://github.com/BlueBrain/MorphIO/blob/45f35da39a56d7ab3e6f2afad2a4d6a23800696a/brion/plugin/morphologySWC.cpp#L57

Fix patch:
diff --git a/src/readers/morphologySWC.cpp b/src/readers/morphologySWC.cpp
index 5db84a7ee..9d8d0e434 100644
--- a/src/readers/morphologySWC.cpp
+++ b/src/readers/morphologySWC.cpp
@@ -21,9 +21,9 @@ bool _ignoreLine(const std::string& line) {
 
 morphio::readers::Sample readSample(const char* line, unsigned int lineNumber_) {
 #ifdef MORPHIO_USE_DOUBLE
-    const char *const format = "%20u%20d%20lg%20lg%20lg%20lg%20d";
+    const char* const format = "%u%d%lg%lg%lg%lg%d";
 #else
-    const char *const format = "%20u%20d%20f%20f%20f%20f%20d";
+    const char* const format = "%u%d%f%f%f%f%d";
 #endif
 
     morphio::floatType radius = -1.;


Test patch:
diff --git a/tests/data/simple.swc b/tests/data/simple.swc
index 74bed5491..ac25ae1a1 100644
--- a/tests/data/simple.swc
+++ b/tests/data/simple.swc
@@ -29,4 +29,5 @@
  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
+ 9 2 -5 -4 0 2.0000000000000000000000000000000000000000000000000000000000000  7
+# long value for radius is to make sure SWC parser accepts long values