Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
oruebel committed Aug 31, 2024
1 parent 4d7b1ea commit 2db4bfe
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 49 deletions.
5 changes: 2 additions & 3 deletions src/nwb/NWBFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@ Status NWBFile::createElectricalSeries(
elecGroup.initialize();

// Setup electrical series datasets
auto electricalSeries = std::make_unique<ElectricalSeries>(
electricalSeriesPath,
io);
auto electricalSeries =
std::make_unique<ElectricalSeries>(electricalSeriesPath, io);
electricalSeries->initialize(
dataType,
channelVector,
Expand Down
3 changes: 1 addition & 2 deletions src/nwb/base/TimeSeries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ using namespace AQNWB::NWB;
// TimeSeries

/** Constructor */
TimeSeries::TimeSeries(const std::string& path,
std::shared_ptr<BaseIO> io)
TimeSeries::TimeSeries(const std::string& path, std::shared_ptr<BaseIO> io)
: Container(path, io)
{
}
Expand Down
3 changes: 1 addition & 2 deletions src/nwb/base/TimeSeries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ class TimeSeries : public Container
* @param path The location of the TimeSeries in the file.
* @param io A shared pointer to the IO object.
*/
TimeSeries(const std::string& path,
std::shared_ptr<BaseIO> io);
TimeSeries(const std::string& path, std::shared_ptr<BaseIO> io);

/**
* @brief Destructor
Expand Down
3 changes: 1 addition & 2 deletions src/nwb/device/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ using namespace AQNWB::NWB;

// Device
/** Constructor */
Device::Device(const std::string& path,
std::shared_ptr<BaseIO> io)
Device::Device(const std::string& path, std::shared_ptr<BaseIO> io)
: Container(path, io)
{
}
Expand Down
4 changes: 1 addition & 3 deletions src/nwb/device/Device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class Device : public Container
* @param path The location of the device in the file.
* @param io A shared pointer to the IO object.
*/
Device(const std::string& path,
std::shared_ptr<BaseIO> io);
Device(const std::string& path, std::shared_ptr<BaseIO> io);

/**
* @brief Destructor
Expand Down Expand Up @@ -48,6 +47,5 @@ class Device : public Container
* @return The description of the device.
*/
std::string getDescription() const;

};
} // namespace AQNWB::NWB
33 changes: 16 additions & 17 deletions src/nwb/ecephys/ElectricalSeries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ using namespace AQNWB::NWB;
/** Constructor */
ElectricalSeries::ElectricalSeries(const std::string& path,
std::shared_ptr<BaseIO> io)
: TimeSeries(path,
io)
: TimeSeries(path, io)
{
}

Expand All @@ -20,23 +19,23 @@ ElectricalSeries::~ElectricalSeries() {}

/** Initialization function*/
void ElectricalSeries::initialize(const BaseDataType& dataType,
const Types::ChannelVector& channelVector,
const std::string& description,
const SizeArray& dsetSize,
const SizeArray& chunkSize,
const float& conversion,
const float& resolution,
const float& offset)
const Types::ChannelVector& channelVector,
const std::string& description,
const SizeArray& dsetSize,
const SizeArray& chunkSize,
const float& conversion,
const float& resolution,
const float& offset)
{
TimeSeries::initialize(dataType,
"volts",
description,
channelVector[0].comments,
dsetSize,
chunkSize,
channelVector[0].getConversion(),
resolution,
offset);
"volts",
description,
channelVector[0].comments,
dsetSize,
chunkSize,
channelVector[0].getConversion(),
resolution,
offset);

// setup variables based on number of channels
std::vector<SizeType> electrodeInds(channelVector.size());
Expand Down
3 changes: 1 addition & 2 deletions src/nwb/ecephys/ElectricalSeries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class ElectricalSeries : public TimeSeries
* @param path The location of the ElectricalSeries in the file.
* @param io A shared pointer to the IO object.
*/
ElectricalSeries(const std::string& path,
std::shared_ptr<BaseIO> io);
ElectricalSeries(const std::string& path, std::shared_ptr<BaseIO> io);

/**
* @brief Destructor
Expand Down
4 changes: 2 additions & 2 deletions src/nwb/file/ElectrodeTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ ElectrodeTable::ElectrodeTable(std::shared_ptr<BaseIO> io)

ElectrodeTable::ElectrodeTable(const std::string& path,
std::shared_ptr<BaseIO> io)
: DynamicTable(electrodeTablePath, // use the electrodeTablePath
: DynamicTable(electrodeTablePath, // use the electrodeTablePath
io)
{
assert(path == electrodeTablePath);
assert(path == electrodeTablePath);
}

/** Destructor */
Expand Down
3 changes: 2 additions & 1 deletion src/nwb/file/ElectrodeTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class ElectrodeTable : public DynamicTable
* Initializes the ElectrodeTable by creating NWB related attributes and
* adding required columns.
*/
void initialize(const std::string& description = "metadata about extracellular electrodes");
void initialize(const std::string& description =
"metadata about extracellular electrodes");

/**
* @brief Finalizes the ElectrodeTable.
Expand Down
7 changes: 4 additions & 3 deletions src/nwb/hdmf/base/Container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ class Container
*/
std::string getPath() const;

template <typename T>
template<typename T>
static std::unique_ptr<T> create(const BaseIO& io, const std::string& path)
{
static_assert(std::is_base_of<Container, T>::value, "T must be a derived class of Container");
return std::unique_ptr<T>(new T(path, io));
static_assert(std::is_base_of<Container, T>::value,
"T must be a derived class of Container");
return std::unique_ptr<T>(new T(path, io));
}

protected:
Expand Down
4 changes: 3 additions & 1 deletion src/nwb/hdmf/base/Data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class Data
/**
* @brief Pointer to dataset.
*/
std::unique_ptr<BaseRecordingData> dataset; // TODO For read we may not want this here if we ned Data for reads
std::unique_ptr<BaseRecordingData>
dataset; // TODO For read we may not want this here if we ned Data for

Check failure on line 29 in src/nwb/hdmf/base/Data.hpp

View workflow job for this annotation

GitHub Actions / Check for spelling errors

ned ==> need, end, nod
// reads
};
} // namespace AQNWB::NWB
3 changes: 1 addition & 2 deletions src/nwb/hdmf/table/DynamicTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ using namespace AQNWB::NWB;
// DynamicTable

/** Constructor */
DynamicTable::DynamicTable(const std::string& path,
std::shared_ptr<BaseIO> io)
DynamicTable::DynamicTable(const std::string& path, std::shared_ptr<BaseIO> io)
: Container(path, io)
, description(description)
{
Expand Down
3 changes: 1 addition & 2 deletions src/nwb/hdmf/table/DynamicTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ class DynamicTable : public Container
* @param path The location of the table in the file.
* @param io A shared pointer to the IO object.
*/
DynamicTable(const std::string& path,
std::shared_ptr<BaseIO> io);
DynamicTable(const std::string& path, std::shared_ptr<BaseIO> io);

/**
* @brief Destructor
Expand Down
3 changes: 2 additions & 1 deletion tests/testBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ TEST_CASE("TimeSeries", "[base]")
std::vector<SizeType> dataShape = {numSamples};
std::vector<SizeType> positionOffset = {0};
BaseDataType dataType = BaseDataType::F32;
std::vector<float> data = {0,1,2,3,4,5,6,7,8,9}; // getMockData1D(numSamples);
std::vector<float> data = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; // getMockData1D(numSamples);
BaseDataType timestampsType = BaseDataType::F64;
std::vector<double> timestamps = getMockTimestamps(numSamples, 1);

Expand Down
8 changes: 2 additions & 6 deletions tests/testEcephys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ TEST_CASE("ElectricalSeries", "[ecephys]")
elecTable.initialize();

// setup electrical series
NWB::ElectricalSeries es =
NWB::ElectricalSeries(dataPath,
io);
NWB::ElectricalSeries es = NWB::ElectricalSeries(dataPath, io);
es.initialize(dataType,
mockArrays[0],
"no description",
Expand Down Expand Up @@ -110,9 +108,7 @@ TEST_CASE("ElectricalSeries", "[ecephys]")
elecTable.initialize();

// setup electrical series
NWB::ElectricalSeries es =
NWB::ElectricalSeries(dataPath,
io);
NWB::ElectricalSeries es = NWB::ElectricalSeries(dataPath, io);
es.initialize(dataType,
mockArrays[0],
"no description",
Expand Down

0 comments on commit 2db4bfe

Please sign in to comment.