From c9701c1a009baf48a27b7547a3b6fe98b1bdfe57 Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Tue, 26 Oct 2021 21:44:38 -0700 Subject: [PATCH 1/2] Fixed {{list_to_matrix}} link. --- linalg.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linalg.scad b/linalg.scad index 66d440a..ae7f7a4 100644 --- a/linalg.scad +++ b/linalg.scad @@ -321,7 +321,7 @@ function submatrix_set(M,A,m=0,n=0) = // Description: // Constructs a matrix by horizontally "stacking" together compatible matrices or vectors. Vectors are treated as columsn in the stack. // This command is the inverse of `column`. Note: strings given in vectors are broken apart into lists of characters. Strings given -// in matrices are preserved as strings. If you need to combine vectors of strings use {{list_to_matrix}} as shown below to convert the +// in matrices are preserved as strings. If you need to combine vectors of strings use {{list_to_matrix()}} as shown below to convert the // vector into a column matrix. Also note that vertical stacking can be done directly with concat. // Arguments: // M1 = If given with other arguments, the first matrix (or vector) to stack. If given alone, a list of matrices/vectors to stack. From ce587b9ad700678985afcceecc53590ed3555968 Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Tue, 26 Oct 2021 22:30:42 -0700 Subject: [PATCH 2/2] Added test-file mismatch warnings to func_coverage.py --- scripts/func_coverage.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/func_coverage.py b/scripts/func_coverage.py index 85d0a7b..702d436 100755 --- a/scripts/func_coverage.py +++ b/scripts/func_coverage.py @@ -14,24 +14,27 @@ for filename in os.listdir("."): if funcname.startswith("_"): continue if funcname in funcs: - print("WARNING!!! Function {} re-defined at {}:{}".format(funcname, filename, linenum)); + print("WARNING!!! Function {} re-defined at {}:{}".format(funcname, filename, linenum+1)); print(" Previously defined at {}:{}".format(*funcs[funcname])); else: - funcs[funcname] = (filename, linenum) + funcs[funcname] = (filename, linenum+1) -covered = [] +covered = {} uncovered = funcs.copy() for filename in os.listdir("tests"): if filename.startswith("test_") and filename.endswith(".scad"): filepath = os.path.join("tests",filename) with open(filepath, "r") as f: - for line in f.readlines(): + for linenum,line in enumerate(f.readlines()): if line.startswith("module "): testmodule = line[7:].strip().split("(")[0].strip() if testmodule.startswith("test_"): funcname = testmodule.split("_",1)[1] if funcname in uncovered: - covered.append(funcname) + if filename != "test_" + uncovered[funcname][0]: + print("WARNING!!! Function {} defined at {}:{}".format(funcname, *uncovered[funcname])); + print(" but tested at {}:{}".format(filename, linenum+1)); + covered[funcname] = (filename,linenum+1) del uncovered[funcname] uncovered_by_file = {}