Skip to content

Commit

Permalink
Added process graphs that can be described with other processes. #137
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Jan 29, 2020
1 parent f7d466d commit 0a7d666
Show file tree
Hide file tree
Showing 21 changed files with 656 additions and 27 deletions.
23 changes: 22 additions & 1 deletion absolute.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,26 @@
"href": "http://mathworld.wolfram.com/AbsoluteValue.html",
"title": "Absolute value explained by Wolfram MathWorld"
}
]
],
"process_graph": {
"power2": {
"process_id": "power",
"arguments": {
"base": {
"from_parameter": "x"
},
"p": 2
}
},
"power05": {
"process_id": "power",
"arguments": {
"base": {
"from_node": "power2"
},
"p": 0.5
},
"result": true
}
}
}
19 changes: 18 additions & 1 deletion add.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,22 @@
"href": "https://ieeexplore.ieee.org/document/8766229",
"title": "IEEE Standard 754-2019 for Floating-Point Arithmetic"
}
]
],
"process_graph": {
"sum": {
"process_id": "sum",
"arguments": {
"data": [
{
"from_parameter": "x"
},
{
"from_parameter": "y"
}
],
"ignore_nodata": false
},
"result": true
}
}
}
19 changes: 18 additions & 1 deletion and.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,22 @@
},
"returns": null
}
]
],
"process_graph": {
"all": {
"process_id": "all",
"arguments": {
"data": [
{
"from_parameter": "x"
},
{
"from_parameter": "y"
}
],
"ignore_nodata": false
},
"result": true
}
}
}
32 changes: 31 additions & 1 deletion array_contains.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,35 @@
},
"returns": false
}
]
],
"process_graph": {
"find": {
"process_id": "array_find",
"arguments": {
"data": {
"from_parameter": "data"
},
"value": {
"from_parameter": "value"
}
}
},
"is_nodata": {
"process_id": "is_nodata",
"arguments": {
"x": {
"from_node": "find"
}
}
},
"not": {
"process_id": "not",
"arguments": {
"x": {
"from_node": "is_nodata"
}
},
"result": true
}
}
}
65 changes: 63 additions & 2 deletions between.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "between",
"summary": "Between comparison",
"description": "By default this process checks whether `x` is greater than or equal to `min` and lower than or equal to `max`. Therefore, this process is an alias for `and([gte(x, min), lte(x, max)])` and all definitions from ``and()``, ``gte()`` and ``lte()`` apply here as well.\n\nIf `exclude_max` is set to `true` the upper bound is excluded so that the process checks whether `x` is greater than or equal to `min` and lower than `max`. In this case the process works the same as executing `and([gte(x, min), lt(x, max)])`.\n\nLower and upper bounds are not allowed to be swapped. So `min` MUST be lower than or equal to `max` or otherwise the process always returns `false`.",
"description": "By default this process checks whether `x` is greater than or equal to `min` and lower than or equal to `max`, which is the same es computing `and(gte(x, min), lte(x, max))`. Therefore, all definitions from ``and()``, ``gte()`` and ``lte()`` apply here as well.\n\nIf `exclude_max` is set to `true` the upper bound is excluded so that the process checks whether `x` is greater than or equal to `min` and lower than `max`. In this case the process works the same as computing `and(gte(x, min), lt(x, max))`.\n\nLower and upper bounds are not allowed to be swapped. So `min` MUST be lower than or equal to `max` or otherwise the process always returns `false`.",
"categories": [
"comparison"
],
Expand Down Expand Up @@ -164,5 +164,66 @@
},
"returns": false
}
]
],
"process_graph": {
"gte": {
"process_id": "gte",
"arguments": {
"x": {
"from_parameter": "x"
},
"y": {
"from_parameter": "min"
}
}
},
"lte": {
"process_id": "lte",
"arguments": {
"x": {
"from_parameter": "x"
},
"y": {
"from_parameter": "max"
}
}
},
"lt": {
"process_id": "lt",
"arguments": {
"x": {
"from_parameter": "x"
},
"y": {
"from_parameter": "max"
}
}
},
"if": {
"process_id": "if",
"arguments": {
"value": {
"from_parameter": "exclude_max"
},
"accept": {
"from_node": "lte"
},
"reject": {
"from_node": "lt"
}
}
},
"and": {
"process_id": "and",
"arguments": {
"x": {
"from_node": "gte"
},
"y": {
"from_node": "if"
}
},
"result": true
}
}
}
33 changes: 32 additions & 1 deletion clip.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,36 @@
},
"returns": null
}
]
],
"process_graph": {
"min": {
"process_id": "min",
"arguments": {
"data": [
{
"from_parameter": "max"
},
{
"from_parameter": "x"
}
],
"ignore_nodata": false
}
},
"max": {
"process_id": "max",
"arguments": {
"data": [
{
"from_parameter": "min"
},
{
"from_node": "min"
}
],
"ignore_nodata": false
},
"result": true
}
}
}
22 changes: 20 additions & 2 deletions exp.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "exp",
"summary": "Exponentiation to the base e",
"description": "Exponential function to the base *e* raised to the power of `p`. This process is an alias for *e^p^* / `power(e(), p)`.\n\nThe no-data value `null` is passed through and therefore gets propagated.",
"description": "Exponential function to the base *e* raised to the power of `p`.\n\nThe no-data value `null` is passed through and therefore gets propagated.",
"categories": [
"math > exponential & logarithmic"
],
Expand Down Expand Up @@ -46,5 +46,23 @@
"href": "http://mathworld.wolfram.com/ExponentialFunction.html",
"title": "Exponential function explained by Wolfram MathWorld"
}
]
],
"process_graph": {
"e": {
"process_id": "e",
"arguments": {}
},
"power": {
"process_id": "power",
"arguments": {
"base": {
"from_node": "e"
},
"p": {
"from_parameter": "p"
}
},
"result": true
}
}
}
38 changes: 37 additions & 1 deletion gte.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,41 @@
},
"returns": false
}
]
],
"process_graph": {
"eq": {
"process_id": "eq",
"arguments": {
"x": {
"from_parameter": "x"
},
"y": {
"from_parameter": "y"
}
}
},
"gt": {
"process_id": "gt",
"arguments": {
"x": {
"from_parameter": "x"
},
"y": {
"from_parameter": "y"
}
}
},
"or": {
"process_id": "or",
"arguments": {
"x": {
"from_node": "gt"
},
"y": {
"from_node": "eq"
}
},
"result": true
}
}
}
71 changes: 70 additions & 1 deletion linear_scale_range.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,74 @@
},
"returns": null
}
]
],
"process_graph": {
"subtract1": {
"process_id": "subtract",
"arguments": {
"x": {
"from_parameter": "x"
},
"y": {
"from_parameter": "inputMin"
}
}
},
"subtract2": {
"process_id": "subtract",
"arguments": {
"x": {
"from_parameter": "inputMax"
},
"y": {
"from_parameter": "inputMin"
}
}
},
"subtract3": {
"process_id": "subtract",
"arguments": {
"x": {
"from_parameter": "outputMax"
},
"y": {
"from_parameter": "outputMin"
}
}
},
"divide": {
"process_id": "divide",
"arguments": {
"x": {
"from_node": "subtract1"
},
"y": {
"from_node": "subtract2"
}
}
},
"multiply": {
"process_id": "multiply",
"arguments": {
"x": {
"from_node": "divide"
},
"y": {
"from_node": "subtract3"
}
}
},
"add": {
"process_id": "add",
"arguments": {
"x": {
"from_node": "multiply"
},
"y": {
"from_parameter": "outputMin"
}
},
"result": true
}
}
}
Loading

0 comments on commit 0a7d666

Please sign in to comment.