36 along = load_along(group.openDataSet(
"along"), version);
38 std::throw_with_nested(std::runtime_error(
"failed to validate 'along'"));
42 std::vector<std::size_t> dimensions;
45 const auto shandle = group.openGroup(
"seeds");
46 auto list_params = validate_list(shandle, version);
47 if (list_params.present.size() != list_params.length) {
48 throw std::runtime_error(
"missing elements in the 'seeds' list");
52 I<
decltype(list_params.length)> num_strings = 0;
54 for (
auto& p : list_params.present) {
56 auto sdhandle = shandle.openGroup(p.second);
57 auto cur_seed =
validate(sdhandle, version, options);
61 dimensions = std::move(cur_seed.dimensions);
63 throw std::runtime_error(
"'along' should be less than the seed dimensionality");
68 if (type < cur_seed.type) {
71 const auto ndims = dimensions.size();
72 if (ndims != cur_seed.dimensions.size()) {
73 throw std::runtime_error(
"detected dimensionality mismatch between seeds");
75 for (I<
decltype(ndims)> d = 0; d < ndims; ++d) {
78 }
else if (dimensions[d] != cur_seed.dimensions[d]) {
79 throw std::runtime_error(
"inconsistent dimension extents between seeds");
84 num_strings += (cur_seed.type == STRING);
86 std::throw_with_nested(std::runtime_error(
"failed to validate seed " + p.second));
90 if (num_strings != 0 && num_strings != list_params.length) {
91 throw std::runtime_error(
"either none or all of the arrays to be combined should contain strings");
94 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:90
ArrayDetails validate_combine(const H5::Group &group, const ritsuko::Version &version, const Options &options)
Definition combine.hpp:33