Impossible runs: one definition, left out of the route model and the site statistics (#21, #22)
CI / test (pull_request) Successful in 41s
CI / test (pull_request) Successful in 41s
- core/spec/form.yaml impossible_flags: the flags that mean a run cannot have happened as recorded (a dragon an encounter does not have, a Green or the Black in the valley, two bonds, two burns, a cadet path that does not follow, an early death that still reached the hour...). atlas.runs.impossible() reads it. - The route model and the site statistics (and the riders' paths) leave those runs out, from every source; every other run is used, however partial. The runs stay in runs_clean.csv, flagged. 80 runs: 75 form, 5 Reddit. Route-model odds move by at most 0.2 points. - collection/etl/runs.py: the community form gets the same game-rule checks as "Report a run" and the Reddit comments (10 form rows newly flagged); new rule: the Black in the valley. - The first-sighting pool stays a flag only: it is what riders have seen, not a rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
036c86a1d1
commit
46c1f00150
@@ -25,6 +25,13 @@ def _parse(col, v):
|
||||
return v
|
||||
|
||||
|
||||
def impossible(r):
|
||||
"""A run that cannot have happened as recorded: one of its flags is in core/spec/form.yaml impossible_flags."""
|
||||
from . import spec
|
||||
rules = spec.form()["impossible_flags"]
|
||||
return any(rule in f for f in (r.get("data_flags") or "").split("; ") for rule in rules)
|
||||
|
||||
|
||||
def read(path=PATH, sources=None, drop=("run_id",)):
|
||||
"""Typed records, optionally only from some sources (the `source` column)."""
|
||||
with open(path, encoding="utf-8", newline="") as f:
|
||||
|
||||
@@ -156,6 +156,26 @@ sighting_pool:
|
||||
# The dragons each bonding encounter can end with (bond or burn), from the community PDF. Only used to FLAG runs
|
||||
# answered through "Report a run" (reported, reddit comment) that end with a dragon the encounter does not have.
|
||||
# Orange and Brown after the two Greens: a Green's rescue, then the Orange or Brown.
|
||||
# Flags (data_flags, matched as text inside a flag) that mean a run cannot have happened as recorded: the game's own
|
||||
# rules, from the form coder (core/atlas/coding.py) and the checks of collection/etl/runs.py rule_flags. A run with one
|
||||
# is kept in runs_clean.csv, flagged, and left out of the route model and the site statistics (atlas.runs.impossible).
|
||||
# Everything else, however partial, is used. Not here on purpose: a first sighting outside the documented pool (the
|
||||
# pool is what riders have seen, not a rule), a missing direction, several wings, a missing Green before a rescue.
|
||||
impossible_flags:
|
||||
- "Green recorded on a Valley run"
|
||||
- "Black recorded on a Valley run"
|
||||
- "encounter, which has only"
|
||||
- "more than one dragon marked Bonded"
|
||||
- "more than one dragon marked Incinerated"
|
||||
- "tree run with both the Red and the two Greens attempted"
|
||||
- "died in combat on a path without combat"
|
||||
- "rare-dragon answer does not match the path"
|
||||
- "does not follow"
|
||||
- "fight answers on a run that did not help"
|
||||
- "a path after the fight on a run without a fight"
|
||||
- "a second fight move without pausing to assess"
|
||||
- "died before the hour, yet reached"
|
||||
|
||||
encounter_colours:
|
||||
"Shadow (rare)": [Blue, Black]
|
||||
"Descend quickly: Red": [Red]
|
||||
|
||||
Reference in New Issue
Block a user