diff --git a/src/io/hdf5/HDF5RecordingData.cpp b/src/io/hdf5/HDF5RecordingData.cpp index eabb92cb..76ec23f1 100644 --- a/src/io/hdf5/HDF5RecordingData.cpp +++ b/src/io/hdf5/HDF5RecordingData.cpp @@ -19,20 +19,19 @@ HDF5RecordingData::HDF5RecordingData(std::unique_ptr data) DataSpace dSpace = data->getSpace(); DSetCreatPropList prop = data->getCreatePlist(); - int nDimensions = dSpace.getSimpleExtentNdims(); - std::vector dims(nDimensions), chunk(nDimensions); + this->nDimensions = static_cast(dSpace.getSimpleExtentNdims()); + std::vector dims(this->nDimensions), chunk(this->nDimensions); - nDimensions = dSpace.getSimpleExtentDims( - dims.data()); // TODO -redefine here or use original? - prop.getChunk(static_cast(nDimensions), chunk.data()); + this->nDimensions = + static_cast(dSpace.getSimpleExtentDims(dims.data())); + prop.getChunk(static_cast(this->nDimensions), chunk.data()); - this->size = std::vector(nDimensions); - for (int i = 0; i < nDimensions; ++i) { - this->size[i] = dims[i]; + this->size = std::vector(this->nDimensions); + for (SizeType i = 0; i < this->nDimensions; ++i) { + this->size[i] = static_cast(dims[i]); } - this->nDimensions = nDimensions; this->position = std::vector( - nDimensions, 0); // Initialize position with 0 for each dimension + this->nDimensions, 0); // Initialize position with 0 for each dimension m_dataset = std::make_unique(*data); } @@ -58,7 +57,7 @@ Status HDF5RecordingData::writeDataBlock( // Ensure that we have enough space to accommodate new data std::vector dSetDims(nDimensions), offset(nDimensions); - for (int i = 0; i < nDimensions; ++i) { + for (SizeType i = 0; i < nDimensions; ++i) { offset[i] = static_cast(positionOffset[i]); if (dataShape[i] + offset[i] > size[i]) // TODO - do I need offset here @@ -73,14 +72,14 @@ Status HDF5RecordingData::writeDataBlock( // Set size to new size based on updated dimensionality DataSpace fSpace = m_dataset->getSpace(); fSpace.getSimpleExtentDims(dSetDims.data()); - for (int i = 0; i < nDimensions; ++i) { + for (SizeType i = 0; i < nDimensions; ++i) { size[i] = dSetDims[i]; } // Create memory space with the shape of the data // DataSpace mSpace(dimension, dSetDim.data()); std::vector dataDims(nDimensions); - for (int i = 0; i < nDimensions; ++i) { + for (SizeType i = 0; i < nDimensions; ++i) { if (dataShape[i] == 0) { dataDims[i] = 1; } else { @@ -97,7 +96,7 @@ Status HDF5RecordingData::writeDataBlock( m_dataset->write(data, nativeType, mSpace, fSpace); // Update position for simple extension - for (int i = 0; i < dataShape.size(); ++i) { + for (SizeType i = 0; i < dataShape.size(); ++i) { position[i] += dataShape[i]; } } catch (DataSetIException error) { diff --git a/src/nwb/file/ElectrodeTable.cpp b/src/nwb/file/ElectrodeTable.cpp index 890b2b28..cc44a8f1 100644 --- a/src/nwb/file/ElectrodeTable.cpp +++ b/src/nwb/file/ElectrodeTable.cpp @@ -26,8 +26,8 @@ ElectrodeTable::ElectrodeTable(std::shared_ptr io) ElectrodeTable::ElectrodeTable(const std::string& path, std::shared_ptr io) : DynamicTable( - electrodeTablePath, // use the electrodeTablePath - io) // TODO May need to initialize the colNames in DynamicTable + electrodeTablePath, // use the electrodeTablePath + io) // TODO May need to initialize the colNames in DynamicTable , m_electrodeDataset(std::make_unique( AQNWB::mergePaths(electrodeTablePath, "id"), io)) , m_groupNamesDataset(std::make_unique( @@ -69,20 +69,12 @@ void ElectrodeTable::initialize(const std::string& description) void ElectrodeTable::addElectrodes(std::vector channelsInput) { // create datasets -<<<<<<< HEAD - for (const auto& ch : channels) { + for (const auto& ch : channelsInput) { m_groupReferences.push_back( AQNWB::mergePaths(m_groupPathBase, ch.getGroupName())); m_groupNames.push_back(ch.getGroupName()); - m_electrodeNumbers.push_back(ch.getGlobalIndex()); + m_electrodeNumbers.push_back(static_cast(ch.getGlobalIndex())); m_locationNames.push_back("unknown"); -======= - for (const auto& ch : channelsInput) { - groupReferences.push_back(groupPathBase + ch.getGroupName()); - groupNames.push_back(ch.getGroupName()); - electrodeNumbers.push_back(static_cast(ch.getGlobalIndex())); - locationNames.push_back("unknown"); ->>>>>>> main } } diff --git a/tests/testHDF5IO.cpp b/tests/testHDF5IO.cpp index b556cf28..6d025377 100644 --- a/tests/testHDF5IO.cpp +++ b/tests/testHDF5IO.cpp @@ -318,14 +318,9 @@ TEST_CASE("SWMRmode", "[hdf5io]") SECTION("useSWMRMODE") { // create and open file -<<<<<<< HEAD - std::string path = getTestFilePath("testSWMRmode.h5"); + std::string path = getTestFilePath("testSWMRmodeEnable.h5"); std::unique_ptr hdf5io = std::make_unique(path); -======= - std::string path = getTestFilePath("testSWMRmodeEnable.h5"); - std::unique_ptr hdf5io = std::make_unique(path); ->>>>>>> main hdf5io->open(); // add a dataset @@ -403,15 +398,9 @@ TEST_CASE("SWMRmode", "[hdf5io]") SECTION("disableSWMRMode") { // create and open file with SWMR mode disabled -<<<<<<< HEAD - std::string path = getTestFilePath("testSWMRmode.h5"); + std::string path = getTestFilePath("testSWMRmodeDisable.h5"); std::unique_ptr hdf5io = std::make_unique(path, true); -======= - std::string path = getTestFilePath("testSWMRmodeDisable.h5"); - std::unique_ptr hdf5io = - std::make_unique(path, true); ->>>>>>> main hdf5io->open(); // add a dataset