betting_combat.rounds.identity.build
extend: the UFCStats history into the registry, append-only.
UFCStats’ mirror lists each bout’s fighters by name only. Each bout side is resolved once to
a fighter_uid and stored (bout_sides); a side already stored is never resolved again.
fighters every fighter-table page without a fighter_uid gets one (in page-id order). A page whose exact name is a 'no_page' fighter's (and no other page's) is that fighter: the page is bound to the existing fighter_uid, not minted anew (the fighter's row is never changed: every table only grows).aliases each reviewed alias (``aliases.csv``: another source's name for a page's fighter, 'Cris Cyborg' for the page Cristiane Justino, with the evidence) is the fighter's 'name' key; one that is another fighter's name is refusedsides per finished bout side, in card order (date, event, card position, slot): pin a reviewed pin (``pins.csv``: the bout side, the page, the evidence), first, always name the one fighter the name can be: a page of that exact name or a stored extra spelling (``norm_name``) weight several pages share the name: those with a date of birth putting the fighter outside 18-45 at the bout are not candidates; of the rest, exactly one listed within ``NEAR_LBS`` of the bout's division and every other listed ``FAR_LBS`` or more away (a page without a weight is never 'away'); else UNRESOLVED (a pin is needed: the Anthony Romero of 2026-10-03, 145 lb against 155 lb) spelling no page of that name: the page UFCStats spells otherwise ('Zach Reese' / 'Zachary Reese'): of the pages it may be (``names.variant`` or ``names.strictly_same``, the card loader's rule: 'Joe' / 'Joseph Kropschot'), the one whose name no bout uses, else the only one when it is the same name (suffixes aside) or its letters >= 90% alike. The spelling is stored as the fighter's 'name' key no_page no page at all (the mirror lags a debut): a 'no_page' fighter is minted, its spelling stored as its 'name' keybouts per finished bout with both sides resolved and two different fighters, in card order: the live bout the card run minted for the same two fighters within a day, its UFCStats id bound as a key (its facts must be UFCStats' scheduled rounds, division, women and title, else a finding 'facts_disagree'); else a new bout_uid, fighter A (``registry.a_slot_of``) and the facts as UFCStats lists themevents per UFCStats event: the live event its bouts were bound to (exactly one; two: 'event_split', a new event), its UFCStats id bound as a key; else a new event_uidUnresolved sides leave their bout out of bouts; every one is a finding (kind
‘unresolved’), as are the spellings bound and the pages bound to ‘no_page’ fighters, so each
can be reviewed. Nothing is ever re-derived or edited: every table only grows, and a fighter
table that later holds a namesake leaves every stored side where it was.
Functions
extend
extend(identity: Identity, bouts: pd.DataFrame, pages: pd.DataFrame, pins: pd.DataFrame | None = None, aliases: pd.DataFrame | None = None, ufc_events: pd.DataFrame | None = None) -> tuple[Identity, pd.DataFrame]identity with bouts and pages added (see the module doc), and the findings.
Args:
bouts: RawData.ufcstats_bouts (UFCStats’ ids and names, no fighter ids, the
event id, sched_rounds, division, women, title); only finished bouts (a method)
are taken.
pages: RawData.pages (the fighter table: fighter_id, name, weight_lbs, dob).
pins: read_pins(); None reads the package’s.
aliases: read_aliases(); None reads the package’s.
ufc_events: RawData.events (event_id, LOCATION): the events’ places (None: no
place kept).
read_aliases
read_aliases(path: Path = ALIASES_PATH) -> pd.DataFrameThe reviewed aliases: spelling (another source’s name for a fighter), its page (ufcstats_fighter_id), evidence.
read_pins
read_pins(path: Path = PINS_PATH) -> pd.DataFrameThe reviewed bout-side pins: ufcstats_fight_id, name (the side, exactly as UFCStats writes it on the bout), ufcstats_fighter_id (the page), evidence.