Skip to content

Commit ffd628b

Browse files
authored
fix: Keep the trailing zeros of a floatstring range element (#345)
* fix: Keep the trailing zeros of a floatstring range element Review on #342 pointed out that the string form of a <FloatRangeList> element exists in order to carry the scale it was written with: a range element written '2.50' is asking for `2.50` on a command line, and a renderer handed `2.5` instead has been given a different string. It is also the only way a template can ask for a fixed number of decimal places, because a <float> literal of 2.50 is the same literal as 2.5 once parsed. #342 normalized the element to the number it denotes and threw that away. Split the two kinds of zero, which are not the same thing: - Leading zeros are not part of the number and still go. '02' on an INT range is the task value 2, and forwarding the text renders `--frame 02`. - Trailing zeros are the author's chosen scale and are kept. '02.50' renders `2.50`, not `2.5`. The already-landed conformance fixture EXPR/jobs/expr1.3.4--float-passthrough pins the same rule for a FLOAT parameter default, so both it and base/jobs/3.4.1.2 can now be right at once. openjd-specifications#180 states the rule as Template Schemas §7.5. A <floatstring> therefore renders as its own text less any redundant leading zeros, which is a substring operation rather than a numeric one. That is what removes the machinery the two preceding commits added, because every problem they were solving came from having to choose a notation in which to re-render a Decimal: - normalize() and quantize() round to getcontext().prec, so an embedding application's decimal context changed what this library rendered: measured, '1.2345678901234567890123456789012345678901' came back as '1.2346' under getcontext().prec = 5. - str(Decimal) switches to exponent notation once the adjusted exponent falls below -6, so '0.0000001' rendered 1E-7. - format(value, 'f') is exact and plain at every magnitude but unbounded in the exponent, so '1e999999999' -- 11 characters of template text -- expanded to ~10**9 characters and needed a length bound to stay safe. Text needs none of those decisions. '1e999999999' now costs its own 11 characters, so the exponent bound and its boundary cases are gone with it, and an element can no longer silently exceed TaskParameterStringValueAsJob's 1024-character cap and fall through to a numeric member of the union. An <intstring> is unaffected: int() already discards leading zeros and there are no fractional digits to preserve. Verification. Model suite 5527 -> 5529 passed, 24 skipped, 3 xfailed; ruff, black and mypy clean at the CI-pinned versions. Three mutants confirm the tests pin both halves of the rule: dropping the leading-zero strip fails 7 tests, restoring the trailing-zero strip fails 7, and dropping the int() conversion fails 3. Full 2023-09 conformance suite, run from source against openjd-cli mainline 7c7ece4 with openjd-sessions 0.10.14, on openjd-specifications#180's tree: 1162 passed, 0 failed. The baseline at e7a17b3 passes 1161 and fails only base/jobs/7.5--numeric-string-zeros-in-range-elements, so this closes that one fixture and moves nothing else. Both controls hold -- base/jobs/3.4--float-parameter and EXPR/jobs/expr1.3.4--float-passthrough. Relative to released 0.11.6 the only behaviour change here is the leading-zero trim: every element whose rendering differs from 0.11.6 differs by a removed leading zero. openjd-rs, which backs this package's `openjd.model._v1` API, needs the matching change; that is OpenJobDescription/openjd-rs#354. With both in place the two implementations render every range-element case tested identically, including the zero and exponent forms. Signed-off-by: David Leong <116610336+leongdl@users.noreply.github.com> * fix: trim a floatstring range element and unsign a zero Two review findings, both cases where the forwarded text did not match what openjd-rs renders for the same element. float() ignores surrounding whitespace but the regex does not, so ' 1.5 ' was forwarded with its spaces and reached a command line as --frame ' 1.5 '. openjd-rs trims the resolved element before keeping it; do the same here. Zero has no sign. '-0.0' rendered -0.0 here and 0.0 on mainline and in openjd-rs, which is the reading the deleted test pinned by name. Drop the sign without dropping the decimal places, so '-0.00' renders 0.00. Text that reaches zero only by underflow, like '1e-400', does not render the value and is not kept -- which also covers the huge negative exponents, since '1e-999999999' underflows to zero. Both now agree with openjd-rs#354 on every case measured: ' 1.5 '->1.5, '-0.0'->0.0, '-0.00'->0.00, '1e-400'->0.0, '5.'->5., '.5'->.5, '+2.50'->+2.50, '1E+2'->1E+2. Also soften a test comment that claimed an element can no longer exceed TaskParameterStringValueAsJob's cap and fall through to a numeric member of the union. That holds for the huge-exponent inputs the test parametrizes, but long literal text still can, on this branch and on mainline and 0.11.6 alike -- only the expansion is gone. Verification. Model suite 5533 passed, 24 skipped, 3 xfailed; ruff, black and mypy clean. Full 2023-09 conformance 1162 passed, 0 failed. Signed-off-by: David Leong <116610336+leongdl@users.noreply.github.com> * fix: decide a zero spelling from the text, not the parse Review found that testing `value == 0.0` discarded the digits of any value too small for a float. '0.' followed by 400 zeros and a 1 -- plain decimal text, exactly what a <floatstring> is for -- underflowed and rendered 0.0, silently a different number. The cutoff was an artifact of binary64 rather than anything in the template: 1e-320 is subnormal and survived, 1e-400 did not. Ask the text instead. An all-zero mantissa spells zero whatever the exponent, so '0.00', '-0.0' and '0e5' lose their sign and keep their digits, while '1e-400' and '0.000...1' keep both. Mirrors openjd_expr::value::text_spells_zero, so openjd-rs#354 renders every one of these identically. Verification. Model suite 5536 passed, 24 skipped, 3 xfailed; ruff, black and mypy clean. Full 2023-09 conformance 1162 passed, 0 failed. Signed-off-by: David Leong <116610336+leongdl@users.noreply.github.com> --------- Signed-off-by: David Leong <116610336+leongdl@users.noreply.github.com>
1 parent 262d3d2 commit ffd628b

3 files changed

Lines changed: 105 additions & 154 deletions

File tree

‎src/openjd/model/v2023_09/_model.py‎

Lines changed: 41 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,74 +1258,44 @@ def _validate_target_runtime_seconds(cls, value: Any, info: ValidationInfo) -> A
12581258
return validate_int_fmtstring_field(value, ge=0, context=context)
12591259

12601260

1261+
# '02.50' -> '2.50', '007' -> '7', '000' -> '0'. The lookahead leaves the last
1262+
# digit, so '0.50' keeps the zero that is its integer part.
1263+
_REDUNDANT_LEADING_ZEROS = re.compile(r"^([+-]?)0+(?=[0-9])")
1264+
1265+
# An all-zero mantissa, whatever the exponent: '0.00', '-0.0' and '0e5' spell zero,
1266+
# '1e-400' does not. Mirrors openjd_expr::value::text_spells_zero.
1267+
_SPELLS_ZERO = re.compile(r"^[+-]?[0.]*[0][0.]*(?:[eE][+-]?[0-9]+)?$")
1268+
1269+
1270+
def _spells_zero(text: str) -> bool:
1271+
return _SPELLS_ZERO.match(text) is not None
1272+
1273+
12611274
def _normalized_range_element(elem: str, to_int: bool) -> Any:
1262-
"""The number an ``<intstring>``/``<floatstring>`` range element denotes -- an
1263-
``int`` for ``<intstring>``, and for ``<floatstring>`` the plain-notation text
1264-
of the value, since ``str(Decimal)`` cannot render every magnitude without an
1265-
exponent. Returns the element unchanged when it does not denote a number, or
1266-
when its plain-notation form would not fit this field's character cap."""
1275+
"""The value an ``<intstring>``/``<floatstring>`` range element denotes.
1276+
1277+
An ``<intstring>`` becomes an ``int``. A ``<floatstring>`` keeps its text less
1278+
redundant leading zeros, so the decimal places it was written with survive
1279+
(§7.5). Returns the element unchanged when it does not denote a number.
1280+
"""
12671281
try:
12681282
if to_int:
1269-
return int(elem)
1270-
value = Decimal(elem)
1271-
if not value.is_finite():
1272-
# Decimal accepts 'nan'/'inf', which are not <floatstring>s; leave
1273-
# them as text rather than changing how they render.
1274-
return elem
1275-
# Bound the expansion from the exponent before performing it. Decimal
1276-
# construction from a string is unbounded -- the context's Emax/Emin
1277-
# constrain arithmetic results, not construction, so Decimal('1e999999999')
1278-
# is finite and the guard above does not stop it -- and the plain-notation
1279-
# length is linear in the exponent, so 11 characters of template text
1280-
# would otherwise materialize ~10**9 characters.
1281-
#
1282-
# The bound is the character cap this field already enforces, because an
1283-
# expansion past it cannot be carried here as text at all: the value is
1284-
# stored in a TaskRangeList element, whose str member is
1285-
# TaskParameterStringValueAsJob, and pydantic's union falls through to
1286-
# the numeric members instead, rendering the element as an integer, or as
1287-
# inf, or as 0.0. Such an element keeps its source text -- what this
1288-
# function already does for anything it cannot normalize, and how it
1289-
# rendered before normalization was introduced.
1290-
exponent = cast(int, value.as_tuple().exponent) # finite: never 'n'/'N'/'F'
1291-
# Length of the '[-]<integer>.<fraction>' text returned below. Stripping
1292-
# redundant zeros can only shorten it, so this is an upper bound.
1293-
expansion_len = (
1294-
(1 if value.is_signed() else 0)
1295-
+ max(value.adjusted() + 1, 1) # integer digits, at least one
1296-
+ 1 # the decimal point
1297-
+ max(-exponent, 1) # fraction digits, at least one
1298-
)
1299-
if expansion_len > _MAX_TASK_PARAM_VALUE_LEN:
1300-
return elem
1301-
# format(value, 'f') is exact and plain at every magnitude: with no
1302-
# precision in the format spec it neither rounds to getcontext().prec
1303-
# nor switches to exponent notation, so an embedding app that sets a
1304-
# different context cannot change what this library renders. Neither
1305-
# holds of the obvious alternatives -- normalize() rounds to the
1306-
# ambient precision, str() switches to exponent notation below 1e-6,
1307-
# and quantize() raises InvalidOperation once the result needs more
1308-
# digits than the ambient precision allows.
1309-
text = format(value, "f")
1310-
negative = text.startswith("-")
1311-
integer, _, fraction = text.lstrip("-").partition(".")
1312-
# A <floatstring> denotes a number, so redundant zeros in its source
1313-
# text are not part of the value: '02.50' is 2.5. One fractional digit
1314-
# is always kept, matching openjd-rs, which renders the float 1.0 as
1315-
# `1.0` and never as `1`.
1316-
integer = integer.lstrip("0") or "0"
1317-
fraction = fraction.rstrip("0") or "0"
1318-
if negative and integer == "0" and fraction == "0":
1319-
# The number denoted by '-0.0' is zero, which has no sign; openjd-rs
1320-
# renders it `0.0`.
1321-
negative = False
1322-
return f"{'-' if negative else ''}{integer}.{fraction}"
1323-
except (ValueError, ArithmeticError):
1324-
# Not a number at all — e.g. a format string that resolved to
1325-
# non-numeric text. A literal range is already checked against its
1326-
# element type at template parse time, so leave such a value to the
1327-
# existing behaviour rather than adding a rejection path here.
1283+
return int(elem) # int() already drops leading zeros
1284+
# Parsed only to check it is a number; the text is what renders. Not a
1285+
# Decimal -- re-rendering one is context-sensitive and unbounded (§7.5).
1286+
float(elem)
1287+
except ValueError:
1288+
# A resolved format string can be non-numeric. Literals are checked at
1289+
# template parse time, so carry it through rather than rejecting here.
13281290
return elem
1291+
# Trimmed because the text reaches a command line and float() ignores
1292+
# surrounding whitespace; openjd-rs trims here too.
1293+
text = _REDUNDANT_LEADING_ZEROS.sub(r"\1", elem.strip())
1294+
# Zero has no sign, so drop one without dropping the decimal places: '-0.00'
1295+
# renders `0.00`. Decided from the text, not from `value` -- the parse
1296+
# underflows to 0.0 below ~5e-324, and a tiny value's digits are exactly what
1297+
# a <floatstring> is for.
1298+
return text.lstrip("+-") if _spells_zero(text) else text
13291299

13301300

13311301
# Target model for task parameters when instantiating a job.
@@ -1340,22 +1310,14 @@ class RangeListTaskParameterDefinition(OpenJDModel_v2023_09):
13401310
@field_validator("range", mode="before")
13411311
@classmethod
13421312
def _normalize_numeric_range_elements(cls, value: Any, info: ValidationInfo) -> Any:
1343-
# §3.4.1.1/§3.4.1.2: an <IntRangeList> element is `<integer> |
1344-
# <intstring>` and a <FloatRangeList> element is `<float> |
1345-
# <floatstring>`, where an <intstring>/<floatstring> is "a string whose
1346-
# value is the string representation of" a number (§2.3, §2.4). Such an
1347-
# element therefore denotes that number, not its source text, so '02'
1348-
# is the task value 2 and '02.50' is 2.5. Python was keeping the source
1349-
# text, which reaches a task command line as `--frame 02`.
1350-
#
1351-
# Applied on the instantiation target so every inbound range path is
1352-
# covered: a literal list, a range-expression expansion, and an RFC 0006
1353-
# typed whole-field resolution all funnel through this model.
1313+
# §7.5: a string-form range element loses redundant leading zeros and
1314+
# keeps its decimal places, so '02' is the value 2 and '02.50' renders
1315+
# `2.50`. Numeric literals carry no such request and are left as parsed;
1316+
# STRING and PATH ranges have no numeric form at all.
13541317
#
1355-
# Numeric elements are left exactly as parsed. A FLOAT range of [1.0]
1356-
# renders 1.0, which openjd-rs also does and the conformance suite pins
1357-
# (base/jobs/3.4--float-parameter). STRING and PATH ranges are text by
1358-
# definition and are never touched.
1318+
# On the instantiation target so all three inbound paths are covered: a
1319+
# literal list, a range-expression expansion, and RFC 0006 whole-field
1320+
# resolution.
13591321
param_type = info.data.get("type")
13601322
if not isinstance(value, list) or param_type not in (
13611323
TaskParameterType.INT,

‎test/openjd/model_v0/test_step_param_space_iter.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,8 @@ def test_int_range_intstring_elements(self) -> None:
613613

614614
def test_float_range_floatstring_elements(self) -> None:
615615
# WHEN a FLOAT range is written with <floatstring> elements
616-
# THEN each task gets the number the element denotes
617-
assert self._task_values("FLOAT", ["1.5", "02.50"]) == ["1.5", "2.5"]
616+
# THEN each task gets the element's text, less redundant leading zeros
617+
assert self._task_values("FLOAT", ["1.5", "02.50", "3.500"]) == ["1.5", "2.50", "3.500"]
618618

619619
def test_float_range_numeric_literals_keep_their_scale(self) -> None:
620620
# A <float> literal is not a string representation, so it keeps the scale

‎test/openjd/model_v0/v2023_09/test_parameter_space.py‎

Lines changed: 62 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -441,13 +441,12 @@ def test_list_form_range_is_still_capped(self, model: Any, obj: dict[str, Any])
441441

442442

443443
class TestRangeListElementNormalization:
444-
"""§3.4.1.1/§3.4.1.2: an `<IntRangeList>` element is `<integer> | <intstring>`
445-
and a `<FloatRangeList>` element is `<float> | <floatstring>`. An
446-
`<intstring>`/`<floatstring>` is "a string whose value is the string
447-
representation of" a number (§2.3, §2.4), so it denotes that number and not
448-
its source text — a range of `['1', '02', '003']` is the task values 1, 2 and
449-
3. These values reach a task command line, so keeping the text renders
450-
`--frame 02`.
444+
"""§7.5 on a range element: leading zeros go, decimal places stay.
445+
446+
`['1', '02', '003']` is the task values 1, 2 and 3; keeping the text renders
447+
`--frame 02`. But `'2.50'` renders `2.50`, because the string form is how a
448+
template asks for a fixed number of decimal places —
449+
`EXPR/jobs/expr1.3.4--float-passthrough` pins that for a FLOAT default.
451450
"""
452451

453452
@pytest.mark.parametrize(
@@ -471,96 +470,86 @@ def test_intstring_elements_carry_their_value(self, param_type: str) -> None:
471470
@pytest.mark.parametrize(
472471
"element,expected",
473472
(
474-
pytest.param("1.5", "1.5", id="no normalization needed"),
475-
pytest.param("02.50", "2.5", id="leading and trailing zeros"),
476-
pytest.param("3.500", "3.5", id="trailing zeros"),
477-
pytest.param("-02.50", "-2.5", id="negative"),
478-
# An integral float keeps one fractional digit. openjd-rs renders
479-
# the <floatstring> '1.0' as `1.0` and '007' as `7.0`, so dropping
480-
# the fraction would make the same number render two ways depending
481-
# on whether it was written as a <float> or a <floatstring>.
482-
pytest.param("1.0", "1.0", id="integral float"),
473+
pytest.param("1.5", "1.5", id="nothing to strip"),
474+
# The rule, in both directions at once.
475+
pytest.param("02.50", "2.50", id="leading zero goes, trailing zero stays"),
476+
pytest.param("3.500", "3.500", id="trailing zeros stay"),
477+
pytest.param("-02.50", "-2.50", id="negative"),
478+
pytest.param("+02.50", "+2.50", id="explicit plus sign is kept"),
479+
pytest.param("007", "7", id="leading zeros on a whole number"),
480+
pytest.param("100", "100", id="a zero that is a significant digit"),
481+
# Neither the zero before the point nor the last of an all-zero
482+
# integer part is redundant.
483+
pytest.param("0.50", "0.50", id="the necessary leading zero stays"),
484+
pytest.param("000", "0", id="all zeros keeps one"),
485+
pytest.param("0", "0", id="bare zero"),
483486
pytest.param("0.0", "0.0", id="zero"),
487+
pytest.param("0.00", "0.00", id="zero keeps its trailing zeros too"),
488+
# Zero has no sign, which openjd-rs and mainline both render away.
489+
# Dropping it must not drop the decimal places with it.
484490
pytest.param("-0.0", "0.0", id="negative zero has no sign"),
485-
pytest.param("007", "7.0", id="leading zeros on a whole number"),
486-
pytest.param("100", "100.0", id="whole number"),
487-
# Exponent notation must never reach a task command line, at any
488-
# magnitude and in either direction.
489-
pytest.param("1E+2", "100.0", id="exponent notation in the source"),
490-
pytest.param(
491-
"0.0000001",
492-
"0.0000001",
493-
id="below 1e-6, where Decimal.__str__ would give 1E-7",
494-
),
495-
pytest.param(
496-
"1E+30",
497-
"1" + "0" * 30 + ".0",
498-
id="more digits than the default decimal precision",
499-
),
491+
pytest.param("-0.00", "0.00", id="unsigned, but still two places"),
492+
# An all-zero mantissa spells zero whatever the exponent.
493+
pytest.param("0E+2", "0E+2", id="exponent form of zero"),
494+
pytest.param("-0e5", "0e5", id="signed exponent form of zero"),
495+
# Underflow is not zero being spelled: the digits are the request.
496+
pytest.param("1e-400", "1e-400", id="underflow keeps its digits"),
497+
pytest.param("0." + "0" * 400 + "1", "0." + "0" * 400 + "1", id="tiny plain decimal"),
498+
# float() ignores surrounding whitespace and this text reaches a
499+
# command line, so it is trimmed rather than forwarded.
500+
pytest.param(" 1.5 ", "1.5", id="surrounding whitespace"),
501+
pytest.param("1.0", "1.0", id="integral float keeps its point"),
502+
# Exponent notation is the author's own text and is forwarded. The
503+
# FLOAT parameter default path does the same for `default: "1E+2"`.
504+
pytest.param("1E+2", "1E+2", id="exponent notation"),
505+
pytest.param("01E+2", "1E+2", id="leading zero on an exponent form"),
506+
pytest.param("0.0000001", "0.0000001", id="below 1e-6"),
500507
pytest.param(
501508
"1.2345678901234567890123456789012345678901",
502509
"1.2345678901234567890123456789012345678901",
503-
id="more significant digits than the default decimal precision",
510+
id="more significant digits than a float can hold",
504511
),
505512
),
506513
)
507-
def test_floatstring_elements_carry_their_value(self, element: str, expected: str) -> None:
514+
def test_floatstring_elements_keep_their_scale(self, element: str, expected: str) -> None:
508515
# WHEN the instantiation target parses a float range holding a <floatstring>
509516
model = _parse_model(
510517
model=RangeListTaskParameterDefinition, obj={"type": "FLOAT", "range": [element]}
511518
)
512519

513-
# THEN the element renders as the number it denotes
520+
# THEN it renders as written, less any redundant leading zeros
514521
assert [str(v) for v in model.range] == [expected]
515522

516-
@pytest.mark.parametrize(
517-
"element",
518-
(
519-
# Decimal's context bounds arithmetic results, not construction from
520-
# a string, so these are finite: 11 characters of template text
521-
# whose plain-notation expansion is ~10**9 characters.
522-
pytest.param("1e999999999", id="huge positive exponent"),
523-
pytest.param("1e-999999999", id="huge negative exponent"),
524-
# One character past the cap in each direction: both expand to 1025.
525-
pytest.param("1E+1022", id="one past the cap, positive exponent"),
526-
pytest.param("1E-1023", id="one past the cap, negative exponent"),
527-
),
528-
)
529-
def test_element_too_long_to_expand_keeps_its_source_text(self, element: str) -> None:
530-
# WHEN the instantiation target parses a <floatstring> whose plain-notation
531-
# form would not fit TaskParameterStringValueAsJob's 1024-character cap
532-
model = _parse_model(
533-
model=RangeListTaskParameterDefinition, obj={"type": "FLOAT", "range": [element]}
534-
)
535-
536-
# THEN it keeps its source text rather than being expanded. Expanding it
537-
# would allocate the whole expansion, and the result could not be carried
538-
# as text here anyway: it fails the str member of TaskRangeList's union,
539-
# and pydantic then falls through to the numeric members, rendering the
540-
# element as an integer, or as inf, or as 0.0.
541-
assert [str(v) for v in model.range] == [element]
542-
543523
@pytest.mark.parametrize(
544524
"element,expected",
545525
(
546-
pytest.param("1E+1021", "1" + "0" * 1021 + ".0", id="positive exponent"),
547-
pytest.param("1E-1022", "0." + "0" * 1021 + "1", id="negative exponent"),
526+
# An exponent too large for a float still costs only its own
527+
# characters, which is the whole point: nothing expands it.
528+
pytest.param("1e999999999", "1e999999999", id="huge positive exponent"),
529+
pytest.param("1E+1022", "1E+1022", id="positive exponent past the field cap"),
530+
# Too small for a float either way, and the digits still stand:
531+
# underflowing to 0.0 is a parse limit, not the author writing zero.
532+
pytest.param("1e-999999999", "1e-999999999", id="huge negative exponent"),
533+
pytest.param("1E-1023", "1E-1023", id="negative exponent past the field cap"),
548534
),
549535
)
550-
def test_element_at_the_cap_is_still_normalized(self, element: str, expected: str) -> None:
551-
# GIVEN a <floatstring> whose plain-notation form is exactly 1024
552-
# characters — at the cap, not past it
553-
assert len(expected) == 1024
554-
555-
# WHEN the instantiation target parses it
536+
def test_a_huge_exponent_costs_only_its_own_characters(
537+
self, element: str, expected: str
538+
) -> None:
539+
# WHEN 11 characters of template text denote a number needing ~10**9
540+
# digits in plain notation
556541
model = _parse_model(
557542
model=RangeListTaskParameterDefinition, obj={"type": "FLOAT", "range": [element]}
558543
)
559544

560-
# THEN the length bound has not cost it its normalization
545+
# THEN nothing expands it, so no bound on the exponent is needed to stop a
546+
# template allocating ~10**9 characters. Long *literal* text can still
547+
# exceed TaskParameterStringValueAsJob's cap and fall through to a numeric
548+
# member of the union, as it does on mainline and in 0.11.6; only the
549+
# expansion is gone.
561550
assert [str(v) for v in model.range] == [expected]
562551

563-
def test_floatstring_normalization_ignores_the_decimal_context(self) -> None:
552+
def test_floatstring_rendering_ignores_the_decimal_context(self) -> None:
564553
# GIVEN an embedding application that has narrowed the process-wide
565554
# decimal context, and a <floatstring> with more significant digits
566555
# than that precision allows
@@ -573,8 +562,8 @@ def test_floatstring_normalization_ignores_the_decimal_context(self) -> None:
573562
model=RangeListTaskParameterDefinition, obj={"type": "FLOAT", "range": [element]}
574563
)
575564

576-
# THEN the value is unrounded: what this library renders is a property of
577-
# the template, not of the host application's decimal context
565+
# THEN it is unrounded: the rendering is a property of the template, not
566+
# of the host application's decimal context
578567
assert [str(v) for v in model.range] == [element]
579568

580569
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)