Datasets:
File size: 1,356 Bytes
870b85a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | import curation_paths as paths
import sys,json,sqlite3,collections as C
S=paths.S; sys.path[:0]=[S,S+"/engine/source/scripts/internal/scene_generation/real_assets",S+"/engine/supervisor_site"]
import annotation_retrieval as ar
R=paths.L+"/"
a=sqlite3.connect("file:"+R+"full_matrix_reviewed_compatibility_v6.sqlite3?mode=ro",uri=True); b=sqlite3.connect("file:"+R+"full_matrix_reviewed_compatibility_v7.sqlite3?mode=ro",uri=True)
A=dict(a.execute("select asset_id,record_json from annotations")); B=dict(b.execute("select asset_id,record_json from annotations"))
c=C.Counter(); prot=0; keys=C.Counter()
for k in A:
if A[k]==B[k]: c["identical"]+=1; continue
ra,rb=json.loads(A[k]),json.loads(B[k]); c["rewritten"]+=1
for f in set(ra)|set(rb):
if ra.get(f)!=rb.get(f): keys[f]+=1
if ar.build_candidate(ra)!=ar.build_candidate(rb): c["BUILD_CANDIDATE_DIFF"]+=1
print(dict(c),"| top-level keys changed:",dict(keys))
for t in ("assets","style_role_candidates","functional_slots","function_tags","records"):
print(t,"rows v6/v7:",a.execute("select count(*) from "+t).fetchone()[0],b.execute("select count(*) from "+t).fetchone()[0])
print("category column unchanged:",all(x==y for x,y in zip(sorted(a.execute("select asset_id,normalized_category from assets")),sorted(b.execute("select asset_id,normalized_category from assets")))))
|