From f3fbaf019f9e4d79bfb6898258f755a461f59134 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Sat, 20 Dec 2025 19:57:09 -0700 Subject: [PATCH 01/20] Started adding subset by value code --- tests/dmr-test.cc | 92 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/tests/dmr-test.cc b/tests/dmr-test.cc index 01d9e766b..fbc0c1c19 100644 --- a/tests/dmr-test.cc +++ b/tests/dmr-test.cc @@ -48,6 +48,7 @@ #include "D4TestTypeFactory.h" #include "TestCommon.h" +#include "D4CEScanner.h" #include "D4ConstraintEvaluator.h" #include "D4FunctionEvaluator.h" #include "D4RValue.h" @@ -84,6 +85,97 @@ void logd(const string &msg, ostream &ostrm = cerr) { } } +void test_scanner(const string &input) { + const char *prompt = "ce-scanner: "; + istringstream iss(input); + auto s_type = make_unique(); + auto loc = make_unique(); + D4CEScanner ce_scanner(iss); + + cout << prompt << flush; // first prompt + + int tok; + while ((tok = ce_scanner.yylex(s_type.get(), loc.get()))) { + switch (tok) { + case D4CEParser::token::LBRACKET: + cout << "LBRACKET" << endl; + break; + case D4CEParser::token::RBRACKET: + cout << "RBRACKET" << endl; + break; + case D4CEParser::token::COLON: + cout << "COLON" << endl; + break; + case D4CEParser::token::COMMA: + cout << "COMMA" << endl; + break; + case D4CEParser::token::SEMICOLON: + cout << "SEMICOLON" << endl; + break; + case D4CEParser::token::PIPE: + cout << "PIPE" << endl; + break; + case D4CEParser::token::LBRACE: + cout << "LBRACE" << endl; + break; + case D4CEParser::token::RBRACE: + cout << "RBRACE" << endl; + break; + case D4CEParser::token::GROUP_SEP: + cout << "GROUP_SEP" << endl; + break; + case D4CEParser::token::PATH_SEP: + cout << "PATH_SEP" << endl; + break; + case D4CEParser::token::ASSIGN: + cout << "ASSIGN" << endl; + break; +#if 0 + case SCAN_FLOAT32: + cout << "FLOAT32" << endl; + break; + case SCAN_FLOAT64: + cout << "FLOAT64" << endl; + break; + case SCAN_STRING: + cout << "STRING" << endl; + break; + case SCAN_URL: + cout << "Url" << endl; + break; + case SCAN_WORD: + cout << "WORD: " << ddslval.word << endl; + break; + case '{': + cout << "Left Brace" << endl; + break; + case '}': + cout << "Right Brace" << endl; + break; + case '[': + cout << "Left Bracket" << endl; + break; + case ']': + cout << "Right Bracket" << endl; + break; + case ';': + cout << "Semicolon" << endl; + break; + case ':': + cout << "Colon" << endl; + break; + case '=': + cout << "Assignment" << endl; + break; +#endif + default: + cout << "Error: Unrecognized input" << endl; + break; + } + cout << prompt << flush; // print prompt after output + } +} + /** * Open the named XML file and parse it, assuming that it contains a DMR. * @param name The name of the DMR XML file (or '-' for stdin) From 6e819ceb4c1571867b9a5308d2834bf400e6e683 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Sat, 20 Dec 2025 20:13:41 -0700 Subject: [PATCH 02/20] Scanner test option in dmr-test embryonic --- tests/dmr-test.cc | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/tests/dmr-test.cc b/tests/dmr-test.cc index fbc0c1c19..07ab99b40 100644 --- a/tests/dmr-test.cc +++ b/tests/dmr-test.cc @@ -86,14 +86,11 @@ void logd(const string &msg, ostream &ostrm = cerr) { } void test_scanner(const string &input) { - const char *prompt = "ce-scanner: "; istringstream iss(input); auto s_type = make_unique(); auto loc = make_unique(); D4CEScanner ce_scanner(iss); - cout << prompt << flush; // first prompt - int tok; while ((tok = ce_scanner.yylex(s_type.get(), loc.get()))) { switch (tok) { @@ -344,23 +341,26 @@ DMR *read_data_plain(const string &file_name, bool use_checksums, bool debug) { } static void usage() { - cerr << "Usage: dmr-test -p|s|t|i [-c ] [-f ] [-d -x -e]" << endl - << "p: Parse a file (use \"-\" for stdin; if a ce or a function is passed those are parsed too)" << endl - << "s: Send: parse and then 'send' a response to a file" << endl - << "t: Transmit: parse, send and then read the response file" << endl - << "i: Intern values (ce and function will be ignored by this)" << endl - << "c: Constraint expression " << endl - << "f: Function expression" << endl - << "C: Use DAP4 Checksums" << endl - << "d: turn on detailed xml parser debugging" << endl - << "D: turn on detailed ce parser debugging" << endl - << "x: print the binary object(s) built by the parse, send, trans or intern operations." << endl - << "e: use sEries values." << endl; + cerr << R"(Usage: dmr-test -p|s|t|i [-c ] [-f ] [-d -x -e] +S: Test the scanner using the test passed in using the -c option (-c must be given) +p: Parse a file (use "-" for stdin; if a ce or a function is passed those are parsed too) +s: Send: parse and then 'send' a response to a file +t: Transmit: parse, send and then read the response file +i: Intern values (ce and function will be ignored by this) +c: Constraint expression +f: Function expression +C: Use DAP4 Checksums +d: turn on detailed xml parser debugging +D: turn on detailed ce parser debugging +x: print the binary object(s) built by the parse, send, trans or intern operations. +e: use sEries values. +)"; } int main(int argc, char *argv[]) { - GetOpt getopt(argc, argv, "p:s:t:i:c:f:xdDehC?"); + GetOpt getopt(argc, argv, "p:s:t:i:c:f:SxdDehC?"); int option_char; + bool scan = false; bool parse = false; bool debug = false; bool print = false; @@ -378,6 +378,9 @@ int main(int argc, char *argv[]) { while ((option_char = getopt()) != -1) switch (option_char) { + case 'S': + scan = true; + break; case 'p': parse = true; name = getopt.optarg; @@ -437,7 +440,7 @@ int main(int argc, char *argv[]) { return 1; } - if (!(parse || send || trans || intern)) { + if (!(parse || send || trans || intern || (scan && !ce.empty()))) { cerr << "Error: "; usage(); return 1; @@ -448,6 +451,7 @@ int main(int argc, char *argv[]) { logd(" name: " + name); logd(" debug: " + torf(debug)); logd(" print: " + torf(print)); + logd(" scan: " + torf(scan)); logd(" parse: " + torf(parse)); logd(" send: " + torf(send)); logd(" trans: " + torf(trans)); @@ -460,6 +464,10 @@ int main(int argc, char *argv[]) { } try { + if (scan && !ce.empty()) { + test_scanner(ce); + } + if (parse) { DMR *dmr = test_dap4_parser(name, use_checksums, debug, print); From c564387e94b1cae71b482f1408ce440dadf779fa Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Sun, 21 Dec 2025 20:35:54 -0700 Subject: [PATCH 03/20] dmr-test -S recognizes CE scanner symbols; errors with WORD and STRING --- d4_ce/d4_ce_parser.yy | 3 ++ d4_ce/d4_ce_scanner.ll | 4 +- tests/dmr-test.cc | 83 +++++++++++++++++++++++------------------- 3 files changed, 51 insertions(+), 39 deletions(-) diff --git a/d4_ce/d4_ce_parser.yy b/d4_ce/d4_ce_parser.yy index 1c74e3746..a677bfc5d 100644 --- a/d4_ce/d4_ce_parser.yy +++ b/d4_ce/d4_ce_parser.yy @@ -119,6 +119,9 @@ namespace libdap { RBRACKET "]" COLON ":" + LPAREN "(" + RPAREN ")" + LBRACE "{" RBRACE "}" diff --git a/d4_ce/d4_ce_scanner.ll b/d4_ce/d4_ce_scanner.ll index c72b83ebf..301c59bb5 100644 --- a/d4_ce/d4_ce_scanner.ll +++ b/d4_ce/d4_ce_scanner.ll @@ -89,7 +89,7 @@ typedef libdap::D4CEParser::token token; is the DAP2 comment character. Having the characters !, ~, and @ in the second set of the chars allowed - in a WORD token meant that 'var!=' parsed as WORD == 'var!' and '=' ane not + in a WORD token meant that 'var!=' parsed as WORD == 'var!' and '=' and not 'var' and '!='. I see that in DAP2 I did not include these in the definition of a WORD. jhrg 4/29/16 */ @@ -111,6 +111,8 @@ loc->step(); "[" return token::LBRACKET; "]" return token::RBRACKET; ":" return token::COLON; +"(" return token::LPAREN; +")" return token::RPAREN; "," return token::COMMA; ";" return token::SEMICOLON; "|" return token::PIPE; diff --git a/tests/dmr-test.cc b/tests/dmr-test.cc index 07ab99b40..db1b9e9d9 100644 --- a/tests/dmr-test.cc +++ b/tests/dmr-test.cc @@ -103,6 +103,12 @@ void test_scanner(const string &input) { case D4CEParser::token::COLON: cout << "COLON" << endl; break; + case D4CEParser::token::LPAREN: + cout << "LPAREN" << endl; + break; + case D4CEParser::token::RPAREN: + cout << "RPAREN" << endl; + break; case D4CEParser::token::COMMA: cout << "COMMA" << endl; break; @@ -127,49 +133,49 @@ void test_scanner(const string &input) { case D4CEParser::token::ASSIGN: cout << "ASSIGN" << endl; break; -#if 0 - case SCAN_FLOAT32: - cout << "FLOAT32" << endl; - break; - case SCAN_FLOAT64: - cout << "FLOAT64" << endl; - break; - case SCAN_STRING: - cout << "STRING" << endl; - break; - case SCAN_URL: - cout << "Url" << endl; - break; - case SCAN_WORD: - cout << "WORD: " << ddslval.word << endl; - break; - case '{': - cout << "Left Brace" << endl; - break; - case '}': - cout << "Right Brace" << endl; - break; - case '[': - cout << "Left Bracket" << endl; - break; - case ']': - cout << "Right Bracket" << endl; - break; - case ';': - cout << "Semicolon" << endl; - break; - case ':': - cout << "Colon" << endl; - break; - case '=': - cout << "Assignment" << endl; - break; -#endif + case D4CEParser::token::EQUAL: + cout << "EQUAL" << endl; + break; + case D4CEParser::token::NOT_EQUAL: + cout << "NOT_EQUAL" << endl; + break; + case D4CEParser::token::GREATER: + cout << "GREATER" << endl; + break; + case D4CEParser::token::GREATER_EQUAL: + cout << "GREATER_EQUAL" << endl; + break; + case D4CEParser::token::LESS: + cout << "LESS" << endl; + break; + case D4CEParser::token::LESS_EQUAL: + cout << "LESS_EQUAL" << endl; + break; + case D4CEParser::token::REGEX_MATCH: + cout << "REGEX_MATCH" << endl; + break; + case D4CEParser::token::LESS_BBOX: + cout << "LESS_BBOX" << endl; + break; + case D4CEParser::token::GREATER_BBOX: + cout << "GREATER_BBOX" << endl; + break; + case D4CEParser::token::MASK: + cout << "MASK" << endl; + break; + case D4CEParser::token::STRING: + cout << "STRING" << endl; + break; + case D4CEParser::token::WORD: + cout << "WORD: " << endl; + break; default: cout << "Error: Unrecognized input" << endl; break; } +#if 0 cout << prompt << flush; // print prompt after output +#endif } } @@ -466,6 +472,7 @@ int main(int argc, char *argv[]) { try { if (scan && !ce.empty()) { test_scanner(ce); + return 0; } if (parse) { From 5392ab1d648b0ccaf0b56cf2e590c6c010b4f4ab Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Mon, 22 Dec 2025 10:31:41 -0700 Subject: [PATCH 04/20] The 'scanner test' option in dmr-test now works. What is not so good is that a problem shows up. Using the new syntax [(45.6)] fails because the '.' scans as a PATH_SEP, and that breaks everything. This is why I added NUMBER before. But, that causes its own set of parsing issues. Try FLOAT and add rules in the parser for both [(FLOAT)] and [(WORD)]? --- tests/dmr-test.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/dmr-test.cc b/tests/dmr-test.cc index db1b9e9d9..76ce34c62 100644 --- a/tests/dmr-test.cc +++ b/tests/dmr-test.cc @@ -87,12 +87,12 @@ void logd(const string &msg, ostream &ostrm = cerr) { void test_scanner(const string &input) { istringstream iss(input); - auto s_type = make_unique(); - auto loc = make_unique(); + auto s_type = new D4CEParser::semantic_type(); // make_unique(); + auto loc = new location(); // make_unique(); D4CEScanner ce_scanner(iss); int tok; - while ((tok = ce_scanner.yylex(s_type.get(), loc.get()))) { + while ((tok = ce_scanner.yylex(s_type /*.get()*/, loc /*.get()*/))) { switch (tok) { case D4CEParser::token::LBRACKET: cout << "LBRACKET" << endl; @@ -164,18 +164,15 @@ void test_scanner(const string &input) { cout << "MASK" << endl; break; case D4CEParser::token::STRING: - cout << "STRING" << endl; + cout << "STRING: " << s_type->as() << endl; break; case D4CEParser::token::WORD: - cout << "WORD: " << endl; + cout << "WORD: " << s_type->as() << endl; break; default: cout << "Error: Unrecognized input" << endl; break; } -#if 0 - cout << prompt << flush; // print prompt after output -#endif } } From 85e1577569cb1cdff96c00408871c757ebef35a0 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Mon, 22 Dec 2025 19:55:32 -0700 Subject: [PATCH 05/20] Cleanup --- d4_ce/D4CEScanner.h | 4 ++-- tests/dmr-test.cc | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/d4_ce/D4CEScanner.h b/d4_ce/D4CEScanner.h index 3fc09b80e..ec9b79e23 100644 --- a/d4_ce/D4CEScanner.h +++ b/d4_ce/D4CEScanner.h @@ -50,7 +50,7 @@ namespace libdap { class D4CEScanner : public d4_ceFlexLexer { public: - D4CEScanner(std::istream &in) : d4_ceFlexLexer(&in), yylval(0), loc(0) {}; + explicit D4CEScanner(std::istream &in) : d4_ceFlexLexer(&in), yylval(nullptr), loc(nullptr) {}; int yylex(libdap::D4CEParser::semantic_type *lval, libdap::location *l) { loc = l; @@ -60,7 +60,7 @@ class D4CEScanner : public d4_ceFlexLexer { private: /* hide this one from public view */ - int yylex(); + int yylex() override; /* yyval ptr */ libdap::D4CEParser::semantic_type *yylval; diff --git a/tests/dmr-test.cc b/tests/dmr-test.cc index db1b9e9d9..c5b6b6a5f 100644 --- a/tests/dmr-test.cc +++ b/tests/dmr-test.cc @@ -173,9 +173,6 @@ void test_scanner(const string &input) { cout << "Error: Unrecognized input" << endl; break; } -#if 0 - cout << prompt << flush; // print prompt after output -#endif } } From c8707c9a1d8cbba487013a161b30b50d1ffa4375 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Mon, 22 Dec 2025 20:08:12 -0700 Subject: [PATCH 06/20] Scanner fixed so that the semantic_type object is cleared after every token --- tests/dmr-test.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/dmr-test.cc b/tests/dmr-test.cc index 76ce34c62..aac805106 100644 --- a/tests/dmr-test.cc +++ b/tests/dmr-test.cc @@ -87,12 +87,12 @@ void logd(const string &msg, ostream &ostrm = cerr) { void test_scanner(const string &input) { istringstream iss(input); - auto s_type = new D4CEParser::semantic_type(); // make_unique(); - auto loc = new location(); // make_unique(); + auto s_type = make_unique(); //new D4CEParser::semantic_type(); + auto loc = make_unique(); D4CEScanner ce_scanner(iss); int tok; - while ((tok = ce_scanner.yylex(s_type /*.get()*/, loc /*.get()*/))) { + while ((tok = ce_scanner.yylex(s_type.get(), loc.get()))) { switch (tok) { case D4CEParser::token::LBRACKET: cout << "LBRACKET" << endl; @@ -165,9 +165,11 @@ void test_scanner(const string &input) { break; case D4CEParser::token::STRING: cout << "STRING: " << s_type->as() << endl; + s_type->destroy(); break; case D4CEParser::token::WORD: cout << "WORD: " << s_type->as() << endl; + s_type->destroy(); break; default: cout << "Error: Unrecognized input" << endl; From a5303abc2d98228a0faf832fc096652679a9c923 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Mon, 22 Dec 2025 20:33:24 -0700 Subject: [PATCH 07/20] Added the 'value' state; emables values for subsetting arrays --- d4_ce/d4_ce_parser.yy | 4 +--- d4_ce/d4_ce_scanner.ll | 22 ++++++++++++++++++++-- tests/dmr-test.cc | 18 ++++++++---------- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/d4_ce/d4_ce_parser.yy b/d4_ce/d4_ce_parser.yy index a677bfc5d..866d153cd 100644 --- a/d4_ce/d4_ce_parser.yy +++ b/d4_ce/d4_ce_parser.yy @@ -99,6 +99,7 @@ namespace libdap { // The strings used in the token definitions are used for error messages %token WORD "word" +%token VALUE "value" %token STRING "string" // %type is used to set the return type of non-terminals; %token sets the @@ -119,9 +120,6 @@ namespace libdap { RBRACKET "]" COLON ":" - LPAREN "(" - RPAREN ")" - LBRACE "{" RBRACE "}" diff --git a/d4_ce/d4_ce_scanner.ll b/d4_ce/d4_ce_scanner.ll index 301c59bb5..18b95deca 100644 --- a/d4_ce/d4_ce_scanner.ll +++ b/d4_ce/d4_ce_scanner.ll @@ -83,7 +83,11 @@ typedef libdap::D4CEParser::token token; %option batch +/* quote is a special state for quoted strings. value is a special state + for values that are used for value-based-subsetting. Values for subsetting + cannot contain escaped characters. jhrg 12/22/25 */ %x quote +%x value /* This pattern just ensures that a word does not start with '#' which is the DAP2 comment character. @@ -111,8 +115,6 @@ loc->step(); "[" return token::LBRACKET; "]" return token::RBRACKET; ":" return token::COLON; -"(" return token::LPAREN; -")" return token::RPAREN; "," return token::COMMA; ";" return token::SEMICOLON; "|" return token::PIPE; @@ -168,6 +170,22 @@ loc->step(); YY_FATAL_ERROR("Unterminated quote"); } +[(] { BEGIN(value); yymore(); } + +[^)]* yymore(); /* Anything that's not a right paren */ + +[)] { + /* A right paren in the 'value' state indicates the end of the subset value */ + BEGIN(INITIAL); + yylval->build(yytext); + return token::VALUE; + } + +<> { + BEGIN(INITIAL); /* resetting the state is needed for reentrant parsers */ + YY_FATAL_ERROR("Unterminated subset value"); + } + . { BEGIN(INITIAL); if (yytext) { diff --git a/tests/dmr-test.cc b/tests/dmr-test.cc index aac805106..d50c00e69 100644 --- a/tests/dmr-test.cc +++ b/tests/dmr-test.cc @@ -103,12 +103,6 @@ void test_scanner(const string &input) { case D4CEParser::token::COLON: cout << "COLON" << endl; break; - case D4CEParser::token::LPAREN: - cout << "LPAREN" << endl; - break; - case D4CEParser::token::RPAREN: - cout << "RPAREN" << endl; - break; case D4CEParser::token::COMMA: cout << "COMMA" << endl; break; @@ -163,14 +157,18 @@ void test_scanner(const string &input) { case D4CEParser::token::MASK: cout << "MASK" << endl; break; - case D4CEParser::token::STRING: - cout << "STRING: " << s_type->as() << endl; - s_type->destroy(); - break; case D4CEParser::token::WORD: cout << "WORD: " << s_type->as() << endl; s_type->destroy(); break; + case D4CEParser::token::VALUE: + cout << "VALUE: " << s_type->as() << endl; + s_type->destroy(); + break; + case D4CEParser::token::STRING: + cout << "STRING: " << s_type->as() << endl; + s_type->destroy(); + break; default: cout << "Error: Unrecognized input" << endl; break; From dac2fad3e55421628f5b9a37cffd7df96dd47070 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Tue, 23 Dec 2025 09:32:44 -0700 Subject: [PATCH 08/20] pre-commit hook fail. --- .prettierignore | 2 ++ tests/dmr-test.cc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.prettierignore b/.prettierignore index 3ffaa54d4..4094f6d76 100644 --- a/.prettierignore +++ b/.prettierignore @@ -11,5 +11,7 @@ unit-tests/diff-match-patch tests/*-testsuite/** tests/dmrset/** +retired/** + # Ignore other non-source text build/** diff --git a/tests/dmr-test.cc b/tests/dmr-test.cc index d50c00e69..4d39813b1 100644 --- a/tests/dmr-test.cc +++ b/tests/dmr-test.cc @@ -87,7 +87,7 @@ void logd(const string &msg, ostream &ostrm = cerr) { void test_scanner(const string &input) { istringstream iss(input); - auto s_type = make_unique(); //new D4CEParser::semantic_type(); + auto s_type = make_unique(); auto loc = make_unique(); D4CEScanner ce_scanner(iss); From 51ed45e2c95720df4e07b78c3a49f27b2999bcb7 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Tue, 23 Dec 2025 19:18:00 -0700 Subject: [PATCH 09/20] Fixed dmr-test build when usiing cmake and not autotools. Also, added to the cmake README more info about actually using cmake for the builds. --- README.cmake.md | 67 ++++++++++++++++++++++++++++++++++++++++++++ tests/CMakeLists.txt | 6 +++- 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/README.cmake.md b/README.cmake.md index 2844acbd3..c4cc56e2b 100644 --- a/README.cmake.md +++ b/README.cmake.md @@ -70,3 +70,70 @@ Time to run the unit tests: Total Test time (real) = 2.35 sec make test -j20 2.20s user 0.14s system 98% cpu 2.381 total ``` + +## Using Cmake Presets + +There are several Presets defined that combine several cmake switches +in one setting. For example + +```bash +cmake --preset developer +``` + +uses the following options to configure the build: + +``` +Preset CMake variables: + + BIG_ARRAY_TEST="OFF" + BUILD_DEVELOPER="ON" + BUILD_TESTING="ON" + CMAKE_BUILD_TYPE="Debug" + CMAKE_CXX_STANDARD="14" + CMAKE_CXX_STANDARD_REQUIRED="ON" + CMAKE_INSTALL_PREFIX="$prefix" + USE_ASAN="OFF" + USE_CPP_11_REGEX="ON" +``` + +Note that using the preset makes the ```build``` directory and will configure +the build to use a directory named for the preset under the ```build``` directory. +For the _developer_ preset, that will be ```build/developer```: + +```commandline +hyrax_git/libdap4 % ls build/developer +cmake_install.cmake d4_ce/ http_dap/ Testing/ +CMakeCache.txt d4_function/ libdap.pc tests/ +CMakeFiles/ dap-config libdap4Config.cmake unit-tests/ +config.h DartConfiguration.tcl libdap4ConfigVersion.cmake xdr-datatypes.h +CTestTestfile.cmake dods-datatypes.h Makefile +``` + +You can run the build using cmake from the top -level of the repo like this: + +```bash +cmake --build . --preset developer --parallel +``` + +and run the tests like this: + +```bash +ctest --preset developer +``` + +The ```ctest``` program does that ```--parallel``` but don't use that with libdap +until the test tolls are made thread safe. If you do use ```--parallel``` by mistake +then clean the dirs and re-run the tests. Until the tests are more solid, it might +be best to just ```rm -rf build``` and start over. There are special targets to +clean out the temp files made by the tests, that target is called _clean-tests_. + +To use ```cmake``` to run a custom target, use this syntax: + +```bash +cmake --build . --preset developer --parallel --target clean-tests +``` + +## You can still use _make_ + +To use ```make```, just cd to ```build/developer``` and run the usual commands to +build an install the code. Use the target _test_ to run the tests. diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b5b2143fb..cfe3ffcdb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -69,11 +69,15 @@ if(TIRPC_FOUND) target_link_libraries(expr-test PRIVATE ${TIRPC_LIBRARIES}) endif() +# There are headers that are generated and put in the CURRENT_BINARY_DIR. +# When the scanner tester was added to dmr-test, the /d4_ce had +# to be added to the target_include_directories add_executable(dmr-test dmr-test.cc D4ResponseBuilder.cc) target_include_directories(dmr-test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${LIBXML2_INCLUDE_DIR} - ${CMAKE_SOURCE_DIR}/d4_ce ${CMAKE_SOURCE_DIR}/d4_function) + ${CMAKE_SOURCE_DIR}/d4_ce ${CMAKE_SOURCE_DIR}/d4_function + ${CMAKE_BINARY_DIR}/d4_ce) target_link_libraries(dmr-test PRIVATE test-types dapserver dap) if(TIRPC_FOUND) target_include_directories(dmr-test PRIVATE ${TIRPC_INCLUDE_DIRS}) From 2f528d1ed18755f5b9b0c0a45c288dabcbeae89b Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Tue, 23 Dec 2025 19:29:48 -0700 Subject: [PATCH 10/20] Stop using prettier for markdown --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 63e7f3ea8..a62596fc3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -66,6 +66,6 @@ repos: - id: prettier args: ["--no-cache"] # Problems with caching on OSX. jhrg 10/31/25 # Choose what Prettier formats: - types_or: [json, yaml, markdown] + types_or: [json, yaml] additional_dependencies: - prettier@3.6.0 From 8e06dd149b3622cca7fd98de4c64b1e0567e0673 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Tue, 23 Dec 2025 19:35:56 -0700 Subject: [PATCH 11/20] Ran precommit by hand --- README.cmake.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.cmake.md b/README.cmake.md index c4cc56e2b..5e120b198 100644 --- a/README.cmake.md +++ b/README.cmake.md @@ -1,6 +1,6 @@ # Using cmake to build libdap4 -## how to build outside the source tree +## How to build outside the source tree Make a build directory (or build/libdap4 if libdap4 is a git submodule). Then, in that directory, run cmake with the source directory as a command line @@ -101,7 +101,7 @@ the build to use a directory named for the preset under the ```build``` director For the _developer_ preset, that will be ```build/developer```: ```commandline -hyrax_git/libdap4 % ls build/developer +hyrax_git/libdap4 % ls build/developer cmake_install.cmake d4_ce/ http_dap/ Testing/ CMakeCache.txt d4_function/ libdap.pc tests/ CMakeFiles/ dap-config libdap4Config.cmake unit-tests/ @@ -123,7 +123,7 @@ ctest --preset developer The ```ctest``` program does that ```--parallel``` but don't use that with libdap until the test tolls are made thread safe. If you do use ```--parallel``` by mistake -then clean the dirs and re-run the tests. Until the tests are more solid, it might +then clean the dirs and re-run the tests. Until the tests are more solid, it might be best to just ```rm -rf build``` and start over. There are special targets to clean out the temp files made by the tests, that target is called _clean-tests_. @@ -135,5 +135,5 @@ cmake --build . --preset developer --parallel --target clean-tests ## You can still use _make_ -To use ```make```, just cd to ```build/developer``` and run the usual commands to +To use _make_, just cd to ```build/developer``` and run the usual commands to build an install the code. Use the target _test_ to run the tests. From cbcba8d5d034a7affc48e3dc0196317dfdd6c053 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Tue, 23 Dec 2025 19:37:10 -0700 Subject: [PATCH 12/20] Updated the precommit hooks from 4.6.0 to 6.0.0 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a62596fc3..7a4c39b23 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ exclude: | repos: # --- Baseline sanity checks (fast, safe) --- - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v6.0.0 hooks: - id: end-of-file-fixer # This is lame, and there's supposed to be a better way, but I cannot From 7e4151030a28990f0ec61b87af2a1a486d3cd0f2 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Wed, 24 Dec 2025 10:42:21 -0700 Subject: [PATCH 13/20] Added value-based subsetting CE grammar hackery --- d4_ce/D4ConstraintEvaluator.h | 14 ++++++++++++-- d4_ce/d4_ce_parser.yy | 15 ++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/d4_ce/D4ConstraintEvaluator.h b/d4_ce/D4ConstraintEvaluator.h index c6be87a30..00a612660 100644 --- a/d4_ce/D4ConstraintEvaluator.h +++ b/d4_ce/D4ConstraintEvaluator.h @@ -61,9 +61,9 @@ class D4ConstraintEvaluator { bool empty = false; // When a slice is applied to an Array with Maps, we need to know the name of // each dimension. These names are then used to apply the slice to each of the - // Maps (Maps may have fewer dimensions than the Array, but the idea that a + // Maps. Maps may have fewer dimensions than the Array, but the idea that a // Map is a simple vector doesn't hold for DAP4, so the mapping between a slice's - // indexes and the set of Maps can be complex - use the names to make sure + // indexes and the set of Maps can be complex. Use the names to make sure // all cases are covered. The value of this field may be empty. std::string dim_name; @@ -83,6 +83,16 @@ class D4ConstraintEvaluator { static index make_index(const std::string &i, const std::string &s); static index make_index(const std::string &i, int64_t s); + // For now, if a value-based subset is given, return the entire dimension. jhrg 12/23/25 + // start and end + static index make_value_based_index(const std::string &, const std::string &) { + return index(0, 0, 0, false, true, ""); + } + // start, stride, end + static index make_value_based_index(const std::string &, const std::string &, const std::string &) { + return index(0, 0, 0, false, true, ""); + } + bool d_trace_scanning = false; bool d_trace_parsing = false; bool d_result = false; diff --git a/d4_ce/d4_ce_parser.yy b/d4_ce/d4_ce_parser.yy index 866d153cd..878398ab9 100644 --- a/d4_ce/d4_ce_parser.yy +++ b/d4_ce/d4_ce_parser.yy @@ -314,6 +314,19 @@ index : "[" "]" { $$ = driver.make_index(); } | "[" WORD ":" WORD ":" WORD "]" { $$ = driver.make_index($2, $4, $6); } | "[" WORD ":" "]" { $$ = driver.make_index($2, 1); } | "[" WORD ":" WORD ":" "]" { $$ = driver.make_index($2, $4); } + +// Value-based subsetting rules. the stride must be an integer. +// I don't think this makes much sense. "[" VALUE "]" +| "[" VALUE ":" VALUE "]" { $$ = driver.make_value_based_index($2, $4); } +| "[" VALUE ":" WORD ":" VALUE "]" { $$ = driver.make_value_based_index($2, $4, $6); } + +// Value-based subsetting starting with a value and going to the end. +// Add these once the initial two are working. jhrg 12/23/25 +// | "[" VALUE ":" "]" { $$ = driver.make_value_based_index($2, 1); } +// | "[" VALUE ":" WORD ":" "]" { $$ = driver.make_value_based_index($2, $4); } +// Value-based subsetting starting at the beginning and going to a value. +// | "[" ":" VALUE "]" { $$ = driver.make_index($2, 1); } +// | "[" ":" VALUE ":" WORD "]" { $$ = driver.make_index($2, $4); } ; fields : "{" clauses "}" { $$ = $2; } @@ -410,7 +423,7 @@ path : name // Because some formats/datasets allow 'any' name for a variable, it's possible // that a variable name will be a number, etc. The grammar also allows STRING -// to support "name"."name with spaces and dots (.)".x +// to support "name"."name with spaces and dots (.)". // // I added calls here to remove the double quotes because they were breaking // the parse for STRINGs and also added www2id() for WORDs (so that %20, etc. From 21dbe636e8362ee6abe1f1b0f879f1386cf8f442 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Wed, 24 Dec 2025 14:56:26 -0700 Subject: [PATCH 14/20] Minor hack/patch to the D4CEEvaluator to test parsing of value-based CEs This just sets any value-based dimension subset to 0:1:0. This shows that parsing works. The next step - to determine the indices based on values, is going to be left until the grid/geogrid functions are done. --- d4_ce/D4ConstraintEvaluator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d4_ce/D4ConstraintEvaluator.h b/d4_ce/D4ConstraintEvaluator.h index 00a612660..cae55fc89 100644 --- a/d4_ce/D4ConstraintEvaluator.h +++ b/d4_ce/D4ConstraintEvaluator.h @@ -86,11 +86,11 @@ class D4ConstraintEvaluator { // For now, if a value-based subset is given, return the entire dimension. jhrg 12/23/25 // start and end static index make_value_based_index(const std::string &, const std::string &) { - return index(0, 0, 0, false, true, ""); + return index(0, 1, 0, false, false, ""); } // start, stride, end static index make_value_based_index(const std::string &, const std::string &, const std::string &) { - return index(0, 0, 0, false, true, ""); + return index(0, 1, 0, false, false, ""); } bool d_trace_scanning = false; From 0f9019d2f04ef6489e63704f5a7426cecb367d77 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Wed, 24 Dec 2025 15:55:10 -0700 Subject: [PATCH 15/20] Moved old attempt at value-bsed subsetting to 'retired' --- {d4_ce => retired/d4_ce}/D4ConstraintEvaluator.cc.nat_axes | 0 {d4_ce => retired/d4_ce}/D4ConstraintEvaluator.h.nat_axes | 0 {d4_ce => retired/d4_ce}/d4_ce_parser.yy.nat_axes | 0 {d4_ce => retired/d4_ce}/d4_ce_scanner.ll.nat_axes | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {d4_ce => retired/d4_ce}/D4ConstraintEvaluator.cc.nat_axes (100%) rename {d4_ce => retired/d4_ce}/D4ConstraintEvaluator.h.nat_axes (100%) rename {d4_ce => retired/d4_ce}/d4_ce_parser.yy.nat_axes (100%) rename {d4_ce => retired/d4_ce}/d4_ce_scanner.ll.nat_axes (100%) diff --git a/d4_ce/D4ConstraintEvaluator.cc.nat_axes b/retired/d4_ce/D4ConstraintEvaluator.cc.nat_axes similarity index 100% rename from d4_ce/D4ConstraintEvaluator.cc.nat_axes rename to retired/d4_ce/D4ConstraintEvaluator.cc.nat_axes diff --git a/d4_ce/D4ConstraintEvaluator.h.nat_axes b/retired/d4_ce/D4ConstraintEvaluator.h.nat_axes similarity index 100% rename from d4_ce/D4ConstraintEvaluator.h.nat_axes rename to retired/d4_ce/D4ConstraintEvaluator.h.nat_axes diff --git a/d4_ce/d4_ce_parser.yy.nat_axes b/retired/d4_ce/d4_ce_parser.yy.nat_axes similarity index 100% rename from d4_ce/d4_ce_parser.yy.nat_axes rename to retired/d4_ce/d4_ce_parser.yy.nat_axes diff --git a/d4_ce/d4_ce_scanner.ll.nat_axes b/retired/d4_ce/d4_ce_scanner.ll.nat_axes similarity index 100% rename from d4_ce/d4_ce_scanner.ll.nat_axes rename to retired/d4_ce/d4_ce_scanner.ll.nat_axes From b2e2bdbdeb8ff5a64013ad6c40bf214991ce3958 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Mon, 29 Dec 2025 15:04:08 -0700 Subject: [PATCH 16/20] Added tests for the 'ERDDAP' syntax parsing. This does not affect any other parts of the parser and all current behavior should work. --- d4_ce/unit-tests/D4ConstraintEvaluatorTest.cc | 2 +- tests/DMRTest.at | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/d4_ce/unit-tests/D4ConstraintEvaluatorTest.cc b/d4_ce/unit-tests/D4ConstraintEvaluatorTest.cc index 470c73b98..e135c6d16 100644 --- a/d4_ce/unit-tests/D4ConstraintEvaluatorTest.cc +++ b/d4_ce/unit-tests/D4ConstraintEvaluatorTest.cc @@ -125,7 +125,7 @@ class D4ConstraintEvaluatorTest : public CppUnit::TestFixture { D4ConstraintEvaluator::throw_not_array("id", "ident"); CPPUNIT_FAIL("Expected throw_not_array to throw an exception"); } catch (const Error &e) { - // Verify specific error message and details (if applicable) + // Verify a specific error message and details (if applicable) CPPUNIT_ASSERT_EQUAL(e.get_error_code(), no_such_variable); // Additional assertions for message details based on implementation } diff --git a/tests/DMRTest.at b/tests/DMRTest.at index b2cdcf166..6a1feeab7 100644 --- a/tests/DMRTest.at +++ b/tests/DMRTest.at @@ -715,3 +715,19 @@ DMR_TRANS_CE([vol_1_ce_13.xml], [/inst2/inst3], [vol_1_ce_13.xml.2.trans_base], DMR_TRANS_CE([vol_1_ce_13.xml], [/attr_only_global], [vol_1_ce_13.xml.3.trans_base], [pass]) DMR_TRANS_CE([vol_1_ce_13.xml], [/inst2/attr_only], [vol_1_ce_13.xml.4.trans_base], [pass]) + +# Test the value-based subsetting syntax addition. NB: vbs (value-based subsetting). jhrg 12/29/25 +# This is the baseline version to start with - the temporary hack for the parsing uses an 'index' +# of 0:1:0. Thus, _for now_, all these CEs return the same values. That will change once the work +# moves forward. +DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[[0]];/col=[[0]];a[[]][[]] ], [test_array_4.xml.vbs.1a.trans_base], [pass]) +DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[[(0):(1)]];/col=[[(0):(1)]];a[[]][[]] ], [test_array_4.xml.vbs.1a.trans_base], [pass]) +DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[[(10):(11.11)]];/col=[[(0.4):(-10.7)]];a[[]][[]] ], [test_array_4.xml.vbs.1a.trans_base], [pass]) + +DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[[0]];/col=[[0]];x[[]][[]] ], [test_array_4.xml.vbs.1x.trans_base], [pass]) +DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[[(0):(1)]];/col=[[(0):(1)]];x[[]][[]] ], [test_array_4.xml.vbs.1x.trans_base], [pass]) +DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[[(10):(11.11)]];/col=[[(0.4):(-10.7)]];x[[]][[]] ], [test_array_4.xml.vbs.1x.trans_base], [pass]) + +DMR_TRANS_CE_NO_CRC([vol_1_ce_7.xml], [nlon=[[0:2]];nlat=[[0]];temp[[]][[]] ], [vol_1_ce_7.xml.vbs.1.trans_base], [pass]) +DMR_TRANS_CE_NO_CRC([vol_1_ce_7.xml], [nlon=[[0:2]];nlat=[[(10.0):(-17.9)]];temp[[]][[]] ], [vol_1_ce_7.xml.vbs.1.trans_base], [pass]) +DMR_TRANS_CE_NO_CRC([vol_1_ce_7.xml], [nlon=[[0:2]];nlat=[[(0.09):(-17.9)]];temp[[]][[]] ], [vol_1_ce_7.xml.vbs.1.trans_base], [pass]) From 31b32ea82c171702b54d1c9ded745ddc35a1a286 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Mon, 29 Dec 2025 15:09:34 -0700 Subject: [PATCH 17/20] Added comments to clarify a somewhat obscure issue. Shared dimensions support the 'shared subset' syntax, but will not support subset by value _unless_ there is a Map array in the dataset. --- tests/DMRTest.at | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/DMRTest.at b/tests/DMRTest.at index 6a1feeab7..ac3973f89 100644 --- a/tests/DMRTest.at +++ b/tests/DMRTest.at @@ -720,6 +720,10 @@ DMR_TRANS_CE([vol_1_ce_13.xml], [/inst2/attr_only], [vol_1_ce_13.xml.4.trans_bas # This is the baseline version to start with - the temporary hack for the parsing uses an 'index' # of 0:1:0. Thus, _for now_, all these CEs return the same values. That will change once the work # moves forward. + +# NB: test_array_4.xml uses shared dimensions, to the indicial syntax parses, but it does not +# have Maps, so this kind of subsetting will actually fail. Make sure that these six following +# tests _do_ fail once the VBS logic is coded. jhrg 12/29/25 DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[[0]];/col=[[0]];a[[]][[]] ], [test_array_4.xml.vbs.1a.trans_base], [pass]) DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[[(0):(1)]];/col=[[(0):(1)]];a[[]][[]] ], [test_array_4.xml.vbs.1a.trans_base], [pass]) DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[[(10):(11.11)]];/col=[[(0.4):(-10.7)]];a[[]][[]] ], [test_array_4.xml.vbs.1a.trans_base], [pass]) @@ -728,6 +732,7 @@ DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[[0]];/col=[[0]];x[[]][[]] ], [tes DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[[(0):(1)]];/col=[[(0):(1)]];x[[]][[]] ], [test_array_4.xml.vbs.1x.trans_base], [pass]) DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[[(10):(11.11)]];/col=[[(0.4):(-10.7)]];x[[]][[]] ], [test_array_4.xml.vbs.1x.trans_base], [pass]) +# NB: vol_1_ce_7.xml has Maps and this should not only parse but also subset by value. jhrg 12/29/25 DMR_TRANS_CE_NO_CRC([vol_1_ce_7.xml], [nlon=[[0:2]];nlat=[[0]];temp[[]][[]] ], [vol_1_ce_7.xml.vbs.1.trans_base], [pass]) DMR_TRANS_CE_NO_CRC([vol_1_ce_7.xml], [nlon=[[0:2]];nlat=[[(10.0):(-17.9)]];temp[[]][[]] ], [vol_1_ce_7.xml.vbs.1.trans_base], [pass]) DMR_TRANS_CE_NO_CRC([vol_1_ce_7.xml], [nlon=[[0:2]];nlat=[[(0.09):(-17.9)]];temp[[]][[]] ], [vol_1_ce_7.xml.vbs.1.trans_base], [pass]) From 0013449443d851e9acb73f8157a5d09f4072d08e Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Mon, 29 Dec 2025 15:26:56 -0700 Subject: [PATCH 18/20] Added the new tests to the cmake build --- tests/cmake/dmr-tests.cmake | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/cmake/dmr-tests.cmake b/tests/cmake/dmr-tests.cmake index 5a2425d18..5750b034c 100644 --- a/tests/cmake/dmr-tests.cmake +++ b/tests/cmake/dmr-tests.cmake @@ -458,3 +458,37 @@ dmr_series_test(177 names_with_spaces2.dmr "/inst2/\"Point%20Break\".x" names_wi dmr_series_test(178 names_with_spaces3.dmr "/inst2/\"New Group\"/x" names_with_spaces3.dmr.1.trans_base "xfail") dmr_series_test(179 names_with_spaces3.dmr "/inst2/New%20Group/x" names_with_spaces3.dmr.1.trans_base "xfail") + +# Test the value-based subsetting syntax addition. NB: vbs (value-based subsetting). jhrg 12/29/25 +# This is the baseline version to start with - the temporary hack for the parsing uses an 'index' +# of 0:1:0. Thus, _for now_, all these CEs return the same values. That will change once the work +# moves forward. + +# NB: test_array_4.xml uses shared dimensions, to the indicial syntax parses, but it does not +# have Maps, so this kind of subsetting will actually fail. Make sure that these six following +# tests _do_ fail once the VBS logic is coded. jhrg 12/29/25 +dmr_trans_test(180 test_array_4.xml "/row=[0];/col=[0];a[][]" "" test_array_4.xml.vbs.1a.trans_base "universal") +dmr_trans_test(181 test_array_4.xml "/row=[(0):(1)];/col=[(0):(1)];a[][]" "" test_array_4.xml.vbs.1a.trans_base "universal") +dmr_trans_test(182 test_array_4.xml "/row=[(10):(11.11)];/col=[(0.4):(-10.7)];a[][]" "" test_array_4.xml.vbs.1a.trans_base "universal") + +# The above tests were derived from, and use the same baselines as, these three below. jhrg 12/29/25 +# DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[0];/col=[0];a[][] ], [test_array_4.xml.vbs.1a.trans_base], [pass]) +# DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[(0):(1)];/col=[(0):(1)];a[][] ], [test_array_4.xml.vbs.1a.trans_base], [pass]) +# DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[(10):(11.11)];/col=[(0.4):(-10.7)];a[][] ], [test_array_4.xml.vbs.1a.trans_base], [pass]) + +dmr_trans_test(183 test_array_4.xml "/row=[0];/col=[0];x[][]" "" test_array_4.xml.vbs.1x.trans_base "universal") +dmr_trans_test(184 test_array_4.xml "/row=[(0):(1)];/col=[(0):(1)];x[][]" "" test_array_4.xml.vbs.1x.trans_base "universal") +dmr_trans_test(185 test_array_4.xml "/row=[(10):(11.11)];/col=[(0.4):(-10.7)];x[][]" "" test_array_4.xml.vbs.1x.trans_base "universal") + +# DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[0];/col=[0];x[][] ], [test_array_4.xml.vbs.1x.trans_base], [pass]) +# DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[(0):(1)];/col=[(0):(1)];x[][] ], [test_array_4.xml.vbs.1x.trans_base], [pass]) +# DMR_TRANS_CE_NO_CRC([test_array_4.xml], [/row=[(10):(11.11)];/col=[(0.4):(-10.7)];x[][] ], [test_array_4.xml.vbs.1x.trans_base], [pass]) + +# NB: vol_1_ce_7.xml has Maps and this should not only parse but also subset by value. jhrg 12/29/25 +dmr_trans_test(186 vol_1_ce_7.xml "nlon=[0:2];nlat=[0];temp[][]" "" vol_1_ce_7.xml.vbs.1.trans_base "universal") +dmr_trans_test(187 vol_1_ce_7.xml "nlon=[0:2];nlat=[(10.0):(-17.9)];temp[][]" "" vol_1_ce_7.xml.vbs.1.trans_base "universal") +dmr_trans_test(188 vol_1_ce_7.xml "nlon=[0:2];nlat=[(0.09):(-17.9)];temp[][]" "" vol_1_ce_7.xml.vbs.1.trans_base "universal") + +# DMR_TRANS_CE_NO_CRC([vol_1_ce_7.xml], [nlon=[0:2];nlat=[0];temp[][] ], [vol_1_ce_7.xml.vbs.1.trans_base], [pass]) +# DMR_TRANS_CE_NO_CRC([vol_1_ce_7.xml], [nlon=[0:2];nlat=[(10.0):(-17.9)];temp[][] ], [vol_1_ce_7.xml.vbs.1.trans_base], [pass]) +# DMR_TRANS_CE_NO_CRC([vol_1_ce_7.xml], [nlon=[0:2];nlat=[(0.09):(-17.9)];temp[][] ], [vol_1_ce_7.xml.vbs.1.trans_base], [pass]) From 87b0892e14377d8acad83b4697eb2c6680602716 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Tue, 30 Dec 2025 11:10:56 -0700 Subject: [PATCH 19/20] Added baselines... ;-) --- .../test_array_4.xml.vbs.1a.trans_base | 66 +++++++++++++++++++ .../test_array_4.xml.vbs.1x.trans_base | 65 ++++++++++++++++++ .../universal/vol_1_ce_7.xml.vbs.1.trans_base | 55 ++++++++++++++++ 3 files changed, 186 insertions(+) create mode 100644 tests/dmr-testsuite/universal/test_array_4.xml.vbs.1a.trans_base create mode 100644 tests/dmr-testsuite/universal/test_array_4.xml.vbs.1x.trans_base create mode 100644 tests/dmr-testsuite/universal/vol_1_ce_7.xml.vbs.1.trans_base diff --git a/tests/dmr-testsuite/universal/test_array_4.xml.vbs.1a.trans_base b/tests/dmr-testsuite/universal/test_array_4.xml.vbs.1a.trans_base new file mode 100644 index 000000000..de45dcfdc --- /dev/null +++ b/tests/dmr-testsuite/universal/test_array_4.xml.vbs.1a.trans_base @@ -0,0 +1,66 @@ +Parse successful + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + removed checksum + + + + +The data: +{ {{255}} } diff --git a/tests/dmr-testsuite/universal/test_array_4.xml.vbs.1x.trans_base b/tests/dmr-testsuite/universal/test_array_4.xml.vbs.1x.trans_base new file mode 100644 index 000000000..62ac525b3 --- /dev/null +++ b/tests/dmr-testsuite/universal/test_array_4.xml.vbs.1x.trans_base @@ -0,0 +1,65 @@ +Parse successful + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + removed checksum + + + + +The data: +{ {{123456789, 123456789, 123456789, 123456789, 123456789}} } diff --git a/tests/dmr-testsuite/universal/vol_1_ce_7.xml.vbs.1.trans_base b/tests/dmr-testsuite/universal/vol_1_ce_7.xml.vbs.1.trans_base new file mode 100644 index 000000000..6ee70ebbd --- /dev/null +++ b/tests/dmr-testsuite/universal/vol_1_ce_7.xml.vbs.1.trans_base @@ -0,0 +1,55 @@ +Parse successful + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + removed checksum + + + + + + +The data: +{ {{99.999},{99.999},{99.999}} } From d37416501c5ef44d4000bca07c63388f15b2398c Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Wed, 28 Jan 2026 15:52:44 -0700 Subject: [PATCH 20/20] Updated baselines for 9 tests - new dmrVersion number. --- .../universal/test_array_4.xml.vbs.1a.trans_base | 4 ++-- .../universal/test_array_4.xml.vbs.1x.trans_base | 4 ++-- tests/dmr-testsuite/universal/vol_1_ce_7.xml.vbs.1.trans_base | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/dmr-testsuite/universal/test_array_4.xml.vbs.1a.trans_base b/tests/dmr-testsuite/universal/test_array_4.xml.vbs.1a.trans_base index de45dcfdc..d81f2df0f 100644 --- a/tests/dmr-testsuite/universal/test_array_4.xml.vbs.1a.trans_base +++ b/tests/dmr-testsuite/universal/test_array_4.xml.vbs.1a.trans_base @@ -1,6 +1,6 @@ Parse successful - + @@ -50,7 +50,7 @@ Parse successful - + diff --git a/tests/dmr-testsuite/universal/test_array_4.xml.vbs.1x.trans_base b/tests/dmr-testsuite/universal/test_array_4.xml.vbs.1x.trans_base index 62ac525b3..ab780f820 100644 --- a/tests/dmr-testsuite/universal/test_array_4.xml.vbs.1x.trans_base +++ b/tests/dmr-testsuite/universal/test_array_4.xml.vbs.1x.trans_base @@ -1,6 +1,6 @@ Parse successful - + @@ -50,7 +50,7 @@ Parse successful - + diff --git a/tests/dmr-testsuite/universal/vol_1_ce_7.xml.vbs.1.trans_base b/tests/dmr-testsuite/universal/vol_1_ce_7.xml.vbs.1.trans_base index 6ee70ebbd..441e9102e 100644 --- a/tests/dmr-testsuite/universal/vol_1_ce_7.xml.vbs.1.trans_base +++ b/tests/dmr-testsuite/universal/vol_1_ce_7.xml.vbs.1.trans_base @@ -1,6 +1,6 @@ Parse successful - + @@ -37,7 +37,7 @@ Parse successful - +