Score each item's complexity, and calibrate R, S and C against what finished chunks measured
This commit is contained in:
+6
-4
@@ -4,7 +4,9 @@ import re
|
||||
from failure import Failure
|
||||
|
||||
EXEMPTIONS = ("", "decision", "defect", "principle", "question", "security")
|
||||
ITEMS_HEADER = "| ID | Release | Exempt | Item | R | S | A | G | Goals | Score |"
|
||||
ITEMS_HEADER = "| ID | Release | Exempt | Item | R | S | C | A | G | Goals | Score |"
|
||||
# The items header before C joined it, which rank_todo.py asks to have C added.
|
||||
LEGACY_HEADER = "| ID | Release | Exempt | Item | R | S | A | G | Goals | Score |"
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
@@ -57,10 +59,10 @@ def cells(row: str, count: int) -> list[str] | Failure:
|
||||
|
||||
def parse_row(row: str) -> Item | Failure:
|
||||
"""An item row, every cell checked but the goals it cites."""
|
||||
found = cells(row, 10)
|
||||
found = cells(row, 11)
|
||||
if isinstance(found, Failure):
|
||||
return found
|
||||
id_, release, exempt, tagline, r, s, a, g, goals, _ = found
|
||||
id_, release, exempt, tagline, r, s, c, a, g, goals, _ = found
|
||||
if not re.fullmatch(r"[0-9]+", id_) or int(id_) < 1:
|
||||
return Failure(f"the ID {id_!r} is not a positive whole number: {row}")
|
||||
if not re.fullmatch(r"[0-9]+\.[0-9]+\.[0-9]+", release):
|
||||
@@ -70,7 +72,7 @@ def parse_row(row: str) -> Item | Failure:
|
||||
if not re.fullmatch(r"\*\*[^*].*[^*]\*\*", tagline):
|
||||
return Failure(f"item {id_}'s Item cell is not one bold tagline: {tagline}")
|
||||
scores = {}
|
||||
for name, value in zip("RSAG", (r, s, a, g)):
|
||||
for name, value in zip("RSCAG", (r, s, c, a, g)):
|
||||
if not re.fullmatch(r"[0-9]+", value) or not 1 <= int(value) <= 10:
|
||||
return Failure(f"item {id_}'s {name} {value!r} is not a whole number from 1 to 10")
|
||||
scores[name] = int(value)
|
||||
|
||||
Reference in New Issue
Block a user