'source_text_type':meta.get('source_text_type'), 'superseded_by_pmid':meta.get('superseded_by_pmid')} for effect in atomic_effects: if any(key in effect and effect[key] != value for key,value in bound.items()): raise ValueError('Atomic effect may not replace its enclosing study identity') effects.append({**bound,**effect}) studies_path=root/'data/extracted/ring1_study_dossiers_v0.5.jsonl' effects_path=root/'data/extracted/ring1_atomic_effects_v0.5.jsonl' payloads={path:''.join(json.dumps(row,ensure_ascii=False,allow_nan=False)+'\n' for row in rows).encode('utf-8') for path,rows in [(studies_path,studies),(effects_path,effects)]} publish_byte_artifacts(payloads,lock_path=studies_path.parent/'.study-exports.lock',rollback_journal=rollback_journal) return studies_path,effects_path,len(effects)