Skip to content

Commit 804c295

Browse files
committed
Add text2hdf5 to CMake
1 parent ad498b8 commit 804c295

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

examples/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ function(add_example example_name)
44
endfunction()
55

66
add_example(convert_binsparse)
7+
add_example(text2hdf5)
78
add_example(inspect_binsparse)

examples/convert_binsparse.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ int main(int argc, char** argv) {
147147
<< " values.\n";
148148
std::cout << "Type: " << type << std::endl;
149149
std::cout << "Structure: " << structure << std::endl;
150-
std::cout << "Comment:\n";
151-
std::cout << comment;
152150

153151
assert(format == "COO" || format == "CSR");
154152

include/binsparse/hdf5_tools.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,13 @@ void write_dataset(H5GroupOrFile& f, const std::string& label, R&& r) {
126126
using T = std::ranges::range_value_t<R>;
127127
hsize_t size = std::ranges::size(r);
128128
H5::DataSpace dataspace(1, &size);
129-
auto dataset =
130-
f.createDataSet(label.c_str(), get_hdf5_standard_type<T>(), dataspace);
129+
130+
H5::DSetCreatPropList property_list;
131+
property_list.setChunk(1, &size);
132+
property_list.setDeflate(9);
133+
134+
auto dataset = f.createDataSet(label.c_str(), get_hdf5_standard_type<T>(),
135+
dataspace, property_list);
131136

132137
dataset.write(std::ranges::data(r), get_hdf5_native_type<T>());
133138
dataset.close();

0 commit comments

Comments
 (0)