Skip to content

Commit

Permalink
Added extra offset to index_pointers
Browse files Browse the repository at this point in the history
 * Discussed in AllenInstitute/sonata#62
  • Loading branch information
Jorge Blanco Alonso committed Mar 5, 2020
1 parent 71968d0 commit 73b7bf8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/reports/data/sonata_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SonataData::SonataData(const std::string& report_name,
, hdf5_writer_(std::make_unique<HDF5Writer>(report_name))
, nodes_(nodes) {
prepare_buffer(max_buffer_size);
index_pointers_.resize(nodes->size());
index_pointers_.resize(nodes->size() + 1);
time_ = {tstart, tend, dt};

reporting_period_ = static_cast<int>(dt / SonataReport::atomic_step_);
Expand Down
2 changes: 1 addition & 1 deletion src/reports/io/hdf5_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void HDF5Writer::write_time(const std::string& dataset_name, const std::array<do
}

void HDF5Writer::close() {
// We close the dataset "/data", the spikes enum type and the hdf5 file
// We close the dataset "/data", the spike enum type and the hdf5 file
if (dataset_) {
H5Dclose(dataset_);
dataset_ = 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/reports/unit/test_sonatadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ SCENARIO("Test SonataData class", "[SonataData][IOWriter]") {

THEN("We check the index pointers of the sonata report") {
const std::vector<uint64_t> index_pointers = sonata->get_index_pointers();
std::vector<uint64_t> compare = {0, 2, 5};
std::vector<uint64_t> compare = {0, 2, 5, 11};
REQUIRE(index_pointers == compare);
}
}
Expand Down

0 comments on commit 73b7bf8

Please sign in to comment.