Skip to content

Commit

Permalink
more filters.python test churn
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Jun 19, 2017
1 parent a644409 commit a6bf6a1
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion plugins/python/test/PythonFilterTest.cpp
Expand Up @@ -918,7 +918,7 @@ TEST(PLangTest, log)

reader.setOptions(reader_opts);

Stage* xfilter(f.createStage("filters.programmable"));
Stage* xfilter(f.createStage("filters.python"));
xfilter->setOptions(xfilter_opts);
xfilter->setInput(reader);

Expand Down
2 changes: 1 addition & 1 deletion test/data/pipeline/crop_wkt_2d_classification.json.in
Expand Up @@ -7,7 +7,7 @@
"outside":false
},
{
"type":"filters.predicate",
"type":"filters.python",
"function":"filter",
"source":"import numpy as np\n\ndef filter(ins,outs):\n\tcls = ins['Classification']\n\n\tkeep_classes = [1,2]\n\n\t# Use the first test for our base array.\n\tkeep = np.equal(cls, keep_classes[0])\n\n\t# For 1:n, test each predicate and join back\n\t# to our existing predicate array\n\tfor k in range(1,len(keep_classes)):\n\t\tt = np.equal(cls, keep_classes[k])\n\t\tkeep = keep + t\n\n\touts['Mask'] = keep\n\treturn True",
"module":"anything"
Expand Down
2 changes: 1 addition & 1 deletion test/data/pipeline/from-module.json.in
Expand Up @@ -2,7 +2,7 @@
"pipeline":[
"@CMAKE_SOURCE_DIR@/test/data/las/1.2-with-color.las",
{
"type": "filters.predicate",
"type": "filters.python",
"script": "@CMAKE_SOURCE_DIR@/test/data/plang/test1.py",
"module": "anything",
"function": "fff"
Expand Down
2 changes: 1 addition & 1 deletion test/data/pipeline/predicate-embed.json.in
Expand Up @@ -2,7 +2,7 @@
"pipeline":[
"@CMAKE_SOURCE_DIR@/test/data/las/1.2-with-color.las",
{
"type":"filters.predicate",
"type":"filters.python",
"module":"anything",
"function":"fff",
"source":"import numpy as np\ndef fff(ins,outs):\n\tX = ins['X']\n\tResult = np.equal(X, 637501.67)\n\t#print X\n\t#print Mask\n\touts['Mask'] = Result\n\treturn True"
Expand Down
Expand Up @@ -2,7 +2,7 @@
"pipeline":[
"@CMAKE_SOURCE_DIR@/test/data/autzen/autzen.las",
{
"type":"filters.predicate",
"type":"filters.python",
"module":"anything",
"function":"filter",
"source":"import numpy as np\n\ndef filter(ins,outs):\n\tcls = ins['Classification']\n\n\tkeep_classes = [1,2]\n\n\t# Use the first test for our base array.\n\tkeep = np.equal(cls, keep_classes[0])\n\n\t# For 1:n, test each predicate and join back\n\t# to our existing predicate array\n\tfor k in range(1,len(keep_classes)):\n\t\tt = np.equal(cls, keep_classes[k])\n\t\tkeep = keep + t\n\n\touts['Mask'] = keep\n\treturn True"
Expand Down
2 changes: 1 addition & 1 deletion test/data/pipeline/predicate-keep-last-return.json.in
Expand Up @@ -5,7 +5,7 @@
"type":"filters.stats"
},
{
"type":"filters.predicate",
"type":"filters.python",
"module":"anything",
"function":"filter",
"source":"import numpy as np\n\ndef filter(ins,outs):\n\tret = ins['ReturnNumber']\n\tret_no = ins['NumberOfReturns']\n\n\t# Use the first test for our base array.\n\trets = np.equal(ret, ret_no)\n\n\touts['Mask'] = rets\n\treturn True"
Expand Down
Expand Up @@ -2,7 +2,7 @@
"pipeline":[
"@CMAKE_SOURCE_DIR@/test/data/autzen/autzen.las",
{
"type":"filters.predicate",
"type":"filters.python",
"module":"anything",
"function":"filter",
"source":"import numpy as np\n\ndef filter(ins,outs):\n\tret = ins['ReturnNumber']\n\n\tkeep_ret = [0, 1,2]\n\n\t# Use the first test for our base array.\n\tkeep = np.equal(ret, keep_ret[0])\n\n\t# For 1:n, test each predicate and join back\n\t# to our existing predicate array\n\tfor k in range(1, len(keep_ret)):\n\t\tt = np.equal(ret, keep_ret[k])\n\t\tkeep = keep + t\n\n\touts['Mask'] = keep\n\treturn True"
Expand Down
2 changes: 1 addition & 1 deletion test/data/pipeline/programmable-update-y-dims.json.in
Expand Up @@ -2,7 +2,7 @@
"pipeline":[
"@CMAKE_SOURCE_DIR@/test/data/autzen/autzen-utm.las",
{
"type":"filters.programmable",
"type":"filters.python",
"function":"myfunc",
"module":"derive",
"source":"import numpy as np\ndef myfunc(ins,outs):\n\tX = ins['Y']\n\tX1 = np.zeros(X.size, dtype=type(X[0])) + 314\n\touts['Y'] = X1\n\treturn True"
Expand Down
2 changes: 1 addition & 1 deletion test/data/pipeline/reproject.json.in
Expand Up @@ -5,7 +5,7 @@
"spatialreference":"EPSG:2993"
},
{
"type":"filters.predicate",
"type":"filters.python",
"function":"filter",
"source":"import numpy as np\n\ndef filter(ins,outs):\n\tcls = ins['Classification']\n\n\tkeep_classes = [1]\n\n\t# Use the first test for our base array.\n\tkeep = np.equal(cls, keep_classes[0])\n\n\t# For 1:n, test each predicate and join back\n\t# to our existing predicate array\n\tfor k in range(1,len(keep_classes)):\n\t\tt = np.equal(cls, keep_classes[k])\n\t\tkeep = keep + t\n\n\touts['Mask'] = keep\n\treturn True",
"module":"anything"
Expand Down

0 comments on commit a6bf6a1

Please sign in to comment.