Skip to content

Commit

Permalink
Merge branch 'add_read' into add_container_read
Browse files Browse the repository at this point in the history
  • Loading branch information
oruebel authored Oct 22, 2024
2 parents 423f3d7 + 69df3e0 commit 415926c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 22 deletions.
16 changes: 7 additions & 9 deletions src/io/ReadIO.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,21 @@ class DataBlock
/// Helper struct to check if a StorageObjectType is allowed. Used in static
/// assert.
template<StorageObjectType T>
struct is_allowed_storage_object_type : std::false_type
struct isAllowedStorageObjectType : std::false_type
{
};

/// Helper struct to check if a StorageObjectType is allowed. Used in static
/// assert.
template<>
struct is_allowed_storage_object_type<StorageObjectType::Dataset>
: std::true_type
struct isAllowedStorageObjectType<StorageObjectType::Dataset> : std::true_type
{
};

/// Helper struct to check if a StorageObjectType is allowed. Used in static
/// assert.
template<>
struct is_allowed_storage_object_type<StorageObjectType::Attribute>
: std::true_type
struct isAllowedStorageObjectType<StorageObjectType::Attribute> : std::true_type
{
};

Expand All @@ -213,7 +211,7 @@ class ReadDataWrapper
* slicing.
*/
template<StorageObjectType U>
struct is_dataset
struct isDataset
: std::integral_constant<bool, (U == StorageObjectType::Dataset)>
{
};
Expand All @@ -224,7 +222,7 @@ class ReadDataWrapper
* StorageObjectType::Attribute but not for other types, e.g., Group or
* Undefined.
*/
static_assert(is_allowed_storage_object_type<OTYPE>::value,
static_assert(isAllowedStorageObjectType<OTYPE>::value,
"StorageObjectType not allowed for ReadDataWrapper");

// Actual definition of the class
Expand Down Expand Up @@ -340,7 +338,7 @@ class ReadDataWrapper
* @return An DataBlockGeneric structure containing the data and shape.
*/
template<StorageObjectType U = OTYPE,
typename std::enable_if<is_dataset<U>::value, int>::type = 0>
typename std::enable_if<isDataset<U>::value, int>::type = 0>
inline DataBlockGeneric valuesGeneric(
const std::vector<SizeType>& start,
const std::vector<SizeType>& count = {},
Expand Down Expand Up @@ -397,7 +395,7 @@ class ReadDataWrapper
*/
template<typename T = VTYPE,
StorageObjectType U = OTYPE,
typename std::enable_if<is_dataset<U>::value, int>::type = 0>
typename std::enable_if<isDataset<U>::value, int>::type = 0>
inline DataBlock<VTYPE> values(const std::vector<SizeType>& start,
const std::vector<SizeType>& count = {},
const std::vector<SizeType>& stride = {},
Expand Down
1 change: 0 additions & 1 deletion src/io/hdf5/HDF5IO.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ class HDF5IO : public BaseIO

private:
/**
<<<<<<< HEAD:src/io/hdf5/HDF5IO.hpp
* @brief Reads data from an HDF5 dataset or attribute into a vector of the
* appropriate type.
*
Expand Down
11 changes: 1 addition & 10 deletions src/nwb/NWBFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,7 @@ Status NWBFile::createElectricalSeries(
AQNWB::mergePaths(acquisitionPath, recordingName);

// Check if device exists for groupName, create device and electrode group
// if not
if (!m_io->objectExists(devicePath)) {
Device device = Device(devicePath, m_io);
device.initialize("description", "unknown");

ElectrodeGroup elecGroup = ElectrodeGroup(electrodePath, m_io);
elecGroup.initialize("description", "unknown", device);
}

// Setup electrical series datasets
// if it does not
if (!m_io->objectExists(devicePath)) {
Device device = Device(devicePath, m_io);
device.initialize("description", "unknown");
Expand Down
1 change: 1 addition & 0 deletions src/nwb/ecephys/ElectricalSeries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ void ElectricalSeries::initialize(const IO::BaseDataType& dataType,
m_io->createAttribute(IO::BaseDataType::I32,
&axis_value,
AQNWB::mergePaths(getPath(), "channel_conversion"),
this->getPath() + "/channel_conversion",
"axis",
1);

Expand Down
3 changes: 1 addition & 2 deletions src/nwb/hdmf/base/Data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class Data : public RegisteredType
*/
inline bool isInitialized() { return m_dataset != nullptr; }

std::unique_ptr<IO::BaseRecordingData>
m_dataset; // TODO We may not want this here if we need Data for read
std::unique_ptr<IO::BaseRecordingData> m_dataset;
};
} // namespace AQNWB::NWB

0 comments on commit 415926c

Please sign in to comment.