From 4268a4c8af3ba34a877371bc1d087cb9051a2190 Mon Sep 17 00:00:00 2001 From: Webb Scales Date: Wed, 6 Mar 2024 11:28:47 -0500 Subject: [PATCH] More review feedback --- docs/arcaflow/workflows/expressions.md | 42 +++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/arcaflow/workflows/expressions.md b/docs/arcaflow/workflows/expressions.md index 06a5eea5..a859a776 100644 --- a/docs/arcaflow/workflows/expressions.md +++ b/docs/arcaflow/workflows/expressions.md @@ -97,9 +97,9 @@ some_value_2: !expr |- in the expression value; the other quotes are escaped to prevent them from ending the string prematurely; the double quotes in `some_value_1` do not need to be escaped nor do the single quotes in `some_value_2`. -See [Raw String](#raw-string-values) to see how to do this without escaping. +See [Raw string values](#raw-string-values) to see how to do this without escaping. -### Raw String values +### Raw string values Raw string literals start and end with backtick characters "`". @@ -239,24 +239,24 @@ available from operators. Functions: -| function definition | return type | description | -|--------------------------------------------------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `intToFloat(integer)` | float | Converts an integer value into the equivalent floating point value. | -| `floatToInt(float)` | integer | Converts a floating point value into an integer value by discarding the fraction, rounding toward zero to the nearest integer.
Special cases:
  +Inf yields the maximum 64-bit integer (9223372036854775807)
  -Inf and NaN yield the minimum 64-bit integer (-9223372036854775808)\n\n"

For example, `5.5` yields `5`, and `-1.9` yields `-1`" | -| `intToString(integer)` | string | Returns a string containing the base-10 representation of the input.

For example, an input of `55` yields `"55"` | -| `floatToString(float)` | string | Returns a string containing the base-10 representation of the input.

For example, an input of `5000.5` yields `"5000.5"` | -| `floatToFormattedString(float, string, integer)` | string | Returns a string containing the input formatted according to the specified formatting directive and precision.
  Param 1: the floating point value to convert
  Param 2: the format specifier: 'e', 'E', 'f', 'g', 'G'
  Param 3: the number of digits

Specifying -1 for the precision will produce the minimum number of digits required to represent the value exactly.
(See the [Go runtime documentation](https://pkg.go.dev/strconv@go1.22.0#FormatFloat) for details.) | -| `boolToString(boolean)` | string | Returns `"true"` for `true`, and `"false"` for `false`. | -| `stringToInt(string)` | integer | Interprets the string as a base-10 integer. Returns an error if the input is not a valid integer. | -| `stringToFloat(string)` | float | Converts the input string to a double-precision floating-point number.

Accepts floating-point numbers as defined by the [Go syntax for floating point literals](https://go.dev/ref/spec#Floating-point_literals). If the input is well-formed and near a valid floating-point number, returns the nearest floating-point number rounded using IEEE754 unbiased rounding.
Returns an error when an invalid input is received. | -| `stringToBool(string)` | boolean | Interprets the input as a boolean.
Accepts `"1"`, `"t"`, and `"true"` as `true` and `"0"`, `"f"`, and `"false"` as `false` (case is not significant).
Returns an error for any other input. | -| `ceil(float)` | float | Returns the least integer value greater than or equal to the input.

For example `ceil(1.5)` yields `2.0`, and `ceil(-1.5)` yields `-1.0`
Special cases are:
  ceil(±0.0) = ±0.0
  ceil(±Inf) = ±Inf
  ceil(NaN) = NaN | -| `floor(float)` | float | Returns the greatest integer value less than or equal to the input.

For example `floor(1.5)` yields `1.0`, and `floor(-1.5)` yields `-2.0`
Special cases are:
  floor(±0.0) = ±0.0
  floor(±Inf) = ±Inf
  floor(NaN) = NaN | -| `round(float)` | float | Returns the nearest integer to the input, rounding half away from zero.

For example `round(1.5)` yields `2.0`, and `round(-1.5)` yields `-2.0`
Special cases are:
  round(±0.0) = ±0.0
  round(±Inf) = ±Inf
  round(NaN) = NaN | -| `abs(float)` | float | Returns the absolute value of the input.
Special cases are:
  abs(±Inf) = +Inf
  abs(NaN) = NaN | -| `toLower(string)` | string | Returns the input with Unicode letters mapped to their lower case. | -| `toUpper(string)` | string | Returns the input with Unicode letters mapped to their upper case. | -| `splitString(string, string)` | list[string] | Returns a list of the substrings which appear between instances of the specified separator; the separator instances are not included in the resulting list elements; adjacent occurrences of separator instances as well as instances appearing at the beginning or ending of the input will produce empty string list elements.
  Param 1: The string to split.
  Param 2: The separator. | +| function definition | return type | description | +|--------------------------------------------------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `intToFloat(integer)` | float | Converts an integer value into the equivalent floating point value. | +| `floatToInt(float)` | integer | Converts a floating point value into an integer value by discarding the fraction, rounding toward zero to the nearest integer.
Special cases:
  +Inf yields the maximum 64-bit integer (9223372036854775807)
  -Inf and NaN yield the minimum 64-bit integer (-9223372036854775808)\n\n"

For example, `5.5` yields `5`, and `-1.9` yields `-1` | +| `intToString(integer)` | string | Returns a string containing the base-10 representation of the input.

For example, an input of `55` yields `"55"` | +| `floatToString(float)` | string | Returns a string containing the base-10 representation of the input.

For example, an input of `5000.5` yields `"5000.5"` | +| `floatToFormattedString(float, string, integer)` | string | Returns a string containing the input in the specified format with the specified precision.
  Param 1: the floating point input value
  Param 2: the format specifier: `"e"`, `"E"`, `"f"`, `"g"`, `"G"`
  Param 3: the number of digits

Specifying -1 for the precision will produce the minimum number of digits required to represent the value exactly.
(See the [Go runtime documentation](https://pkg.go.dev/strconv@go1.22.0#FormatFloat) for details.) | +| `boolToString(boolean)` | string | Returns `"true"` for `true`, and `"false"` for `false`. | +| `stringToInt(string)` | integer | Interprets the string as a base-10 integer. Returns an error if the input is not a valid integer. | +| `stringToFloat(string)` | float | Converts the input string to a double-precision floating-point number.

Accepts floating-point numbers as defined by the [Go syntax for floating point literals](https://go.dev/ref/spec#Floating-point_literals). If the input is well-formed and near a valid floating-point number, returns the nearest floating-point number rounded using IEEE754 unbiased rounding.
Returns an error when an invalid input is received. | +| `stringToBool(string)` | boolean | Interprets the input as a boolean.
Accepts `"1"`, `"t"`, and `"true"` as `true` and `"0"`, `"f"`, and `"false"` as `false` (case is not significant).
Returns an error for any other input. | +| `ceil(float)` | float | Returns the least integer value greater than or equal to the input.

For example `ceil(1.5)` yields `2.0`, and `ceil(-1.5)` yields `-1.0`
Special cases are:
  ceil(±0.0) = ±0.0
  ceil(±Inf) = ±Inf
  ceil(NaN) = NaN | +| `floor(float)` | float | Returns the greatest integer value less than or equal to the input.

For example `floor(1.5)` yields `1.0`, and `floor(-1.5)` yields `-2.0`
Special cases are:
  floor(±0.0) = ±0.0
  floor(±Inf) = ±Inf
  floor(NaN) = NaN | +| `round(float)` | float | Returns the nearest integer to the input, rounding half away from zero.

For example `round(1.5)` yields `2.0`, and `round(-1.5)` yields `-2.0`
Special cases are:
  round(±0.0) = ±0.0
  round(±Inf) = ±Inf
  round(NaN) = NaN | +| `abs(float)` | float | Returns the absolute value of the input.
Special cases are:
  abs(±Inf) = +Inf
  abs(NaN) = NaN | +| `toLower(string)` | string | Returns the input with Unicode letters mapped to their lower case. | +| `toUpper(string)` | string | Returns the input with Unicode letters mapped to their upper case. | +| `splitString(string, string)` | list[string] | Returns a list of the substrings which appear between instances of the specified separator; the separator instances are not included in the resulting list elements; adjacent occurrences of separator instances as well as instances appearing at the beginning or ending of the input will produce empty string list elements.
  Param 1: The string to split.
  Param 2: The separator. | A function is used in an expression by referencing its name followed by a comma-separated list of zero or more argument expressions enclosed in parentheses. @@ -474,7 +474,7 @@ Order (highest to lowest): ## Other information -More information on the expression language is available in the [development guide](/docs/arcaflow/contributing/expressions.md). +More information on the expression language is available in the [development guide](../contributing/expressions.md). ## Examples