morphio 2.5.3__tar.gz → 2.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. {MorphIO-2.5.3 → MorphIO-2.6.0}/.github/workflows/publish-sdist-wheels.yml +1 -1
  2. {MorphIO-2.5.3 → MorphIO-2.6.0}/MorphIO.egg-info/PKG-INFO +4 -4
  3. {MorphIO-2.5.3 → MorphIO-2.6.0}/MorphIO.egg-info/SOURCES.txt +1 -2
  4. {MorphIO-2.5.3 → MorphIO-2.6.0}/PKG-INFO +4 -4
  5. {MorphIO-2.5.3 → MorphIO-2.6.0}/README.md +3 -3
  6. {MorphIO-2.5.3 → MorphIO-2.6.0}/binds/python/bind_misc.cpp +2 -0
  7. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/enums.h +1 -0
  8. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/properties.h +3 -1
  9. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/enums.cpp +2 -0
  10. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/readers/morphologyHDF5.cpp +64 -192
  11. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/readers/morphologyHDF5.h +1 -6
  12. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/requirement_tests.txt +1 -0
  13. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/test_3_h5.py +13 -19
  14. MorphIO-2.5.3/tests/data/h5/v2/no-metadata.h5 +0 -0
  15. {MorphIO-2.5.3 → MorphIO-2.6.0}/.clang-format +0 -0
  16. {MorphIO-2.5.3 → MorphIO-2.6.0}/.github/workflows/clang_format_check.yaml +0 -0
  17. {MorphIO-2.5.3 → MorphIO-2.6.0}/.github/workflows/run-tests.yml +0 -0
  18. {MorphIO-2.5.3 → MorphIO-2.6.0}/.gitignore +0 -0
  19. {MorphIO-2.5.3 → MorphIO-2.6.0}/.gitmodules +0 -0
  20. {MorphIO-2.5.3 → MorphIO-2.6.0}/.travis.yml +0 -0
  21. {MorphIO-2.5.3 → MorphIO-2.6.0}/3rdparty/CMakeLists.txt +0 -0
  22. {MorphIO-2.5.3 → MorphIO-2.6.0}/CHANGLOG.md +0 -0
  23. {MorphIO-2.5.3 → MorphIO-2.6.0}/CMake/CompilerFlags.cmake +0 -0
  24. {MorphIO-2.5.3 → MorphIO-2.6.0}/CMake/MorphIOConfig.cmake +0 -0
  25. {MorphIO-2.5.3 → MorphIO-2.6.0}/CMakeLists.txt +0 -0
  26. {MorphIO-2.5.3 → MorphIO-2.6.0}/CONTRIBUTING.md +0 -0
  27. {MorphIO-2.5.3 → MorphIO-2.6.0}/COPYING +0 -0
  28. {MorphIO-2.5.3 → MorphIO-2.6.0}/COPYING.LESSER +0 -0
  29. {MorphIO-2.5.3 → MorphIO-2.6.0}/MANIFEST.in +0 -0
  30. {MorphIO-2.5.3 → MorphIO-2.6.0}/MorphIO.egg-info/dependency_links.txt +0 -0
  31. {MorphIO-2.5.3 → MorphIO-2.6.0}/MorphIO.egg-info/not-zip-safe +0 -0
  32. {MorphIO-2.5.3 → MorphIO-2.6.0}/MorphIO.egg-info/requires.txt +0 -0
  33. {MorphIO-2.5.3 → MorphIO-2.6.0}/MorphIO.egg-info/top_level.txt +0 -0
  34. {MorphIO-2.5.3 → MorphIO-2.6.0}/binds/python/CMakeLists.txt +0 -0
  35. {MorphIO-2.5.3 → MorphIO-2.6.0}/binds/python/bind_enums.h +0 -0
  36. {MorphIO-2.5.3 → MorphIO-2.6.0}/binds/python/bind_immutable.cpp +0 -0
  37. {MorphIO-2.5.3 → MorphIO-2.6.0}/binds/python/bind_immutable.h +0 -0
  38. {MorphIO-2.5.3 → MorphIO-2.6.0}/binds/python/bind_misc.h +0 -0
  39. {MorphIO-2.5.3 → MorphIO-2.6.0}/binds/python/bind_mutable.cpp +0 -0
  40. {MorphIO-2.5.3 → MorphIO-2.6.0}/binds/python/bind_mutable.h +0 -0
  41. {MorphIO-2.5.3 → MorphIO-2.6.0}/binds/python/bind_vasculature.cpp +0 -0
  42. {MorphIO-2.5.3 → MorphIO-2.6.0}/binds/python/bind_vasculature.h +0 -0
  43. {MorphIO-2.5.3 → MorphIO-2.6.0}/binds/python/bindings_utils.cpp +0 -0
  44. {MorphIO-2.5.3 → MorphIO-2.6.0}/binds/python/bindings_utils.h +0 -0
  45. {MorphIO-2.5.3 → MorphIO-2.6.0}/binds/python/morphio.cpp +0 -0
  46. {MorphIO-2.5.3 → MorphIO-2.6.0}/ci/check_clang_format.sh +0 -0
  47. {MorphIO-2.5.3 → MorphIO-2.6.0}/ci/cpp_test.sh +0 -0
  48. {MorphIO-2.5.3 → MorphIO-2.6.0}/ci/python_test.sh +0 -0
  49. {MorphIO-2.5.3 → MorphIO-2.6.0}/doc/BBPLOGO350.jpg +0 -0
  50. {MorphIO-2.5.3 → MorphIO-2.6.0}/doc/specification.md +0 -0
  51. {MorphIO-2.5.3 → MorphIO-2.6.0}/doc/specification_neurolucida.md +0 -0
  52. {MorphIO-2.5.3 → MorphIO-2.6.0}/examples/getting_started.ipynb +0 -0
  53. {MorphIO-2.5.3 → MorphIO-2.6.0}/examples/getting_started_mutable.ipynb +0 -0
  54. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/endoplasmic_reticulum.h +0 -0
  55. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/errorMessages.h +0 -0
  56. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/exceptions.h +0 -0
  57. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/glial_cell.h +0 -0
  58. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/mito_section.h +0 -0
  59. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/mitochondria.h +0 -0
  60. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/morphology.h +0 -0
  61. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/mut/endoplasmic_reticulum.h +0 -0
  62. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/mut/glial_cell.h +0 -0
  63. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/mut/mito_section.h +0 -0
  64. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/mut/mitochondria.h +0 -0
  65. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/mut/modifiers.h +0 -0
  66. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/mut/morphology.h +0 -0
  67. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/mut/section.h +0 -0
  68. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/mut/soma.h +0 -0
  69. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/mut/writers.h +0 -0
  70. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/section.h +0 -0
  71. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/section_base.h +0 -0
  72. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/section_base.tpp +0 -0
  73. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/section_iterators.hpp +0 -0
  74. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/shared_utils.tpp +0 -0
  75. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/soma.h +0 -0
  76. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/tools.h +0 -0
  77. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/types.h +0 -0
  78. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/vasc/iterators.hpp +0 -0
  79. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/vasc/properties.h +0 -0
  80. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/vasc/section.h +0 -0
  81. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/vasc/vasculature.h +0 -0
  82. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/vector_types.h +0 -0
  83. {MorphIO-2.5.3 → MorphIO-2.6.0}/include/morphio/version.h +0 -0
  84. {MorphIO-2.5.3 → MorphIO-2.6.0}/morphio/__init__.py +0 -0
  85. {MorphIO-2.5.3 → MorphIO-2.6.0}/morphio/mut/__init__.py +0 -0
  86. {MorphIO-2.5.3 → MorphIO-2.6.0}/morphio/vasculature/__init__.py +0 -0
  87. {MorphIO-2.5.3 → MorphIO-2.6.0}/scripts/check-clang-format-all +0 -0
  88. {MorphIO-2.5.3 → MorphIO-2.6.0}/setup.cfg +0 -0
  89. {MorphIO-2.5.3 → MorphIO-2.6.0}/setup.py +0 -0
  90. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/CMakeLists.txt +0 -0
  91. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/endoplasmic_reticulum.cpp +0 -0
  92. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/errorMessages.cpp +0 -0
  93. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/glial_cell.cpp +0 -0
  94. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/mito_section.cpp +0 -0
  95. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/mitochondria.cpp +0 -0
  96. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/morphology.cpp +0 -0
  97. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/mut/endoplasmic_reticulum.cpp +0 -0
  98. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/mut/glial_cell.cpp +0 -0
  99. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/mut/mito_section.cpp +0 -0
  100. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/mut/mitochondria.cpp +0 -0
  101. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/mut/modifiers.cpp +0 -0
  102. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/mut/morphology.cpp +0 -0
  103. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/mut/section.cpp +0 -0
  104. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/mut/soma.cpp +0 -0
  105. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/mut/writers.cpp +0 -0
  106. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/properties.cpp +0 -0
  107. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/readers/lex.cpp +0 -0
  108. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/readers/morphologyASC.cpp +0 -0
  109. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/readers/morphologyASC.h +0 -0
  110. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/readers/morphologySWC.cpp +0 -0
  111. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/readers/morphologySWC.h +0 -0
  112. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/readers/utilsHDF5.h +0 -0
  113. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/readers/vasculatureHDF5.cpp +0 -0
  114. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/readers/vasculatureHDF5.h +0 -0
  115. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/section.cpp +0 -0
  116. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/soma.cpp +0 -0
  117. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/vasc/properties.cpp +0 -0
  118. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/vasc/section.cpp +0 -0
  119. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/vasc/vasculature.cpp +0 -0
  120. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/vector_utils.cpp +0 -0
  121. {MorphIO-2.5.3 → MorphIO-2.6.0}/src/version.cpp.in +0 -0
  122. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/CMakeLists.txt +0 -0
  123. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/__init__.py +0 -0
  124. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/contrib/catch.hpp +0 -0
  125. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/astrocyte.h5 +0 -0
  126. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/circle_contour.asc +0 -0
  127. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/complexe.swc +0 -0
  128. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/disconnected_neurite.swc +0 -0
  129. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/h5/merged.h5 +0 -0
  130. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/h5/v1/Neuron.h5 +0 -0
  131. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/h5/v1/endoplasmic-reticulum.h5 +0 -0
  132. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/h5/v1/mitochondria.h5 +0 -0
  133. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/h5/v1/monodim.h5 +0 -0
  134. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/h5/v1/simple-broken-section-type.h5 +0 -0
  135. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/h5/v1/simple-negative-section-type.h5 +0 -0
  136. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/h5/v1/simple.h5 +0 -0
  137. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/h5/v1/soma_no_neurites.h5 +0 -0
  138. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/h5/v1/two_child_unmerged.h5 +0 -0
  139. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/h5/v2/Neuron.h5 +0 -0
  140. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/h5/vasculature-broken-section-type.h5 +0 -0
  141. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/h5/vasculature1.h5 +0 -0
  142. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/h5/vasculature2.h5 +0 -0
  143. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/iterators.asc +0 -0
  144. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/mono-type.asc +0 -0
  145. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/multiple_point_section.asc +0 -0
  146. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/multiple_soma.swc +0 -0
  147. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/nested_single_children.asc +0 -0
  148. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/neurite_wrong_root_point.swc +0 -0
  149. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/nrn-order-already-sorted.h5 +0 -0
  150. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/nrn_ordering.swc +0 -0
  151. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/pia.asc +0 -0
  152. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/reversed_NRN_neurite_order.swc +0 -0
  153. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/sections-block.asc +0 -0
  154. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/simple-with-font.asc +0 -0
  155. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/simple-with-image-coord.asc +0 -0
  156. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/simple.asc +0 -0
  157. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/simple.swc +0 -0
  158. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/simple2.asc +0 -0
  159. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/soma_cylinders.swc +0 -0
  160. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/soma_multiple_frustums.swc +0 -0
  161. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/soma_single_frustum.swc +0 -0
  162. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/soma_three_points_cylinder.swc +0 -0
  163. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/spine.asc +0 -0
  164. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/data/three_point_soma.swc +0 -0
  165. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/main.cpp +0 -0
  166. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/test_0_API.py +0 -0
  167. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/test_10_vasculature.py +0 -0
  168. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/test_1_swc.py +0 -0
  169. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/test_2_neurolucida.py +0 -0
  170. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/test_4_immut.py +0 -0
  171. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/test_5_mut.py +0 -0
  172. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/test_6_writers.py +0 -0
  173. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/test_7_modifiers.py +0 -0
  174. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/test_8_all_morphologies.py +0 -0
  175. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/test_9_surfaces.py +0 -0
  176. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/test_morphology.cpp +0 -0
  177. {MorphIO-2.5.3 → MorphIO-2.6.0}/tests/utils.py +0 -0
@@ -12,7 +12,7 @@ env:
12
12
  # Only build on Python 3.x
13
13
  CIBW_BUILD: 'cp3?-*'
14
14
  CIBW_SKIP: 'cp35-* cp39-* *-manylinux_i686'
15
- CIBW_BEFORE_TEST: pip install nose mock h5py numpy
15
+ CIBW_BEFORE_TEST: pip install -r {project}/tests/requirement_tests.txt
16
16
  CIBW_TEST_COMMAND: nosetests -s -v -P {project}/tests
17
17
 
18
18
  jobs:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: MorphIO
3
- Version: 2.5.3
3
+ Version: 2.6.0
4
4
  Summary: A neuron morphology IO library
5
5
  Home-page: https://github.com/BlueBrain/MorphIO/
6
6
  Author: Blue Brain Project, EPFL
@@ -601,11 +601,11 @@ Description: # MorphIO [![Build Status](https://travis-ci.com/BlueBrain/MorphIO.
601
601
 
602
602
  # H5v2
603
603
 
604
- Starting at version 2.5.2, the file format `h5v2` is no longer supported.
605
- If you have morphologies in this format, you can convert them with:
604
+ Starting at version 2.6.0, the file format `h5v2` is no longer supported.
605
+ If you have morphologies in this format, you can convert them to h5v1 with:
606
606
 
607
607
  ```bash
608
- pip install morphio==2.5.1 morph-tool==2.3.0
608
+ pip install "morphio<2.6" "morph-tool==2.3.0"
609
609
  ```
610
610
 
611
611
  and then:
@@ -171,5 +171,4 @@ tests/data/h5/v1/simple-negative-section-type.h5
171
171
  tests/data/h5/v1/simple.h5
172
172
  tests/data/h5/v1/soma_no_neurites.h5
173
173
  tests/data/h5/v1/two_child_unmerged.h5
174
- tests/data/h5/v2/Neuron.h5
175
- tests/data/h5/v2/no-metadata.h5
174
+ tests/data/h5/v2/Neuron.h5
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: MorphIO
3
- Version: 2.5.3
3
+ Version: 2.6.0
4
4
  Summary: A neuron morphology IO library
5
5
  Home-page: https://github.com/BlueBrain/MorphIO/
6
6
  Author: Blue Brain Project, EPFL
@@ -601,11 +601,11 @@ Description: # MorphIO [![Build Status](https://travis-ci.com/BlueBrain/MorphIO.
601
601
 
602
602
  # H5v2
603
603
 
604
- Starting at version 2.5.2, the file format `h5v2` is no longer supported.
605
- If you have morphologies in this format, you can convert them with:
604
+ Starting at version 2.6.0, the file format `h5v2` is no longer supported.
605
+ If you have morphologies in this format, you can convert them to h5v1 with:
606
606
 
607
607
  ```bash
608
- pip install morphio==2.5.1 morph-tool==2.3.0
608
+ pip install "morphio<2.6" "morph-tool==2.3.0"
609
609
  ```
610
610
 
611
611
  and then:
@@ -594,11 +594,11 @@ See https://github.com/BlueBrain/MorphIO/blob/master/doc/specification.md
594
594
 
595
595
  # H5v2
596
596
 
597
- Starting at version 2.5.2, the file format `h5v2` is no longer supported.
598
- If you have morphologies in this format, you can convert them with:
597
+ Starting at version 2.6.0, the file format `h5v2` is no longer supported.
598
+ If you have morphologies in this format, you can convert them to h5v1 with:
599
599
 
600
600
  ```bash
601
- pip install morphio==2.5.1 morph-tool==2.3.0
601
+ pip install "morphio<2.6" "morph-tool==2.3.0"
602
602
  ```
603
603
 
604
604
  and then:
@@ -87,6 +87,8 @@ void bind_misc(py::module& m) {
87
87
  morphio::enums::MorphologyVersion::MORPHOLOGY_VERSION_H5_2)
88
88
  .value("MORPHOLOGY_VERSION_H5_1_1",
89
89
  morphio::enums::MorphologyVersion::MORPHOLOGY_VERSION_H5_1_1)
90
+ .value("MORPHOLOGY_VERSION_H5_1_2",
91
+ morphio::enums::MorphologyVersion::MORPHOLOGY_VERSION_H5_1_2)
90
92
  .value("MORPHOLOGY_VERSION_SWC_1",
91
93
  morphio::enums::MorphologyVersion::MORPHOLOGY_VERSION_SWC_1)
92
94
  .value("MORPHOLOGY_VERSION_UNDEFINED",
@@ -42,6 +42,7 @@ enum MorphologyVersion {
42
42
  MORPHOLOGY_VERSION_H5_1_1 = 3,
43
43
  MORPHOLOGY_VERSION_ASC_1 = 4,
44
44
  MORPHOLOGY_VERSION_SWC_1 = 101,
45
+ MORPHOLOGY_VERSION_H5_1_2 = 5,
45
46
  MORPHOLOGY_VERSION_UNDEFINED
46
47
  };
47
48
  std::ostream& operator<<(std::ostream& os, MorphologyVersion v);
@@ -151,9 +151,11 @@ struct Marker {
151
151
  };
152
152
 
153
153
  struct CellLevel {
154
+ CellLevel()
155
+ : _version(MORPHOLOGY_VERSION_UNDEFINED) {}
156
+ MorphologyVersion _version;
154
157
  morphio::CellFamily _cellFamily;
155
158
  SomaType _somaType;
156
- MorphologyVersion _version;
157
159
  std::vector<Annotation> _annotations;
158
160
  std::vector<Marker> _markers;
159
161
 
@@ -11,6 +11,8 @@ std::ostream& operator<<(std::ostream& os, const MorphologyVersion v) {
11
11
  return os << "h5v1";
12
12
  case MORPHOLOGY_VERSION_H5_1_1:
13
13
  return os << "h5v1.1";
14
+ case MORPHOLOGY_VERSION_H5_1_2:
15
+ return os << "h5v1.2";
14
16
  case MORPHOLOGY_VERSION_H5_2:
15
17
  return os << "h5v2";
16
18
  case MORPHOLOGY_VERSION_SWC_1:
@@ -25,13 +25,14 @@
25
25
  #include <highfive/H5Utility.hpp> // HighFive::SilenceHDF5
26
26
 
27
27
  namespace {
28
- // v1 & v2
29
28
  const std::string _d_points("points");
30
29
  constexpr size_t _pointColumns = 4;
31
30
 
32
31
  // v1
33
32
  const std::string _d_structure("structure");
34
33
  const size_t _structureV1Columns = 3;
34
+ const std::string _a_version("version");
35
+
35
36
 
36
37
  // v1.1
37
38
  const std::string _g_metadata("metadata");
@@ -45,16 +46,7 @@ const std::string _d_section_index("section_index");
45
46
  const std::string _d_volume("volume");
46
47
  const std::string _d_surface_area("surface_area");
47
48
  const std::string _d_filament_count("filament_count");
48
-
49
- // v1.1 & v2
50
- const std::string _a_version("version");
51
-
52
- // v2
53
- const std::string _g_structure("structure");
54
- constexpr size_t _structureV2Columns = 2;
55
49
  const std::string _g_root("neuron1");
56
- const std::string _d_type("sectiontype");
57
- const std::string _a_apical("apical");
58
50
  } // namespace
59
51
 
60
52
  namespace morphio {
@@ -77,10 +69,7 @@ Property::Properties load(const HighFive::Group& group) {
77
69
  }
78
70
 
79
71
  Property::Properties MorphologyHDF5::load() {
80
- _stage = "repaired";
81
-
82
- _checkVersion(_uri);
83
- _selectRepairStage();
72
+ _readMetadata(_uri);
84
73
  int firstSectionOffset = _readSections();
85
74
  _readPoints(firstSectionOffset);
86
75
  _readPerimeters(firstSectionOffset);
@@ -94,37 +83,6 @@ MorphologyHDF5::MorphologyHDF5(const HighFive::Group& group)
94
83
  : _group(group)
95
84
  , _uri("HDF5 Group") {}
96
85
 
97
- void MorphologyHDF5::_checkVersion(const std::string& source) {
98
- if (_readV11Metadata())
99
- return;
100
-
101
- if (_readV2Metadata())
102
- return;
103
-
104
- try {
105
- _resolveV1();
106
- _properties._cellLevel._version = MORPHOLOGY_VERSION_H5_1;
107
- return;
108
- } catch (...) {
109
- throw morphio::RawDataError("Unknown morphology format in " + source);
110
- }
111
- }
112
-
113
- void MorphologyHDF5::_selectRepairStage() {
114
- if (_properties.version() != MORPHOLOGY_VERSION_H5_2)
115
- return;
116
-
117
- for (const auto& stage : {"repaired", "unraveled", "raw"}) {
118
- try {
119
- HighFive::SilenceHDF5 silence;
120
- _group.getDataSet("/" + _g_root + "/" + stage + "/" + _d_points);
121
- _stage = stage;
122
- return;
123
- } catch (const HighFive::DataSetException&) {
124
- }
125
- }
126
- _stage = "repaired";
127
- }
128
86
 
129
87
  void MorphologyHDF5::_resolveV1() {
130
88
  HighFive::SilenceHDF5 silence;
@@ -140,9 +98,17 @@ void MorphologyHDF5::_resolveV1() {
140
98
  _sections.reset(new HighFive::DataSet(_group.getDataSet(_d_structure)));
141
99
  }
142
100
 
143
- bool MorphologyHDF5::_readV11Metadata() {
144
- uint32_t family;
145
-
101
+ /* Heuristic to determine the version
102
+ - Look for the version field (which exists only for h5v1.1 and h5v1.2)
103
+ - Try to resolve the h5v1 point dataset, if it works and no version field was previously found
104
+ then it must be h5v1.0
105
+ Returns in case of successful resolution
106
+ - If the resolution fails, tries to find the h5v2 version field (which is located elsewhere)
107
+ throw a custom message if h5v2 is detected
108
+ - in any other case, throws a generic message
109
+ */
110
+ void MorphologyHDF5::_readMetadata(const std::string& source) {
111
+ // h5v1.1 and h5v2 attempt
146
112
  try {
147
113
  HighFive::SilenceHDF5 silence;
148
114
  const auto metadata = _group.getGroup(_g_metadata);
@@ -150,48 +116,58 @@ bool MorphologyHDF5::_readV11Metadata() {
150
116
 
151
117
  uint32_t version[2];
152
118
  attr.read(version);
153
- if (version[0] != 1 || version[1] != 1)
154
- return false;
155
-
156
- const auto familyAttr = metadata.getAttribute(_a_family);
157
- familyAttr.read(family);
158
- } catch (const HighFive::GroupException&) {
159
- return false;
160
- } catch (const HighFive::Exception& e) {
161
- // All other exceptions are not expected because if the metadata
162
- // group exits it must contain at least the version, and for
163
- // version 1.1 it must contain the family.
164
- throw morphio::RawDataError("Error reading morphology " + _uri + " metadata." + e.what());
119
+ if (version[0] == 1 && (version[1] == 1 || version[1] == 2)) {
120
+ uint32_t family;
121
+ const auto familyAttr = metadata.getAttribute(_a_family);
122
+ familyAttr.read(family);
123
+ if (version[1] == 1)
124
+ _properties._cellLevel._version = MORPHOLOGY_VERSION_H5_1_1;
125
+ else
126
+ _properties._cellLevel._version = MORPHOLOGY_VERSION_H5_1_2;
127
+ _properties._cellLevel._cellFamily = static_cast<CellFamily>(family);
128
+ } else {
129
+ throw morphio::RawDataError(
130
+ "Error in " + source + "\nUnsupported h5 version: " + std::to_string(version[0]) +
131
+ "." + std::to_string(version[1]) +
132
+ "See "
133
+ "https://bbpteam.epfl.ch/documentation/projects/Morphology%20Documentation/latest/"
134
+ "index.html for the list of supported versions.");
135
+ }
136
+ } catch (const HighFive::Exception&) {
165
137
  }
166
138
 
167
- _properties._cellLevel._version = MORPHOLOGY_VERSION_H5_1_1;
168
- _properties._cellLevel._cellFamily = static_cast<CellFamily>(family);
169
- _resolveV1();
170
- return true;
171
- }
172
-
173
- bool MorphologyHDF5::_readV2Metadata() {
174
139
  try {
175
- HighFive::SilenceHDF5 silence;
176
- const auto root = _group.getGroup(_g_root);
177
- const auto attr = root.getAttribute(_a_version);
178
- attr.read(_properties._cellLevel._version);
179
- if (_properties.version() == MORPHOLOGY_VERSION_H5_2) {
140
+ _resolveV1();
141
+
142
+ // The fact that the resolution passes and _version is not set yet tells us it is h5v1.0
143
+ if (_properties._cellLevel._version == MORPHOLOGY_VERSION_UNDEFINED) {
144
+ _properties._cellLevel._version = MORPHOLOGY_VERSION_H5_1;
145
+ // Version 1.0 only support NEURON has a CellFamily.
146
+ // Other CellFamily have been added in version 1.1:
147
+ // https://bbpteam.epfl.ch/documentation/projects/Morphology%20Documentation/latest/h5v1.html
180
148
  _properties._cellLevel._cellFamily = CellFamily::NEURON;
181
- return true;
182
149
  }
150
+ return;
183
151
  } catch (const HighFive::Exception&) {
184
152
  }
185
153
 
186
- try {
187
- HighFive::SilenceHDF5 silence;
188
- _group.getGroup(_g_root);
189
- _properties._cellLevel._version = MORPHOLOGY_VERSION_H5_2;
190
- _properties._cellLevel._cellFamily = CellFamily::NEURON;
191
- return true;
192
- } catch (const HighFive::Exception&) {
193
- return false;
154
+
155
+ // h5v2 attempt
156
+ {
157
+ uint32_t potential_h5v2_version;
158
+ try {
159
+ _group.getGroup(_g_root).getAttribute(_a_version).read(potential_h5v2_version);
160
+ } catch (const HighFive::Exception&) {
161
+ }
162
+
163
+ // More informative throw for h5v2 format
164
+ if (potential_h5v2_version == 2)
165
+ throw morphio::RawDataError(
166
+ "Error in " + source +
167
+ "\nh5v2 is no longer supported, see: https://github.com/BlueBrain/MorphIO#H5v2");
194
168
  }
169
+
170
+ throw morphio::RawDataError("Error reading morphology " + _uri + " metadata.");
195
171
  }
196
172
 
197
173
  HighFive::DataSet MorphologyHDF5::_getStructureDataSet(size_t nSections) {
@@ -204,14 +180,10 @@ HighFive::DataSet MorphologyHDF5::_getStructureDataSet(size_t nSections) {
204
180
  }
205
181
 
206
182
 
207
- /**
208
- Returns true if the neuron has neurites (for MORPHOLOGY_VERSION_H5_2)
209
- **/
210
- static inline bool v2HasNeurites(int firstSectionOffset) {
183
+ static inline bool HasNeurites(int firstSectionOffset) {
211
184
  return (firstSectionOffset > -1);
212
185
  }
213
186
 
214
-
215
187
  void MorphologyHDF5::_readPoints(int firstSectionOffset) {
216
188
  auto& points = _properties.get<Property::Point>();
217
189
  auto& diameters = _properties.get<Property::Diameter>();
@@ -248,42 +220,14 @@ void MorphologyHDF5::_readPoints(int firstSectionOffset) {
248
220
  }
249
221
  };
250
222
 
251
- if (_properties.version() == MORPHOLOGY_VERSION_H5_2) {
252
- auto dataset = [this]() {
253
- std::string path = "/" + _g_root + "/" + _stage + "/" + _d_points;
254
- try {
255
- return _group.getDataSet(path);
256
- } catch (HighFive::DataSetException&) {
257
- throw(MorphioError("Could not open " + path + " dataset " + " repair stage " +
258
- _stage));
259
- }
260
- }();
261
-
262
- const auto dims = dataset.getSpace().getDimensions();
263
- if (dims.size() != 2 || dims[1] != _pointColumns) {
264
- throw(MorphioError("'Error reading morphologies: " + _uri +
265
- " bad number of dimensions in 'points' dataspace"));
266
- }
267
- std::vector<std::array<morphio::floatType, _pointColumns>> vec(dims[0]);
268
- if (vec.size() > 0) {
269
- dataset.read(vec.front().data());
270
- }
271
- loadPoints(vec, v2HasNeurites(firstSectionOffset));
272
- } else {
273
- std::vector<std::array<morphio::floatType, _pointColumns>> vec(_pointsDims[0]);
274
- if (vec.size() > 0) {
275
- _points->read(vec.front().data());
276
- }
277
- loadPoints(vec, std::size_t(firstSectionOffset) < _pointsDims[0]);
223
+ std::vector<std::array<morphio::floatType, _pointColumns>> vec(_pointsDims[0]);
224
+ if (vec.size() > 0) {
225
+ _points->read(vec.front().data());
278
226
  }
227
+ loadPoints(vec, std::size_t(firstSectionOffset) < _pointsDims[0]);
279
228
  }
280
229
 
281
- inline int MorphologyHDF5::_readSections() {
282
- return (_properties.version() == MORPHOLOGY_VERSION_H5_2) ? _readV2Sections()
283
- : _readV1Sections();
284
- }
285
-
286
- int MorphologyHDF5::_readV1Sections() {
230
+ int MorphologyHDF5::_readSections() {
287
231
  auto& sections = _properties.get<Property::Section>();
288
232
  auto& types = _properties.get<Property::SectionType>();
289
233
 
@@ -329,80 +273,8 @@ int MorphologyHDF5::_readV1Sections() {
329
273
  return firstSectionOffset;
330
274
  }
331
275
 
332
- int MorphologyHDF5::_readV2Sections() {
333
- auto& sections = _properties.get<Property::Section>();
334
- auto& types = _properties.get<Property::SectionType>();
335
-
336
- // fixes BBPSDK-295 by restoring old BBPSDK 0.13 implementation
337
- HighFive::SilenceHDF5 silence;
338
- auto dataset = [this]() {
339
- std::string path = "/" + _g_root + "/" + _g_structure + "/" + _stage;
340
- try {
341
- return _group.getDataSet(path);
342
- } catch (HighFive::DataSetException&) {
343
- if (_stage == "unraveled") {
344
- std::string raw_path = "/" + _g_root + "/" + _g_structure + "/raw";
345
- try {
346
- return _group.getDataSet(raw_path);
347
- } catch (HighFive::DataSetException&) {
348
- throw(MorphioError("Could not find unraveled structure neither at " + path +
349
- " or " + raw_path + " for dataset for morphology '" + _uri +
350
- "' repair stage " + _stage));
351
- }
352
- } else {
353
- throw(MorphioError("Could not open " + path + " dataset for morphology '" + _uri +
354
- "' repair stage " + _stage));
355
- }
356
- }
357
- }();
358
-
359
- auto dataset_types = [this]() {
360
- std::string path = "/" + _g_root + "/" + _g_structure + "/" + _d_type;
361
- try {
362
- return _group.getDataSet(path);
363
- } catch (HighFive::DataSetException&) {
364
- throw(MorphioError("Could not open " + path + " dataset for morphology: " + _uri));
365
- }
366
- }();
367
-
368
- _sections.reset(new HighFive::DataSet(dataset));
369
-
370
- const auto dims = dataset.getSpace().getDimensions();
371
-
372
- if (dims.size() != 2 || dims[1] != _structureV2Columns) {
373
- throw(MorphioError("Error reading morphologies " + _uri +
374
- " bad number of dimensions in 'structure' dataspace"));
375
- }
376
-
377
- std::vector<std::array<int, _structureV2Columns>> vec(dims[0]);
378
- if (vec.size() > 0) {
379
- dataset.read(vec.front().data());
380
- }
381
- dataset_types.read(types);
382
-
383
- int firstSectionOffset = vec[1][0];
384
- sections.reserve(sections.size() + vec.size() - 1);
385
-
386
- // The first contains soma related value so it is skipped
387
- for (size_t i = 1; i < vec.size(); ++i) {
388
- const auto& p = vec[i];
389
- const int& type = types[i]; // Explicit int for Clang (<0 comparison)
390
-
391
- if (type > SECTION_CUSTOM_START || type < 0) {
392
- throw morphio::RawDataError(
393
- _err.ERROR_UNSUPPORTED_SECTION_TYPE(0, static_cast<SectionType>(type)));
394
- }
395
-
396
- sections.emplace_back(Property::Section::Type{p[0] - firstSectionOffset, p[1] - 1});
397
- }
398
-
399
- types.erase(types.begin()); // remove soma type
400
-
401
- return firstSectionOffset;
402
- }
403
-
404
276
  void MorphologyHDF5::_readPerimeters(int firstSectionOffset) {
405
- if (_properties.version() != MORPHOLOGY_VERSION_H5_1_1 || !v2HasNeurites(firstSectionOffset))
277
+ if (_properties.version() != MORPHOLOGY_VERSION_H5_1_1 || !HasNeurites(firstSectionOffset))
406
278
  return;
407
279
 
408
280
  try {
@@ -25,15 +25,11 @@ class MorphologyHDF5
25
25
 
26
26
  private:
27
27
  void _checkVersion(const std::string& source);
28
- void _selectRepairStage();
29
28
  void _resolveV1();
30
- bool _readV11Metadata();
31
- bool _readV2Metadata();
29
+ void _readMetadata(const std::string& source);
32
30
  HighFive::DataSet _getStructureDataSet(size_t nSections);
33
31
  void _readPoints(int);
34
32
  int _readSections();
35
- int _readV1Sections();
36
- int _readV2Sections();
37
33
  void _readPerimeters(int);
38
34
  void _readMitochondria();
39
35
  void _readEndoplasmicReticulum();
@@ -52,7 +48,6 @@ class MorphologyHDF5
52
48
 
53
49
  std::unique_ptr<HighFive::DataSet> _sections;
54
50
 
55
- std::string _stage;
56
51
  Property::Properties _properties;
57
52
  ErrorMessages _err;
58
53
  std::string _uri;
@@ -2,3 +2,4 @@ h5py>=2.9.0
2
2
  mock>=2.0.0
3
3
  nose>=1.3.7
4
4
  numpy>=1.14.2
5
+ requests>=2.25.1
@@ -2,12 +2,13 @@ import os
2
2
  from itertools import chain, repeat
3
3
  from pathlib import Path
4
4
 
5
+ import requests
5
6
  from morphio import (CellFamily, Morphology, MorphologyVersion, RawDataError, SectionType,
6
7
  ostream_redirect)
7
- from nose.tools import assert_equal, assert_raises
8
+ from nose.tools import assert_equal, assert_raises, ok_
8
9
  from numpy.testing import assert_array_equal
9
10
 
10
- from .utils import captured_output
11
+ from .utils import assert_substring, captured_output
11
12
 
12
13
  _path = Path(os.path.dirname(os.path.abspath(__file__)), "data")
13
14
  H5_PATH = Path(_path, 'h5')
@@ -20,6 +21,7 @@ def test_v1():
20
21
  assert_equal(len(n.root_sections), 2)
21
22
  assert_equal(n.root_sections[0].type, 3)
22
23
  assert_equal(n.root_sections[1].type, 2)
24
+ assert_equal(n.version, MorphologyVersion.MORPHOLOGY_VERSION_H5_1_1)
23
25
 
24
26
  n = Morphology(H5V1_PATH / 'Neuron.h5')
25
27
  assert_equal(n.version, MorphologyVersion.MORPHOLOGY_VERSION_H5_1)
@@ -56,23 +58,15 @@ def test_wrong_section_type():
56
58
  assert_equal(str(cm.exception).strip(), 'Unsupported section type: -2')
57
59
 
58
60
  def test_v2():
59
- n = Morphology(H5V2_PATH / 'Neuron.h5')
60
- assert_equal(n.version, MorphologyVersion.MORPHOLOGY_VERSION_H5_2)
61
-
62
-
63
- # This is a bug in the Neuron.h5 file
64
- # First neurite should not have a type: soma
65
- assert_equal(n.root_sections[0].type, 1)
66
- assert_equal(n.root_sections[1].type, 4)
67
- assert_equal(len(list(n.iter())), 85)
68
- assert_equal(len(n.points), 926)
69
- assert_equal(len(n.sections), 85)
70
- assert_equal(n.cell_family, CellFamily.NEURON)
71
-
72
- def test_v2_without_cellfamily_info():
73
- '''This H5v2 cell has no metadata but we check that the correct CellFamily type is set'''
74
- n = Morphology(H5V2_PATH / 'no-metadata.h5')
75
- assert_equal(n.cell_family, CellFamily.NEURON)
61
+ with assert_raises(RawDataError) as cm:
62
+ Morphology(H5V2_PATH / 'Neuron.h5')
63
+ assert_substring('h5v2 is no longer supported, see: https://github.com/BlueBrain/MorphIO#H5v2',
64
+ str(cm.exception))
65
+
66
+ request = requests.get('https://github.com/BlueBrain/MorphIO#H5v2')
67
+ assert_equal(request.status_code, 200,
68
+ 'The exception message points to a dead link')
69
+
76
70
 
77
71
  def test_soma_no_neurite():
78
72
  n = Morphology(H5V1_PATH / 'soma_no_neurites.h5')
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes