39 auto shandle = group.openGroup(
"seed");
40 seed_details = validate_numeric_seed(shandle, version, options);
42 std::throw_with_nested(std::runtime_error(
"failed to validate 'seed'"));
48 auto mhandle = group.openDataSet(
"method");
49 method = read_scalar_string_dataset(mhandle);
50 if (method !=
"!" && method !=
"&&" && method !=
"||") {
51 throw std::runtime_error(
"unrecognized operation '" + method +
"'");
54 std::throw_with_nested(std::runtime_error(
"failed to validate 'method'"));
61 auto shandle = group.openDataSet(
"side");
62 auto side = read_scalar_string_dataset(shandle);
63 if (side !=
"left" && side !=
"right") {
64 throw std::runtime_error(
"expected 'left' or 'right' for operation '" + method +
"'");
67 std::throw_with_nested(std::runtime_error(
"failed to validate 'side'"));
70 enum Failure { VALUE, ALONG };
71 Failure who_failed = VALUE;
73 auto vhandle = group.openDataSet(
"value");
76 if (version.lt(1, 1, 0)) {
77 val_type = translate_type_0_99(vhandle.getTypeClass());
80 auto thandle = vhandle.openAttribute(
"type");
81 auto type = read_scalar_string_attribute(thandle);
82 val_type = translate_type_1_1(type);
83 check_type_1_1(vhandle, val_type);
85 std::throw_with_nested(std::runtime_error(
"failed to validate the 'type' attribute"));
88 if (val_type == STRING) {
89 throw std::runtime_error(
"dataset should be integer, float or boolean");
92 validate_missing_placeholder(vhandle, version);
94 auto vspace = vhandle.getSpace();
95 const auto ndims = vspace.getSimpleExtentNdims();
98 }
else if (ndims == 1) {
100 vspace.getSimpleExtentDims(&extent);
102 auto ahandle = group.openDataSet(
"along");
103 check_unary_along(ahandle, version, seed_details.
dimensions, extent);
106 throw std::runtime_error(
"dataset should be scalar or 1-dimensional");
111 switch (who_failed) {
112 case VALUE: desc =
"value";
break;
113 case ALONG: desc =
"along";
break;
115 std::throw_with_nested(std::runtime_error(
"failed to validate '" + desc +
"'"));
120 seed_details.
type = BOOLEAN;
ArrayDetails validate_unary_logic(const H5::Group &group, const ritsuko::Version &version, const Options &options)
Definition unary_logic.hpp:36