Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Here is a small example of how to make use of the library in code:
using namespace hdf5;

// create a file
file::File f = file::create("writing_vector.h5",file::AccessFlags::TRUNCATE);
file::File f = file::create("writing_vector.h5",file::AccessFlags::Truncate);

// create a group
node::Group root_group = f.root();
Expand Down
138 changes: 69 additions & 69 deletions doc/design/model.uml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/design/source/design/dataspace.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@ Using a point selection

dataspace::points_t points{{3,2,3},{4,5,5}};

points.apply(dataspace::point_t::operator_t::SET,space);
points.apply(dataspace::point_t::operator_t::Set,space);
2 changes: 1 addition & 1 deletion doc/design/source/design/group.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Find all datasets below a particular group
std::back_inserter(datasets),
[](const auto &n)
{
return n.type() == node_t::type_t::DATASET;
return n.type() == node_t::type_t::Dataset;
});

Find groups with a particular attribute set to a specific value
Expand Down
2 changes: 1 addition & 1 deletion doc/design/source/design/node.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ defines the following values
| :cpp:enumerator:`node_t::type_t::GROUP` | if the instance is a |
| | group |
+--------------------------------------------------+----------------------+
| :cpp:enumerator:`node_t::type_t::DATASET` | if the instance is a |
| :cpp:enumerator:`node_t::type_t::Dataset` | if the instance is a |
| | dataset |
+--------------------------------------------------+----------------------+
| :cpp:enumerator:`node_t::type_t::NAMED_DATATYPE` | if the instance is a |
Expand Down
2 changes: 1 addition & 1 deletion doc/source/users_guide/dataspace.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ STL container to obtain all simple dataspaces in a collection sdfsdfsf
std::back_inserter(simple_dataspaces),
[](const Dataspace &space)
{
return space.type() == Type::SIMPLE;
return space.type() == Type::Simple;
});


Expand Down
22 changes: 11 additions & 11 deletions doc/source/users_guide/dataspace_selections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ For point selections there are two simple operations
+-----------+-----------------------------------------------+--------------------+-+
| operation | enumeration | description | |
+===========+===============================================+====================+=+
| append | :cpp:enumerator:`SelectionOperation::APPEND` | add a point to | |
| append | :cpp:enumerator:`SelectionOperation::Append` | add a point to | |
| | | to the end of the | |
| | | list of points | |
+-----------+-----------------------------------------------+--------------------+-+
| prepend | :cpp:enumerator:`SelectionOperation::PREPEND` | add a point to the | |
| prepend | :cpp:enumerator:`SelectionOperation::Prepend` | add a point to the | |
| | | beginning of the | |
| | | list of points | |
+-----------+-----------------------------------------------+--------------------+-+
Expand All @@ -149,33 +149,33 @@ For hyperslab selections we have
+-----------+--------------------------------------------+-----------------------+-+
| operation | enumeration | description | |
+===========+============================================+=======================+=+
| *set* | :cpp:enumerator:`SelectionOperation::SET` | replace all previous | |
| *set* | :cpp:enumerator:`SelectionOperation::Set` | replace all previous | |
| | | selections with the | |
| | | current one. | |
+-----------+--------------------------------------------+-----------------------+-+
| *or* | :cpp:enumerator:`SelectionOperation::OR` | select elements | |
| *or* | :cpp:enumerator:`SelectionOperation::Or` | select elements | |
| | | which are in the | |
| | | current or the | |
| | | previous selection. | |
+-----------+--------------------------------------------+-----------------------+-+
| *and* | :cpp:enumerator:`SelectionOperation::AND` | select elements whcih | |
| *and* | :cpp:enumerator:`SelectionOperation::And` | select elements whcih | |
| | | are in the current | |
| | | and the previous | |
| | | selection. | |
+-----------+--------------------------------------------+-----------------------+-+
| *xor* | :cpp:enumerator:`SelectionOperation::XOR` | select elements which | |
| *xor* | :cpp:enumerator:`SelectionOperation::XOr` | select elements which | |
| | | are either in the | |
| | | current or the | |
| | | the previous | |
| | | selection but on in | |
| | | both. | |
+-----------+--------------------------------------------+-----------------------+-+
| *notB* | :cpp:enumerator:`SelectionOperation::NOTB` | select elements whcih | |
| *notB* | :cpp:enumerator:`SelectionOperation::NotB` | select elements whcih | |
| | | are in the current | |
| | | but not in the | |
| | | previous selection. | |
+-----------+--------------------------------------------+-----------------------+-+
| *notA* | :cpp:enumerator:`SelectionOperation::NOTA` | select elements which | |
| *notA* | :cpp:enumerator:`SelectionOperation::NotA` | select elements which | |
| | | are in the previous | |
| | | but not in the | |
| | | current one. | |
Expand Down Expand Up @@ -211,9 +211,9 @@ Consider this example
.. code-block:: cpp

dataspace::SelectionList selections;
selections.push_back({dataspace::SelectionOperation::SET,
selections.push_back({dataspace::SelectionOperation::Set,
Selection::SharedPointer(new dataspace::Hyperslab({0,0},{100,100}))});
selections.push_back({dataspace::SelectionOperation::OR,
selections.push_back({dataspace::SelectionOperation::Or,
Selection::SharedPointer(new dataspace::Hyperslab({200,129},{100,100}))});

dataspace::Simple space = ...;
Expand Down Expand Up @@ -259,7 +259,7 @@ A selection can be applied like this

dataspace::Dataspace file_space = dataset.dataspace();
dataspace::Hyperslab slab(...);
file_space.selection(dataspace::SelectionOperation::SET,slab);
file_space.selection(dataspace::SelectionOperation::Set,slab);

.. important::

Expand Down
26 changes: 13 additions & 13 deletions doc/source/users_guide/files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ use

.. code-block:: cpp

file::File f1 = file::create(file_path,file::AccessFlags::TRUNCATE);
file::File f1 = file::create(file_path,file::AccessFlags::Truncate);

HDF5 uses property lists to pass additional information to API functions.
The :cpp:func:`hdf5::file::create` function accepts two additional arguments
Expand All @@ -92,11 +92,11 @@ you have to provide a custom file access property list
property::FileAccessList fapl;

//we need to set the appropriate version flags
fapl.library_version_bounds(property::LibVersion::LATEST,
property::LibVersion::LATEST);
fapl.library_version_bounds(property::LibVersion::Latest,
property::LibVersion::Latest);

file::File f = file::create("swmr_file.h5",
file::AccessFlags::TRUNCATE,
file::AccessFlags::Truncate,
fcpl,fapl);

Opening an existing file
Expand Down Expand Up @@ -126,7 +126,7 @@ of the file. To write to an existing file use

.. code-block:: cpp

file::File f1 = file::open(file_path,file::AccessFlags::READWRITE);
file::File f1 = file::open(file_path,file::AccessFlags::ReadWrite);

The only additional argument :cpp:func:`hdf5::file::open` takes is a
reference to file access property list. We have to use this to open a file
Expand All @@ -137,12 +137,12 @@ SWMR. To open a file for writing in SWMR mode use

property::FileAccessList fapl;
//we need to set the appropriate version flags
fapl.library_version_bounds(property::LibVersion::LATEST,
property::LibVersion::LATEST);
fapl.library_version_bounds(property::LibVersion::Latest,
property::LibVersion::Latest);

file::File write_fiel = file::open(file_path,
file::AccessFlags::READWRITE |
file::AccessFlags::SWMR_WRITE,
file::AccessFlags::ReadWrite |
file::AccessFlags::SWMRWrite,
fapl);

and to open a file for reading in SWMR mode use
Expand All @@ -151,12 +151,12 @@ and to open a file for reading in SWMR mode use

property::FileAccessList fapl;
//we need to set the appropriate version flags
fapl.library_version_bounds(property::LibVersion::LATEST,
property::LibVersion::LATEST);
fapl.library_version_bounds(property::LibVersion::Latest,
property::LibVersion::Latest);

file::File write_fiel = file::open(file_path,
file::AccessFlags::READONLY |
file::AccessFlags::SWMR_READ,
file::AccessFlags::ReadOnly |
file::AccessFlags::SWMRRead,
fapl);

Getting access to the object tree
Expand Down
4 changes: 2 additions & 2 deletions doc/source/users_guide/groups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ collect all the datasets immediately attached to a particular group
std::back_inserter(datasets),
[](const hdf5::node::Node &node)
{
return node.type()==hdf5::node::Type::DATASET;
return node.type()==hdf5::node::Type::Dataset;
});

For recursive iteration we currently cannot use the for-each construction
Expand All @@ -72,7 +72,7 @@ example we look for all datasets below a particular group and its subgroups
std::back_inserter(datasets),
[](const hdf5::node::Node &node)
{
return node.type()==hdf5::node::Type::DATASET;
return node.type()==hdf5::node::Type::Dataset;
});

the major difference here is to use :cpp:class:`RecursiveNodeIterator` and
Expand Down
4 changes: 2 additions & 2 deletions examples/append_scalar_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ node::Dataset create_dataset(const node::Group parent_group)
property::DatasetCreationList dcpl;

// in order to append data we have to use a chunked layout of the dataset
dcpl.layout(property::DatasetLayout::CHUNKED);
dcpl.layout(property::DatasetLayout::Chunked);
dcpl.chunk(Dimensions{1024});

// create dataspace (infinitely extensible) and datatype
Expand All @@ -47,7 +47,7 @@ node::Dataset create_dataset(const node::Group parent_group)
int main()
{
file::File f = file::create("append_scalar_data.h5",
file::AccessFlags::TRUNCATE);
file::AccessFlags::Truncate);
node::Group root_group = f.root();

//
Expand Down
4 changes: 2 additions & 2 deletions examples/append_vector_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ node::Dataset create_dataset(const node::Group parent_group,const Bins bins)
{
property::LinkCreationList lcpl;
property::DatasetCreationList dcpl;
dcpl.layout(property::DatasetLayout::CHUNKED);
dcpl.layout(property::DatasetLayout::Chunked);
dcpl.chunk({100,bins.size()});

dataspace::Simple space{{0,bins.size()},{dataspace::Simple::UNLIMITED,NBINS}};
Expand All @@ -56,7 +56,7 @@ void print_data(const std::string &prefix,const Bins &bins)
int main()
{
file::File f = file::create("append_vector_data.h5",
file::AccessFlags::TRUNCATE);
file::AccessFlags::Truncate);
node::Group root_group = f.root();
Bins data(NBINS);
node::Dataset dataset = create_dataset(root_group,data);
Expand Down
2 changes: 1 addition & 1 deletion examples/attributes/attribute_creation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using namespace hdf5;

int main()
{
file::File file = file::create("attribute_creation.h5",file::AccessFlags::TRUNCATE);
file::File file = file::create("attribute_creation.h5",file::AccessFlags::Truncate);
node::Group root_group = file.root();

auto author = root_group.attributes.create<std::string>("author");
Expand Down
2 changes: 1 addition & 1 deletion examples/attributes/attribute_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void tensor_attribute(const node::Node node)

int main()
{
file::File file = file::create("attribute_io.h5",file::AccessFlags::TRUNCATE);
file::File file = file::create("attribute_io.h5",file::AccessFlags::Truncate);
node::Group root_group = file.root();

author_attribute(root_group);
Expand Down
2 changes: 1 addition & 1 deletion examples/attributes/attribute_iteration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ using namespace hdf5;
//
int main()
{
file::File file = file::create("attribute_iteration.h5",file::AccessFlags::TRUNCATE);
file::File file = file::create("attribute_iteration.h5",file::AccessFlags::Truncate);
node::Group root_group = file.root();

root_group.attributes.create<int>("index");
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using namespace hdf5;

int main()
{
file::File f = file::create("basic_files.h5",file::AccessFlags::TRUNCATE);
file::File f = file::create("basic_files.h5",file::AccessFlags::Truncate);
node::Group root_group = f.root();

return 0;
Expand Down
2 changes: 1 addition & 1 deletion examples/complex_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using ComplexDouble = std::complex<double>;

int main()
{
file::File f = file::create("writing_complex.h5",file::AccessFlags::TRUNCATE);
file::File f = file::create("writing_complex.h5",file::AccessFlags::Truncate);
node::Group root_group = f.root();
node::Dataset dataset(root_group,"data",datatype::create<ComplexDouble>(),
dataspace::Scalar());
Expand Down
2 changes: 1 addition & 1 deletion examples/mpi/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int main(int argc,char **argv)
property::FileAccessList fapl;
fapl.driver(file::MPIDriver(MPI_COMM_WORLD,MPI_INFO_NULL));

file::File f = file::create("mpi_write.h5",file::AccessFlags::TRUNCATE,fcpl,fapl);
file::File f = file::create("mpi_write.h5",file::AccessFlags::Truncate,fcpl,fapl);
node::Group root_group = f.root();

node::Dataset dataset = root_group.create_dataset("mpi_ids",
Expand Down
4 changes: 2 additions & 2 deletions examples/mpi/writer_extend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ file::File create_file(MPI_Comm comm,MPI_Info info)
fapl.driver(file::MPIDriver(comm,info));

file::File f = file::create("mpi_write_extend.h5",
file::AccessFlags::TRUNCATE,
file::AccessFlags::Truncate,
fcpl,fapl);
return f;
}
Expand All @@ -47,7 +47,7 @@ node::Dataset create_dataset(const node::Group &base)

property::LinkCreationList lcpl;
property::DatasetCreationList dcpl;
dcpl.layout(property::DatasetLayout::CHUNKED);
dcpl.layout(property::DatasetLayout::Chunked);
dcpl.chunk({1024*1024});

return base.create_dataset("extended_data",file_type,file_space,lcpl,dcpl);
Expand Down
2 changes: 1 addition & 1 deletion examples/read_dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
using namespace hdf5;

void createFile() {
file::File File = file::create("SomeFile.hdf5", file::AccessFlags::TRUNCATE);
file::File File = file::create("SomeFile.hdf5", file::AccessFlags::Truncate);
node::Group RootGroup = File.root();

std::vector<int> Data{1, 2, 3, 4, 5, 6};
Expand Down
4 changes: 2 additions & 2 deletions examples/selecting_datasets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using namespace hdf5;
int main()
{

file::File f = file::create("selecting_datasets.h5",file::AccessFlags::TRUNCATE);
file::File f = file::create("selecting_datasets.h5",file::AccessFlags::Truncate);
node::Group root_group = f.root();

root_group.create_group("g1");
Expand All @@ -48,7 +48,7 @@ int main()
std::vector<node::Dataset> datasets;
std::copy_if(root_group.nodes.begin(),root_group.nodes.end(),
std::back_inserter(datasets),
[](const node::Node &n) { return n.type()==node::Type::DATASET;});
[](const node::Node &n) { return n.type()==node::Type::Dataset;});

std::cout<<"Found "<<datasets.size()<<" datasets"<<std::endl;
for(auto dset: datasets)
Expand Down
2 changes: 1 addition & 1 deletion examples/std_vector_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ using DataType = std::vector<int>;

int main()
{
file::File f = file::create("std_vector_io.h5",file::AccessFlags::TRUNCATE);
file::File f = file::create("std_vector_io.h5",file::AccessFlags::Truncate);
node::Group root_group = f.root();

//
Expand Down
2 changes: 1 addition & 1 deletion examples/swmr/swmr_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void SWMRBuilder::operator()(const node::Group &parent) const
{
property::LinkCreationList lcpl;
property::DatasetCreationList dcpl;
dcpl.layout(property::DatasetLayout::CHUNKED);
dcpl.layout(property::DatasetLayout::Chunked);
dcpl.chunk({1024*1024});

auto type = datatype::create<double>();
Expand Down
14 changes: 7 additions & 7 deletions examples/swmr/swmr_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@ SWMREnvironment::SWMREnvironment():
fapl_(),
fcpl_()
{
fapl_.library_version_bounds(property::LibVersion::LATEST,
property::LibVersion::LATEST);
fapl_.library_version_bounds(property::LibVersion::Latest,
property::LibVersion::Latest);
}

file::File SWMREnvironment::create_file(const fs::path &file_path,
const NodeBuilder &builder) const
{
file::File f = file::create(file_path,file::AccessFlags::TRUNCATE,
file::File f = file::create(file_path,file::AccessFlags::Truncate,
fcpl(),fapl());
builder(f.root());
return f;
}

file::File SWMREnvironment::open_write_file(const fs::path &file_path) const
{
return file::open(file_path,file::AccessFlags::READWRITE |
file::AccessFlags::SWMR_WRITE,fapl());
return file::open(file_path,file::AccessFlags::ReadWrite |
file::AccessFlags::SWMRWrite,fapl());
}

file::File SWMREnvironment::open_read_file(const fs::path &file_path) const
{
return file::open(file_path,file::AccessFlags::READONLY |
file::AccessFlags::SWMR_READ,fapl());
return file::open(file_path,file::AccessFlags::ReadOnly |
file::AccessFlags::SWMRRead,fapl());
}
2 changes: 1 addition & 1 deletion examples/swmr/swmr_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int main()
dset.extent(0,1); //extend dataset
selection.offset(0,index); //update selection
dset.write(buffer,selection); //write data to selection
write_file.flush(file::Scope::GLOBAL); // flush file
write_file.flush(file::Scope::Global); // flush file
std::cout<<"Writing "<<buffer<<std::endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
Expand Down
Loading