about summary refs log tree commit diff
path: root/tests/test_pyhegp.py
AgeCommit message (Collapse)Author
3 daysSplit catenable phenotype frames along the index.Arun Isaac
Phenotype frames are split by sample IDs. This corresponds to splitting along the index, unlike genotype frames which need to be split along the columns.
3 daysGeneralize split_data_frame to split along any axis.Arun Isaac
3 daysSimplify split_data_frame so it is more composable.Arun Isaac
split_data_frame should only split the data frame. It should not be filtering out metadata columns.
4 daysDrop SNPs with a zero standard deviation.Arun Isaac
5 daysAvoid wildcard import from helpers.strategies.Arun Isaac
5 daysTest that ciphertext does not contain NA values.Arun Isaac
6 daysCompare complete frame in test_cat_*.Arun Isaac
It is so much simpler and much more robust to simply compare expected and actual data frames.
6 daysDo not import unused settings from hypothesis.Arun Isaac
6 daysTest cat_phenotype.Arun Isaac
7 daysRename cat subcommand to cat-genotype.Arun Isaac
A cat-phenotype subcommand is coming. Hence rename this.
7 daysMerge, not concat, genotype frames.Arun Isaac
pd.concat duplicates the metadata columns, and is generally the wrong approach to the problem.
7 daysTest cat_genotype.Arun Isaac
Test cat_genotype extensively using hypothesis.
7 daysSuffix CLI subcommand functions with _command.Arun Isaac
We distinguish CLI subcommand functions using the _command suffix. This way, we don't have to concoct weird names for the actual workhorse functions. To remain consistent, we also suffix _command to the command testing functions.
8 daysDo not require output ciphertext file path.Arun Isaac
Make output ciphertext file path implicit; infer it by appending ".hegp" to the plaintext file. We take inspiration from GnuPG.
8 daysUse open method of Path object, rather than the open function.Arun Isaac
8 daysTest for existence of output files.Arun Isaac
We were testing for zero exit status. Now, in addition, we test for the existence of output files. This is slightly more robust.
2025-08-06Subset to common SNPs.Arun Isaac
* pyhegp/pyhegp.py: Import reduce from functools. (pool_summaries, encrypt_genotype): New functions. (pool): Use pool_summaries. (encrypt): Use encrypt_genotype. * tests/test_pyhegp.py: Import pandas; Summary, read_summary and read_genotype from pyhegp.serialization. (test_pool, test_encrypt): New tests. * test-data/encrypt-test-encrypted-genotype.tsv, test-data/encrypt-test-genotype.tsv, test-data/encrypt-test-key, test-data/encrypt-test-summary, test-data/pool-test-complete-summary, test-data/pool-test-summary1, test-data/pool-test-summary2: New files.
2025-08-06Compute summary on encryption if not provided.Arun Isaac
* pyhegp/pyhegp.py (genotype_summary): New function. (summary): Use genotype_summary. (encrypt): Compute summary if not provided. * tests/test_pyhegp.py (test_simple_workflow): Remove xfail mark.
2025-08-06Add simple workflow.Arun Isaac
* README.md (How to use): Indent down into "Joint/federated analysis with many data owners" section. [Simple data sharing]: New section. * doc/generate-images.sh: Add simple workflow. * doc/workflow.png: Rename to doc/joint-workflow.png. * doc/workflow.uml: Rename to doc/joint-workflow.uml. * doc/simple-workflow.png, doc/simple-workflow.uml: New files. * tests/test_pyhegp.py: Import pytest. (test_simple_workflow): New test. * test-data/genotype.tsv: New file.
2025-08-06Test joint workflow CLI.Arun Isaac
* tests/test_pyhegp.py: Import CliRunner from click.testing, and main from pyhegp.pyhegp. (test_joint_workflow): New test. * test-data/genotype0.tsv, test-data/genotype1.tsv, test-data/genotype2.tsv, test-data/genotype3.tsv: New files.
2025-08-06Move negate to pyhegp.utils.Arun Isaac
* tests/test_pyhegp.py (negate): Move to pyhegp.utils. Import negate from pyhegp.utils. * pyhegp/utils.py: New file.
2025-08-06Loosen relative tolerance in test_pool_stats.Arun Isaac
* tests/test_pyhegp.py (test_pool_stats): Set relative tolerance to 1e-6.
2025-08-01Test solution of linear system after encryption.Arun Isaac
* tests/test_pyhegp.py: Import math. (square_matrices, negate, is_singular): New functions. (test_conservation_of_solutions): New test.
2025-08-01Separate standardization from encryption.Arun Isaac
* pyhegp/pyhegp.py (hegp_encrypt, hegp_decrypt): Do not standardize or unstandardize. (encrypt): Standardize before calling hegp_encrypt. * tests/test_pyhegp.py (test_hegp_encryption_decryption_are_inverses): Do not pass mean and standard deviation for standardization and unstandardization.
2025-08-01Do not test encryption on order 1 matrices.Arun Isaac
* tests/test_pyhegp.py (test_hegp_encryption_decryption_are_inverses): Do not test encryption on order 1 matrices.
2025-07-17Standardize before encryption.Arun Isaac
* pyhegp/pyhegp.py (hegp_encrypt): Standardize before encryption. (hegp_decrypt): Unstandardize after decryption. (encrypt): Pass in mean and standard deviation from summary file to hegp_encrypt. * tests/test_pyhegp.py (test_hegp_encryption_decryption_are_inverses): Pass in mean and standard deviation to hegp_encrypt.
2025-07-17Add standardization.Arun Isaac
* pyhegp/pyhegp.py (standardize): Standardize using mean and standard deviation, instead of the minor allele frequency. (unstandardize): New function. * tests/test_pyhegp.py: Import standardize and unstandardize from pyhegp.pyhegp. (no_column_zero_standard_deviation): New function. (test_standardize_unstandardize_are_inverses): New test.
2025-07-17Add pool subcommand.Arun Isaac
* pyhegp/pyhegp.py: Import namedtuple from collections, and read_summary from pyhegp.serialization. (Stats): New type. (pool_stats, pool): New functions. * tests/test_pyhegp.py: Import Stats and pool_stats from pyhegp.pyhegp. (test_pool_stats): New test.
2025-07-17Use default array shapes testing encryption/decryption.Arun Isaac
It may be better to sample a smaller set of matrices finely than a large set of matrices coarsely. * tests/test_pyhegp.py (test_hegp_encryption_decryption_are_inverses): Use default array shapes testing encryption/decryption.
2025-07-17Reduce maximum matrix size testing encryption/decryption.Arun Isaac
* tests/test_pyhegp.py (test_hegp_encryption_decryption_are_inverses): Reduce maximum matrix size to 100.
2025-07-17Organize source into directory structure.Arun Isaac
* pyhegp/__init__.py: New file. * pyhegp.py: Move to pyhegp/pyhegp.py. * test_pyhegp.py: Move to tests/test_pyhegp.py. Import from pyhegp.pyhegp instead of from pyhegp. * pyproject.toml (project.scripts)[pyhegp]: Switch to pyhegp.pyhegp:main.