Skip to content

Commit 294fb4c

Browse files
gaynor@illinois.edugaynor@illinois.edu
authored andcommitted
Last couple of tests, removed a ton of print statements for debugging.
1 parent 21a24a4 commit 294fb4c

5 files changed

Lines changed: 87 additions & 82 deletions

File tree

.idea/workspace.xml

Lines changed: 42 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ncsa-qdl/buildNumber.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#maven.buildNumber.plugin properties file
2-
#Tue Jul 19 12:43:10 CDT 2022
3-
buildNumber\\d*=9747
2+
#Wed Jul 20 16:32:48 CDT 2022
3+
buildNumber\\d*=9759

ncsa-qdl/src/main/docs/iso6429.odt

1 Byte
Binary file not shown.

ncsa-qdl/src/main/java/edu/uiuc/ncsa/qdl/expressions/StemExtractionNode.java

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -285,22 +285,22 @@ protected Object recurse(QDLStem in, IndexArgs sourceIndices) {
285285
otherOut = recurse((QDLStem) value, out, indexList, sourceIndices, startIndex + 1, 0L);
286286
} else {
287287
if (indexArgs.size() - 1 == startIndex) {
288-
System.out.println("recurse: last args index size =" + (indexArgs.size() - 1));
288+
// System.out.println("recurse: last args index size =" + (indexArgs.size() - 1));
289289
// set the value, but only if it is the end of an index list (so there
290290
// are no more indices to traverse.
291291
if (root.isWildcard()) {
292-
System.out.println(" set wildcard key=" + key + ", value=" + value);
292+
// System.out.println(" set wildcard key=" + key + ", value=" + value);
293293
out.putLongOrString(key, value);
294294
} else {
295295
if (Constant.isScalar(root.swri.getResult())) {
296-
System.out.println(" return value=" + value);
296+
// System.out.println(" return value=" + value);
297297
return value;
298298
} else {
299299
if (root.strictOrder || (key instanceof String)) {
300-
System.out.println(" put key=" + key + ", value=" + value);
300+
// System.out.println(" put key=" + key + ", value=" + value);
301301
out.putLongOrString(key, value);
302302
} else {
303-
System.out.println(" autoindex put key=" + key + ", value=" + value);
303+
// System.out.println(" autoindex put key=" + key + ", value=" + value);
304304
out.put(autoIndex++, value);
305305
}
306306
}
@@ -326,21 +326,20 @@ protected Object recurse(QDLStem in,
326326
long strictIndex) {
327327

328328
if (sourceIndices.size() <= indexLocation) {
329-
System.out.println("*** recurseNEW: " +
329+
/* System.out.println("*** recurseNEW: " +
330330
"\n in=" + in +
331331
"\n out=" + out +
332332
"\n targetIndex = " + targetIndex +
333333
"\n sourceIndices = " + sourceIndices +
334334
"\n loc=" + indexLocation +
335335
"\n strictIndex=" + strictIndex
336-
);
336+
);*/
337337
IndexArg lastIndex = sourceIndices.get(indexLocation - 1);
338338
if (Constant.isScalar(lastIndex.swri.getResult())) {
339-
System.out.println(" recurseNEW: adding all inStem");
339+
//System.out.println(" recurseNEW: adding all inStem");
340340
out.addAll(in);
341341
} else {
342-
System.out.println(" recurseNEW: strict add inStem");
343-
342+
//System.out.println(" recurseNEW: strict add inStem");
344343
out.putLongOrString(strictIndex, in);
345344
}
346345
return out;
@@ -382,7 +381,7 @@ protected Object recurse(QDLStem in,
382381
}
383382
out.set(indexList, value);
384383
}
385-
System.out.println(" recurseNEW: setting value key =" + indexList + ", value = " + value);
384+
//System.out.println(" recurseNEW: setting value key =" + indexList + ", value = " + value);
386385
}else{
387386
if (value instanceof QDLStem) {
388387
IndexList indexList = targetIndex.clone();
@@ -422,24 +421,12 @@ protected Object recurse(QDLStem in,
422421

423422

424423
/*
425-
a. := n(3,4,5,n(3*4*5))
426-
a\[;2]\![3,1]
427-
428-
expected:
429-
b.0.3 == a.0.3; b.0.1 := a.0.1
430-
b.1.3 == a.1.3; b.1.1 := a.1.1
431424
432-
a\[;2]\[3,1]
433-
expected:
434-
b.0.0 := a.0.3; b.0.1 == a.0.1;
435-
b.1.0 := a.1.3; b.1.1 == a.1.1
425+
a. := n(5,5,[;25])~ {'p':{'t':'a', 'u':'b', 'v':'c'}, 'q':{'t':'d', 'u':'e', 'v':'f'}, 'r':{'t':'g', 'u':'h', 'v':'i'}}
426+
a\[1,2,'p']\[3,'t','q',1]
427+
{0:[8,6], 1:[13,11], p:{t:a}}
436428
437-
a.:=[[0,1,2,3,4],[5,6,7,8,9],[10,11,12,13,14],[15,16,17,18,19],[20,21,22,23,24]]~{'p':{'t':'a', 'u':'b', 'v':'c'}, 'q':{'t':'d', 'u':'e', 'v':'f'}, 'r':{'t':'g', 'u':'h', 'v':'i'}}
438429
439-
a.:=n(5,5,n(25))
440-
m_set(x., y., z.)->local[while[k∈[;size(y.)]][x.y.k :=z.k];return(x.);]
441-
[[p,t],[p,u],[p,v],[q,t],[q,u],[q,v],[r,t],[r,u],[r,v]]
442-
m_indices(
443430
*/
444431

445432
/**

ncsa-qdl/src/test/java/edu/uiuc/ncsa/qdl/StemTest.java

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2579,15 +2579,40 @@ public void testExtractionStemKey() throws Throwable {
25792579
assert getBooleanValue("okw2", state) : "(w\\0\\i.).'Communities:LSCVirgoLIGOGroupMembers'.0 == 'read:/DQSegDB' failed";
25802580
}
25812581

2582+
/*
2583+
a. := n(5,5,[;25])~ {'p':{'t':'a', 'u':'b', 'v':'c'}, 'q':{'t':'d', 'u':'e', 'v':'f'}, 'r':{'t':'g', 'u':'h', 'v':'i'}}
2584+
a\[1,2,'p']\[3,'t','q',1]
2585+
{0:[8,6], 1:[13,11], p:{t:a}}
2586+
*/
2587+
2588+
/**
2589+
* Test mixed data extraction with some gaps.
2590+
* @throws Throwable
2591+
*/
2592+
public void testMixedExtraction3() throws Throwable {
2593+
2594+
State state = testUtils.getNewState();
2595+
StringBuffer script = new StringBuffer();
2596+
addLine(script, "a. := n(5,5,[;25])~ {'p':{'t':'a', 'u':'b', 'v':'c'}, 'q':{'t':'d', 'u':'e', 'v':'f'}, 'r':{'t':'g', 'u':'h', 'v':'i'}};");
2597+
addLine(script, "b. := a\\[1,2,'p']\\[3,'t','q',1];");
2598+
addLine(script, "ok := b.0.0 == 8 && b.0.1 == 6 && b.1.0 == 13 && b.1.1 == 11 && b.p.t=='a';");
2599+
addLine(script, "ok := size(b.)==3 && ok;");
2600+
2601+
2602+
QDLInterpreter interpreter = new QDLInterpreter(null, state);
2603+
interpreter.execute(script.toString());
2604+
assert getBooleanValue("ok", state) : "testing ever element in an extraction failed failed";
2605+
}
2606+
2607+
25822608
}
25832609
/*
2584-
zeta.'Communities:LSCVirgoLIGOGroupMembers' := ['read:/DQSegDB' ,'read:/frames', 'read:/GraceDB'];
2610+
zeta.'Communities:LSCVirgoLIGOGroupMembers' := ['read:/DQSegDB' ,'read:/frames', 'read:/GraceDB'];
25852611
zeta.'Communities:LVC:SegDB:SegDBWriter' := 'write:/DQSegDB';
25862612
zeta.'gw-astronomy:KAGRA-LIGO:members' := ['read:/GraceDB', 'read:/frames'];
25872613
g. := [{'name': 'Services:MailingLists:Testing:eligible_factor'},{'name': 'Communities:LSCVirgoLIGOGroupMembers'},{'name':'Communities:LVC:SegDB:SegDBWriter'}]
2588-
~values(mask(zeta., in_group2(keys(zeta.),g.)))
2589-
[write:/DQSegDB,read:/frames,read:/DQSegDB,read:/GraceDB]
2590-
zeta\(g\*\name)
2591-
[write:/DQSegDB]
2614+
i. := g\*\name
2615+
w.0 := zeta.
2616+
w\0\i.
25922617
*/
25932618

0 commit comments

Comments
 (0)