from fractions import Fraction as Q def run(load,check): families=load('C271_FAMILIES.json'); records=load('C271_REGISTER.json') reg={(r['branch'],r['cumulative_source']['source_index']):r for r in records} js=sorted(f['cumulative_index'] for f in families) check('six retained annual indices',js==list(range(2,8))) rows=[] for j in js: i=j-2; S=-5890+j; I=-5290+i check(f'source598 at j{j}',I-S==598) check(f'cumulative partner exists j{j}',i in range(8)) sr=reg['Flood',j];nr=reg.get(('Noah',i)) check(f'regular Flood source j{j}',sr['source_event']['BC_Nisan']==S+8993) if nr:check(f'regular crosspair width j{j}',nr['source_event']['BC_Nisan']-sr['source_event']['BC_Nisan']==598) for e in [Q(-1,4),Q(1,4)]: check(f'phase alignment j{j} offset{e}',S+e+5888==I+e+5290) rows.append({'Shem_index':j,'Flood_index':i,'cumulative_Shem':S,'cumulative_Flood':I,'regular_Flood_id':sr['id'],'regular_Flood_center':S+8993,'required_regular_Noah_center':I+8993,'regular_Noah_id':nr['id'] if nr else None,'both_regular_counterparts':bool(nr),'baseline_common_forward_center':i,'phase_offsets':['-1/4','1/4']}) check('four complete regular crosspairs',sum(r['both_regular_counterparts'] for r in rows)==4) check('only lower two counterparts absent',[r['Flood_index'] for r in rows if not r['both_regular_counterparts']]==[0,1]) return {'rows':rows,'cumulative_pairs':6,'complete_regular_pairs':4,'missing_required_Noah_centers':[3703,3704],'general_identity':'H_j=F_(j-2) for h-f=598; common shift remains free','co_location_does_not_supply_missing_identity':True}