This is an automated email from the ASF dual-hosted git repository.

baunsgaard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git


The following commit(s) were added to refs/heads/main by this push:
     new 64174bdf28 [MINOR] Test SliceLine as.frame
64174bdf28 is described below

commit 64174bdf284bd96431d1ce18ef383378e86b3192
Author: Sebastian Baunsgaard <[email protected]>
AuthorDate: Tue Jan 30 14:36:18 2024 +0100

    [MINOR] Test SliceLine as.frame
    
    Adds the test missing from commit:
    75cf454e282100be722a3dc9805d941dc16ee770
---
 .../frame/FrameMatrixCastingSliceLineTest.java     | 66 ++++++++++++++++++++++
 .../scripts/functions/frame/SliceLineFailCase.dml  | 31 ++++++++++
 2 files changed, 97 insertions(+)

diff --git 
a/src/test/java/org/apache/sysds/test/functions/frame/FrameMatrixCastingSliceLineTest.java
 
b/src/test/java/org/apache/sysds/test/functions/frame/FrameMatrixCastingSliceLineTest.java
new file mode 100644
index 0000000000..addb0313d2
--- /dev/null
+++ 
b/src/test/java/org/apache/sysds/test/functions/frame/FrameMatrixCastingSliceLineTest.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.sysds.test.functions.frame;
+
+import org.apache.sysds.common.Types.ExecMode;
+import org.apache.sysds.test.AutomatedTestBase;
+import org.apache.sysds.test.TestConfiguration;
+import org.apache.sysds.test.TestUtils;
+import org.junit.Test;
+
+public class FrameMatrixCastingSliceLineTest extends AutomatedTestBase {
+       private final static String TEST_DIR = "functions/frame/";
+       private final static String TEST_NAME1 = "SliceLineFailCase";
+       private final static String TEST_CLASS_DIR = TEST_DIR + 
FrameMatrixCastingTest.class.getSimpleName() + "/";
+
+       @Override
+       public void setUp() {
+               TestUtils.clearAssertionInformation();
+               addTestConfiguration(TEST_NAME1, new 
TestConfiguration(TEST_CLASS_DIR, TEST_NAME1, new String[] {"B"}));
+       }
+
+       @Test
+       public void runFrameCastingTest() {
+
+               ExecMode platformOld = rtplatform;
+               setOutputBuffering(true);
+               try {
+
+                       TestConfiguration config = 
getTestConfiguration(TEST_NAME1);
+                       loadTestConfiguration(config);
+
+                       String HOME = SCRIPT_DIR + TEST_DIR;
+                       fullDMLScriptName = HOME + TEST_NAME1 + ".dml";
+                       programArgs = new String[] {};
+
+                       // should not fail
+                       // this test does not verify behavior
+                       runTest(null);
+
+               }
+               catch(Exception ex) {
+                       throw new RuntimeException(ex);
+               }
+               finally {
+                       rtplatform = platformOld;
+               }
+       }
+
+}
diff --git a/src/test/scripts/functions/frame/SliceLineFailCase.dml 
b/src/test/scripts/functions/frame/SliceLineFailCase.dml
new file mode 100644
index 0000000000..54d5d987a0
--- /dev/null
+++ b/src/test/scripts/functions/frame/SliceLineFailCase.dml
@@ -0,0 +1,31 @@
+
+#-------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#-------------------------------------------------------------
+
+k = ifdef($k, 5)
+paq = ifdef($paq, 1)
+X = round(rand(rows = 50, cols = 10, min=1, max=10))
+y = X %*% rand(rows = ncol(X), cols = 1)
+w = lm(X = X, y = y)
+yhat = X %*% w
+ress = slicefinder(X = X, e = abs(y - yhat), k = k, maxL = 0, minSup =
+1, alpha = 1, selFeat = TRUE, verbose = TRUE)
+print(toString(ress))

Reply via email to