Backend messages and field descriptions that reach the UI lose their em-dashes
Per the Microcopy rule: size and duration errors, the flavor errors, run parameter errors, the Resources field descriptions, 401/409/400 details, secret errors, the websocket node description and its on_connect setting. The generated client follows.
This commit is contained in:
@@ -38,7 +38,7 @@ def _megabytes(value: Any) -> Any:
|
||||
return value
|
||||
match = _SIZE.match(value)
|
||||
if not match:
|
||||
raise ValueError(f"'{value}' is not a size — write 512M, 2G, or 512")
|
||||
raise ValueError(f"'{value}' is not a size. Write 512M, 2G, or 512")
|
||||
amount, unit = int(match.group(1)), (match.group(2) or "m").lower()
|
||||
return amount * 1024 if unit.startswith("g") else amount
|
||||
|
||||
@@ -49,7 +49,7 @@ def _seconds(value: Any) -> Any:
|
||||
return value
|
||||
match = _SPAN.match(value)
|
||||
if not match:
|
||||
raise ValueError(f"'{value}' is not a duration — write 90s, 30m, 2h, or 90")
|
||||
raise ValueError(f"'{value}' is not a duration. Write 90s, 30m, 2h, or 90")
|
||||
return int(match.group(1)) * _SPAN_SECONDS[(match.group(2) or "s").lower()]
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ class Resources(BaseModel):
|
||||
description=(
|
||||
"Megabytes held for the whole execution; accepts '512M' or '2G'. "
|
||||
"Counted against machines that said how much they have, and "
|
||||
"ignored by those that did not — which is a machine with nothing "
|
||||
"ignored by those that did not, which is a machine with nothing "
|
||||
"to say about memory, not one with none."
|
||||
),
|
||||
)
|
||||
@@ -113,15 +113,15 @@ class Resources(BaseModel):
|
||||
description=(
|
||||
"How long one execution is expected to take; accepts '30m' or "
|
||||
"'2h'. A statement about the node for whoever is planning around "
|
||||
"it, not a limit — the limit is `timeout`."
|
||||
"it, not a limit. The limit is `timeout`."
|
||||
),
|
||||
)
|
||||
env: dict[str, str] = Field(
|
||||
default_factory=dict,
|
||||
description=(
|
||||
"Extra environment for the worker this node runs in, applied over "
|
||||
"what the allocation derives. Where a library's own tuning goes — "
|
||||
"XLA_FLAGS, XLA_PYTHON_CLIENT_MEM_FRACTION — since those are "
|
||||
"what the allocation derives. Where a library's own tuning goes "
|
||||
"(XLA_FLAGS, XLA_PYTHON_CLIENT_MEM_FRACTION), since those are "
|
||||
"composed strings the engine must not invent."
|
||||
),
|
||||
)
|
||||
@@ -140,8 +140,8 @@ class Resources(BaseModel):
|
||||
"""
|
||||
if self.flavor and (self.cpus != 1 or self.gpus != 0 or self.ram is not None):
|
||||
raise ValueError(
|
||||
f"flavor '{self.flavor}' already says how much — "
|
||||
"drop cpus, gpus and ram, or drop the flavor"
|
||||
f"flavor '{self.flavor}' already says how much. "
|
||||
"Drop cpus, gpus and ram, or drop the flavor"
|
||||
)
|
||||
return self
|
||||
|
||||
@@ -203,8 +203,8 @@ class NodeDef(BaseModel):
|
||||
resources: Resources | None = Field(
|
||||
default=None,
|
||||
description=(
|
||||
"What one execution of this node holds while it runs. Absent — the "
|
||||
"default — means it is not accounted for and shares the engine's "
|
||||
"What one execution of this node holds while it runs. Absent (the "
|
||||
"default) means it is not accounted for and shares the engine's "
|
||||
"workers, which is right for everything that is not compute-heavy."
|
||||
),
|
||||
)
|
||||
@@ -222,7 +222,7 @@ class NodeDef(BaseModel):
|
||||
description=(
|
||||
"What those modules hashed to at sync. The engine hashes them "
|
||||
"again when a run is claimed, and falls back to this when it "
|
||||
"cannot see the files — a worker on another machine."
|
||||
"cannot see the files, as a worker on another machine does."
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user