Skip to content

Commit

Permalink
write agg signatures to a file
Browse files Browse the repository at this point in the history
  • Loading branch information
Binh Vu committed Jan 22, 2024
1 parent 4bc59e2 commit 5cd4304
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/aggregate_datasets_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

@click.command()
@click.argument("input_dir", type=click.Path(exists=True))
def make_signatures(input_dir: Path):
def make_signatures(input_dir: Path | str):
input_dir = Path(input_dir)
signatures = {}
for sigfile in sorted(input_dir.glob("**/*/_SIGNATURE")):
sig = DatasetSignature.from_dict(serde.json.deser(sigfile))
Expand All @@ -21,7 +22,8 @@ def make_signatures(input_dir: Path):
"checksum": sig.checksum,
"dependencies": sorted(sig.dependencies.keys()),
}
return signatures

serde.json.ser(signatures, input_dir / "aggregated_signatures.json", indent=2)


if __name__ == "__main__":
Expand Down

0 comments on commit 5cd4304

Please sign in to comment.