10 #include <pybind11/pybind11.h>
11 #include <pybind11/stl.h>
19 namespace py = pybind11;
23 py::class_<Dimensions> dims(m,
"Dimensions");
24 dims.doc() =
"Dimensions of an attribute or variable";
31 std::ostringstream out;
32 out <<
"<ioda.Dimensions object:\n"
33 <<
"\tDimensionality: " << dims.dimensionality <<
"\n"
34 <<
"\tNumber of elements: " << dims.numElements <<
"\n"
35 <<
"\tCurrent dimensions: ";
36 for (
size_t i = 0; i < dims.dimsCur.size(); ++i) {
38 out << dims.dimsCur[i];
40 out <<
"\n\tMax dimensions: ";
41 for (
size_t i = 0; i < dims.dimsMax.size(); ++i) {
43 out << dims.dimsMax[i];
50 std::ostringstream out;
51 out <<
"<ioda.Dimensions object with current dimensions ";
52 if (dims.dimensionality) {
53 for (size_t i = 0; i < gsl::narrow<size_t>(dims.dimensionality); ++i) {
55 out << dims.dimsCur[i];
Interfaces for ioda::Group and related classes.
Python bindings - macros.
void setupDimensions(pybind11::module &m)
Describes the dimensions of an Attribute or Variable.
std::vector< Dimensions_t > dimsCur
The dimensions of the data.
Dimensions_t dimensionality
The dimensionality (rank) of the data.
std::vector< Dimensions_t > dimsMax
This must always equal dimsCur for Attribute.