Skip to content

Commit

Permalink
Updated DynamicTable to use mergePaths method
Browse files Browse the repository at this point in the history
  • Loading branch information
oruebel committed Sep 21, 2024
1 parent af28b29 commit c222955
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/nwb/hdmf/table/DynamicTable.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "nwb/hdmf/table/DynamicTable.hpp"

#include "Utils.hpp"

using namespace AQNWB::NWB;

// DynamicTable
Expand Down Expand Up @@ -42,7 +44,7 @@ void DynamicTable::addColumn(const std::string& name,
std::vector<SizeType>(1, 1),
IO::BaseDataType::STR(values[i].size() + 1),
values[i].c_str()); // TODO - add tests for this
m_io->createCommonNWBAttributes(m_path + name,
m_io->createCommonNWBAttributes(AQNWB::mergePaths(m_path, name),
vectorData->getNamespace(),
vectorData->getTypeName(),
colDescription);
Expand All @@ -60,7 +62,9 @@ void DynamicTable::setRowIDs(std::unique_ptr<ElementIdentifiers>& elementIDs,
IO::BaseDataType::I32,
&values[0]);
m_io->createCommonNWBAttributes(
m_path + "id", elementIDs->getNamespace(), elementIDs->getTypeName());
AQNWB::mergePaths(m_path, "id"),
elementIDs->getNamespace(),
elementIDs->getTypeName());
}
}

Expand All @@ -71,8 +75,14 @@ void DynamicTable::addColumn(const std::string& name,
if (values.empty()) {
std::cerr << "Data to add to column is empty" << std::endl;
} else {
m_io->createReferenceDataSet(m_path + name, values);
std::string columnPath = AQNWB::mergePaths(m_path, name);
m_io->createReferenceDataSet(
columnPath,
values);
m_io->createCommonNWBAttributes(
m_path + name, "hdmf-common", "VectorData", colDescription);
columnPath,
"hdmf-common",
"VectorData",
colDescription);
}
}

0 comments on commit c222955

Please sign in to comment.