From 5bca393ec2d43853de8f98d28a50c40a21eb994d Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 17 Jul 2025 19:22:26 +0100 Subject: Use File instead of Path for encrypt subcommand options. * pyhegp/pyhegp.py (encrypt): Use File instead of Path for options. --- pyhegp/pyhegp.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyhegp/pyhegp.py b/pyhegp/pyhegp.py index 2f0bdb4..2177881 100644 --- a/pyhegp/pyhegp.py +++ b/pyhegp/pyhegp.py @@ -93,21 +93,21 @@ def pool(pooled_summary_file, summary_files): @click.option("--summary", "-s", "summary_file", type=click.File("rb"), help="Summary statistics file", required=True) -@click.option("--key", "-k", "key_path", type=click.Path(), +@click.option("--key", "-k", "key_file", type=click.File("w"), help="Output key", required=True) -@click.option("--output", "-o", "ciphertext_path", type=click.Path(), +@click.option("--output", "-o", "ciphertext_file", type=click.File("w"), default="-", help="Output ciphertext") -def encrypt(genotype_file, summary_file, key_path, ciphertext_path): +def encrypt(genotype_file, summary_file, key_file, ciphertext_file): genotype = read_genotype(genotype_file) summary = read_summary(summary_file) rng = np.random.default_rng() key = random_key(rng, len(genotype)) encrypted_genotype = hegp_encrypt(genotype, summary.mean, summary.std, key) - np.savetxt(key_path, key, delimiter=",", fmt="%f") - np.savetxt(ciphertext_path, encrypted_genotype, delimiter=",", fmt="%f") + np.savetxt(key_file, key, delimiter=",", fmt="%f") + np.savetxt(ciphertext_file, encrypted_genotype, delimiter=",", fmt="%f") if __name__ == "__main__": main() -- cgit v1.2.3