Skip to content

Commit

Permalink
add test cases for floats with exponents
Browse files Browse the repository at this point in the history
  • Loading branch information
mlin committed Mar 2, 2025
1 parent 475dd3f commit 8536675
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions WDL/runtime/backend/docker_swarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,9 @@ def poll_service(
logger.debug(_("docker task status", **status))
state = status["State"]
else:
assert (
len(self._observed_states or []) <= 1
), "docker task shouldn't disappear from service"
assert len(self._observed_states or []) <= 1, (
"docker task shouldn't disappear from service"
)

# references on docker task states:
# https://docs.docker.com/engine/swarm/how-swarm-mode-works/swarm-task-states/
Expand Down
2 changes: 2 additions & 0 deletions tests/test_0eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ def test_float_coercion(self):
("1 <= 1.0", "true"),
("[1, 2.0]", "[1.000000, 2.000000]", WDL.Type.Array(WDL.Type.Float())),
("[1, 2.0][0]", "1.000000", WDL.Type.Float()),
("6.02e23", "601999999999999995805696.000000", WDL.Type.Float()),
# TODO: more sophisticated unification algo to handle this
# ("[[1],[2.0]]", "[[1.0], [2.0]]", WDL.Type.Array(WDL.Type.Float())),
)
Expand Down Expand Up @@ -517,6 +518,7 @@ def test_json(self):
(WDL.Type.Boolean(), False),
(WDL.Type.Int(), 42),
(WDL.Type.Float(), 3.14),
(WDL.Type.Float(), 6.02e23),
(WDL.Type.String(), 'CNN is working frantically to find their "source."'),
(WDL.Type.String(optional=True), None),
(WDL.Type.File(), '/tmp/stdout.txt'),
Expand Down

0 comments on commit 8536675

Please # to comment.