34 auto shandle = group.openGroup(
"seed");
35 seed_details = validate_numeric_seed(shandle, version, options);
37 std::throw_with_nested(std::runtime_error(
"failed to validate 'seed'"));
43 auto mhandle = group.openDataSet(
"method");
44 method = read_scalar_string_dataset(mhandle);
45 if (method !=
"!" && method !=
"&&" && method !=
"||") {
46 throw std::runtime_error(
"unrecognized operation '" + method +
"'");
49 std::throw_with_nested(std::runtime_error(
"failed to validate 'method'"));
56 auto shandle = group.openDataSet(
"side");
57 auto side = read_scalar_string_dataset(shandle);
58 if (side !=
"left" && side !=
"right") {
59 throw std::runtime_error(
"expected 'left' or 'right' for operation '" + method +
"'");
62 std::throw_with_nested(std::runtime_error(
"failed to validate 'side'"));
65 enum Failure { VALUE, ALONG };
66 Failure who_failed = VALUE;
68 auto vhandle = group.openDataSet(
"value");
71 if (version.lt(1, 1, 0)) {
72 val_type = translate_type_0_99(vhandle.getTypeClass());
75 auto thandle = vhandle.openAttribute(
"type");
76 auto type = read_scalar_string_attribute(thandle);
77 val_type = translate_type_1_1(type);
78 check_type_1_1(vhandle, val_type);
80 std::throw_with_nested(std::runtime_error(
"failed to validate the 'type' attribute"));
83 if (val_type == STRING) {
84 throw std::runtime_error(
"dataset should be integer, float or boolean");
87 validate_missing_placeholder(vhandle, version);
89 auto vspace = vhandle.getSpace();
90 const auto ndims = vspace.getSimpleExtentNdims();
93 }
else if (ndims == 1) {
95 vspace.getSimpleExtentDims(&extent);
97 auto ahandle = group.openDataSet(
"along");
98 check_unary_along(ahandle, version, seed_details.
dimensions, extent);
101 throw std::runtime_error(
"dataset should be scalar or 1-dimensional");
106 switch (who_failed) {
107 case VALUE: desc =
"value";
break;
108 case ALONG: desc =
"along";
break;
110 std::throw_with_nested(std::runtime_error(
"failed to validate '" + desc +
"'"));
115 seed_details.
type = BOOLEAN;
ArrayDetails validate_unary_logic(const H5::Group &group, const ritsuko::Version &version, const Options &options)
Definition unary_logic.hpp:31