Skip to content

Commit

Permalink
clip: Throw an exception if min > max #472
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Oct 25, 2023
1 parent c2d77e2 commit 4c29a0c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 32 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased / Draft

### Changed

- `clip`: Throw an exception if min > max [#472](https://github.com/Open-EO/openeo-processes/issues/472)

## [2.0.0-rc.1] - 2023-05-25

### Added
Expand Down
40 changes: 8 additions & 32 deletions clip.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "clip",
"summary": "Clip a value between a minimum and a maximum",
"description": "Clips a number between specified minimum and maximum values. A value larger than the maximum value is set to the maximum value, a value lower than the minimum value is set to the minimum value.\n\nThe no-data value `null` is passed through and therefore gets propagated.",
"description": "Clips a number between specified minimum and maximum values. A value larger than the maximum value is set to the maximum value, a value lower than the minimum value is set to the minimum value. If the maximum value is smaller than the minimum number, the process throws a `MinMaxSwapped` exception.\n\nThe no-data value `null` is passed through and therefore gets propagated.",
"categories": [
"math"
],
Expand Down Expand Up @@ -40,6 +40,11 @@
]
}
},
"exceptions": {
"MinMaxSwapped": {
"message": "The minimum value should be lower than or equal to the maximum value."
}
},
"examples": [
{
"arguments": {
Expand Down Expand Up @@ -73,34 +78,5 @@
},
"returns": null
}
],
"process_graph": {
"min": {
"process_id": "min",
"arguments": {
"data": [
{
"from_parameter": "max"
},
{
"from_parameter": "x"
}
]
}
},
"max": {
"process_id": "max",
"arguments": {
"data": [
{
"from_parameter": "min"
},
{
"from_node": "min"
}
]
},
"result": true
}
}
}
]
}

0 comments on commit 4c29a0c

Please sign in to comment.