Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Prepare for HighFive v3. #513

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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 3rdparty/HighFive
Submodule HighFive updated 126 files
12 changes: 2 additions & 10 deletions src/readers/morphologyHDF5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,7 @@ void MorphologyHDF5::_readPoints(int firstSectionOffset) {
"': incorrect number of columns for points");
}

std::vector<std::array<floatType, pointColumns>> hdf5Data(numberPoints);

if (!hdf5Data.empty()) {
pointsDataSet.read(hdf5Data.front().data());
}
auto hdf5Data = pointsDataSet.read<std::vector<std::array<floatType, pointColumns>>>();

const bool hasSoma = firstSectionOffset != 0;
const bool hasNeurites = static_cast<size_t>(firstSectionOffset) < numberPoints;
Expand Down Expand Up @@ -252,11 +248,7 @@ int MorphologyHDF5::_readSections() {
" bad number of dimensions in 'structure' dataspace"));
}

std::vector<std::array<int, structureV1Columns>> vec(dims[0]);
if (dims[0] > 0) {
structure.read(vec.front().data());
}

auto vec = structure.read<std::vector<std::array<int, structureV1Columns>>>();
assert(!vec.empty());

bool hasSoma = true;
Expand Down
7 changes: 2 additions & 5 deletions src/readers/vasculatureHDF5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ void VasculatureHDF5::_readSections() {
auto& sections = _properties.get_mut<vasculature::property::VascSection>();
auto selection = _sections->select({0, 0}, {_sectionsDims[0], 1});

std::vector<unsigned int> vec;
vec.resize(_sectionsDims[0]);
selection.read(vec);
auto vec = selection.squeezeMemSpace({1}).read<std::vector<unsigned int>>();

for (auto p : vec) {
sections.push_back(p);
Expand All @@ -94,8 +92,7 @@ void VasculatureHDF5::_readSectionTypes() {
auto& types = _properties.get_mut<vasculature::property::SectionType>();

auto selection = _sections->select({0, 1}, {_sectionsDims[0], 1});
types.resize(_sectionsDims[0]);
selection.read(types);
selection.squeezeMemSpace({1}).read(types);
for (int type : types) {
if (type > SECTION_CUSTOM || type < 0) {
const auto err = details::ErrorMessages(_uri);
Expand Down
4 changes: 1 addition & 3 deletions tests/test_vasculature_morphology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ TEST_CASE("vasculature_section_connectivity", "[vasculature]") {

REQUIRE(section_connectivity.size() == n_connections);

std::vector<std::array<unsigned int, 2>> expected_connectivity(n_connections);

dset.read(expected_connectivity.front().data());
auto expected_connectivity = dset.read<std::vector<std::array<unsigned int, 2>>>();

REQUIRE(section_connectivity == expected_connectivity);
}
Loading