from research import *
s=begin(1214,'Compute the Rounded common-row change field','Where do the five source amplitudes change after rounding?',{},['C1182','C1213'])
def Q(x):return 5*((x+2)//5)
d=json.loads((ROOT/'model/complete_source_row_packet.json').read_text());lx={r['name']:r for r in d['LXX']};out=[]
for r in d['MT']:
 l=lx[r['name']];out.append({'name':r['name'],'exact_db':l['b_ledger']-r['b_ledger'],'rounded_db':Q(l['b_ledger'])-Q(r['b_ledger']),'exact_dL':l['L_ledger']-r['L_ledger'],'rounded_dL':Q(l['L_ledger'])-Q(r['L_ledger']),'rounded_dr':Q(l['r_calculated'])-Q(r['r_calculated'])})
changed=[x['name'] for x in out if x['exact_dL']!=x['rounded_dL']]
a=artifact('model/whole_genealogy_rounded_changes.json',json.dumps({'rows':out,'life_amplitude_changes':changed,'scope':'independently round the declared ordinary b,r,L counts, not final dates'},indent=2)+'\n')
finish(s,{'rounded_field':a,'changed_rows':changed},'Only Lamech and the Arphaxad/Shelah pair change their lifespan-difference amplitudes:−24 becomes−20, while each27 becomes25. Every common-row begetting difference survives exactly.','Determine why the whole Cumulative head difference nevertheless stays unchanged.',{'three_changes':changed==['Lamech','Arphaxad','Shelah'],'all_birth_deltas':all(x['exact_db']==x['rounded_db'] for x in out)})
