41 along = load_along(group.openDataSet(
"along"), version);
43 std::throw_with_nested(std::runtime_error(
"failed to validate 'along'"));
47 std::vector<std::size_t> dimensions;
50 const auto shandle = group.openGroup(
"seeds");
51 auto list_params = validate_list(shandle, version);
52 if (list_params.present.size() != list_params.length) {
53 throw std::runtime_error(
"missing elements in the 'seeds' list");
57 I<
decltype(list_params.length)> num_strings = 0;
59 for (
const auto& p : list_params.present) {
61 auto sdhandle = shandle.openGroup(p.second);
62 auto cur_seed =
validate(sdhandle, version, options);
66 dimensions = std::move(cur_seed.dimensions);
68 throw std::runtime_error(
"'along' should be less than the seed dimensionality");
73 if (type < cur_seed.type) {
76 const auto ndims = dimensions.size();
77 if (ndims != cur_seed.dimensions.size()) {
78 throw std::runtime_error(
"detected dimensionality mismatch between seeds");
80 for (I<
decltype(ndims)> d = 0; d < ndims; ++d) {
83 }
else if (dimensions[d] != cur_seed.dimensions[d]) {
84 throw std::runtime_error(
"inconsistent dimension extents between seeds");
89 num_strings += (cur_seed.type == STRING);
91 std::throw_with_nested(std::runtime_error(
"failed to validate seed " + p.second));
95 if (num_strings != 0 && num_strings != list_params.length) {
96 throw std::runtime_error(
"either none or all of the arrays to be combined should contain strings");
99 std::throw_with_nested(std::runtime_error(
"failed to validate 'seeds'"));
ArrayDetails validate(const H5::Group &group, const ritsuko::Version &version, const Options &options)
Definition validate.hpp:96
ArrayDetails validate_combine(const H5::Group &group, const ritsuko::Version &version, const Options &options)
Definition combine.hpp:38