bonesistools 1.7.0__tar.gz → 1.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bonesistools-1.7.0 → bonesistools-1.7.1}/PKG-INFO +6 -1
- {bonesistools-1.7.0 → bonesistools-1.7.1}/README.md +4 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/pyproject.toml +2 -1
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/_validation.py +2 -3
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/plotting/_graph.py +1 -1
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/preprocessing/_duplicates.py +2 -2
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/_utils.py +13 -8
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/cache.py +50 -13
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/ncbi/_identifiers.py +370 -108
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/ncbi/_typing.py +1 -1
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/omnipath/_archive.py +4 -4
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/README.md +10 -3
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/_fingerprints.py +62 -0
- bonesistools-1.7.1/tests/golden/group_families.py +58 -0
- bonesistools-1.7.1/tests/golden/observed/meteorlake-linux-py313-2026-12-06.json +79 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pl/test_figure.py +26 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pl/test_graph.py +21 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/tl/test_utils.py +13 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/resources/test_cache.py +176 -0
- bonesistools-1.7.1/tests/regression/resources/test_identifier_types.py +569 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/resources/test_ncbi.py +1 -0
- bonesistools-1.7.1/tests/regression/test_golden_fingerprints.py +124 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/.gitignore +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/LICENSE +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/__init__.pyi +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/_compat.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/_metadata.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/_typing.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/_validation.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/_warnings.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/__init__.pyi +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_algebra/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_algebra/__init__.pyi +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_algebra/_algebra.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_algebra/_boolean.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_algebra/_configuration.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_algebra/_hypercube.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_algebra/_kleene.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_algebra/_parser.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_algebra/_representation.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_algebra/_robdd.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_algebra/_structure.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_algebra/_typing.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_network/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_network/_asynchronous.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_network/_bdd.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_network/_distances.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_network/_dynamics.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_network/_general.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_network/_most_permissive.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_network/_network.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_network/_parser.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_network/_symbolic.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_network/_synchronous.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/boolean_network/_typing.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/influence_graph/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/influence_graph/_algorithms.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/influence_graph/_distances.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/influence_graph/_graphviz.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/influence_graph/_influence_graph.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/influence_graph/_parser.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/influence_graph/_scoring.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/influence_graph/_styles.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/influence_graph/_svg.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/influence_graph/_typing.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/input_output/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/input_output/_boolean_network.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/input_output/_booleanization.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/input_output/_executable_model.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/input_output/_ginml.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/input_output/_hypercube.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/input_output/_influence_graph.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/input_output/_sbml.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/logic/input_output/_zginml.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/__init__.pyi +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/_dependencies.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/_metadata.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/_stats.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/_typing.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/datasets/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/datasets/__init__.pyi +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/input_output/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/input_output/__init__.pyi +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/input_output/_geo.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/input_output/_metadata.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/input_output/_nestorowa.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/input_output/_pbmc3k.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/input_output/_registry.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/input_output/_write.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/input_output/datasets.json +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/plotting/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/plotting/__init__.pyi +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/plotting/_barplot.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/plotting/_colors.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/plotting/_density.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/plotting/_distribution.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/plotting/_figure.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/plotting/_scatterplot.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/plotting/_typing.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/plotting/_utils.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/preprocessing/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/preprocessing/__init__.pyi +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/preprocessing/_classification.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/preprocessing/_filter.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/preprocessing/_genename.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/preprocessing/_hvg.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/preprocessing/_qc.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/preprocessing/_simple.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/preprocessing/_transfer.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/preprocessing/_transform.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/__init__.pyi +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/_binarize.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/_classification.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/_clustering.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/_conversion.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/_embedding.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/_graph.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/_knnsc.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/_markers.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/_maths.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/_neighbors.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/_regress.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/_stats.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/tools/_write.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/py.typed +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/__init__.pyi +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/cache.pyi +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/__init__.pyi +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/_orthologs.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_anole_lizard_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_c.elegans_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_cat_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_cattle_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_chicken_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_chimpanzee_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_dog_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_fruitfly_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_horse_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_macaque_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_mouse_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_opossum_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_pig_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_platypus_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_rat_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_s.cerevisiae_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_s.pombe_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_xenopus_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/hcop/data/human_zebrafish_hcop.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/ncbi/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/ncbi/__init__.pyi +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/ncbi/_download.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/ncbi/_genesyn.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/ncbi/_mapping_cache.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/ncbi/data/gi/escherichia_coli_gene_info.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/ncbi/data/gi/homo_sapiens_gene_info.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/ncbi/data/gi/mus_musculus_gene_info.tsv.gz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/omnipath/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/omnipath/__init__.pyi +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/omnipath/_collectri.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/omnipath/_dorothea.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/resources/omnipath/_graph_cache.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/LICENSE.txt +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/conftest.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/generate_expected.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/logic/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/logic/_boolean_workflow.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/logic/_graph_layout.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/logic/data/README.md +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/logic/data/sea_urchin_dorsal_ventral_axis.sbml +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/logic/expected/aggregated_influence_graph.dot +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/logic/expected/death_receptor_cell_fate_mp.npz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/logic/expected/sea_urchin_dorsal_ventral_axis.bnet +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/logic/expected/synthetic_30_node_dynamics.npz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/logic/test_golden_boolean_workflow.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/logic/test_golden_graph_layout.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/logic/test_golden_sea_urchin.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/_omics_workflow.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/_tsne_diagnostics.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/_umap_diagnostics.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/expected/hvg_binning.npz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/expected/hvg_loess.npz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/expected/knnsc.npz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/expected/neighbors.npz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/expected/pca.npz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/expected/qc.npz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/expected/spectral.npz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/expected/tsne.npz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/expected/tsne_diagnostics/checkpoints.npz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/expected/umap.npz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/expected/umap_diagnostics/checkpoints.npz +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/pbmc3k.h5ad +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/test_golden_omics_workflow.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/test_golden_tsne_diagnostics.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/test_golden_umap_diagnostics.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/golden/omics/test_pbmc3k.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ba/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ba/test_algebra.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ba/test_boolean.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ba/test_configuration.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ba/test_hypercube.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ba/test_kleene.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ba/test_robdd.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ba/test_structure.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ba/test_typing.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/bn/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/bn/test_boolean_network.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/bn/test_boolean_network_ensemble.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/bn/test_distances.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/bn/test_dynamics.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/bn/test_most_permissive.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/bn/test_symbolic.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/conftest.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ig/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ig/test_aggregated_influence_graph.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ig/test_aggregated_visualization.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ig/test_collapsing.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ig/test_distances.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ig/test_influence_graph.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ig/test_parser.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ig/test_scoring.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/ig/test_styles.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/io/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/io/test_ginml.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/logic/io/test_sbml.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/conftest.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/io/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/io/test_geo.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/io/test_nestorowa.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/io/test_registry.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/io/test_write.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pl/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pl/test_barplot.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pl/test_colors.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pl/test_density.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pl/test_distribution.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pl/test_scatterplot.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pl/test_utils.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pp/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pp/test_classification.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pp/test_duplicates.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pp/test_genename.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pp/test_hvg.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pp/test_qc.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pp/test_simple.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pp/test_transfer_obs.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/pp/test_transform.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/test_typing.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/tl/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/tl/test_binarize.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/tl/test_clustering.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/tl/test_conversion.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/tl/test_embedding.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/tl/test_knnsc.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/tl/test_markers.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/tl/test_maths.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/tl/test_neighbors.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/tl/test_paga.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/tl/test_regress.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/tl/test_stats.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/omics/toy_data.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/resources/test_hcop.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/resources/test_omnipath.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/test_import.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/regression/test_validation.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/reproducibility/__init__.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/reproducibility/dorothea_legacy_mouse.sha256 +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/reproducibility/dorothea_modern_mouse_A_2025-08-13.sha256 +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/reproducibility/test_reproducibility_boolean_backends.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/reproducibility/test_reproducibility_omnipath.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/reproducibility/test_reproducibility_stats.py +0 -0
- {bonesistools-1.7.0 → bonesistools-1.7.1}/tests/reproducibility/test_reproducibility_workflow.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: bonesistools
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.1
|
|
4
4
|
Summary: Bioinformatics toolkit for upstream and downstream analyses around the BoNesis framework
|
|
5
5
|
Project-URL: Repository, https://github.com/bnediction/bonesistools
|
|
6
6
|
Author: Théo Roncalli
|
|
@@ -43,6 +43,7 @@ Requires-Dist: matplotlib>=3.5
|
|
|
43
43
|
Requires-Dist: networkx>=2.1
|
|
44
44
|
Requires-Dist: numpy>=1.21
|
|
45
45
|
Requires-Dist: pandas>=1.3.5
|
|
46
|
+
Requires-Dist: pillow>=13.0.0; python_version >= '3.11'
|
|
46
47
|
Requires-Dist: scikit-learn>=1.0
|
|
47
48
|
Requires-Dist: scipy>=1.7
|
|
48
49
|
Requires-Dist: typing-extensions>=4.0
|
|
@@ -211,6 +212,10 @@ Install all optional dependencies:
|
|
|
211
212
|
pip install "bonesistools[all]"
|
|
212
213
|
```
|
|
213
214
|
|
|
215
|
+
Pillow 13 security fixes require Python 3.11 or newer. Legacy Python versions
|
|
216
|
+
remain supported but cannot install that release; avoid processing untrusted
|
|
217
|
+
images in those environments.
|
|
218
|
+
|
|
214
219
|
Install the development version:
|
|
215
220
|
|
|
216
221
|
```sh
|
|
@@ -140,6 +140,10 @@ Install all optional dependencies:
|
|
|
140
140
|
pip install "bonesistools[all]"
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
+
Pillow 13 security fixes require Python 3.11 or newer. Legacy Python versions
|
|
144
|
+
remain supported but cannot install that release; avoid processing untrusted
|
|
145
|
+
images in those environments.
|
|
146
|
+
|
|
143
147
|
Install the development version:
|
|
144
148
|
|
|
145
149
|
```sh
|
|
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "bonesistools"
|
|
7
7
|
description = "Bioinformatics toolkit for upstream and downstream analyses around the BoNesis framework"
|
|
8
|
-
version = "1.7.
|
|
8
|
+
version = "1.7.1"
|
|
9
9
|
license = "CECILL-2.1"
|
|
10
10
|
credits = ["BNeDiction", "PEPR Santé Numérique 2030"]
|
|
11
11
|
authors = [
|
|
@@ -50,6 +50,7 @@ dependencies = [
|
|
|
50
50
|
"scikit-learn>=1.0",
|
|
51
51
|
"networkx>=2.1",
|
|
52
52
|
"matplotlib>=3.5",
|
|
53
|
+
"pillow>=13.0.0; python_version >= '3.11'",
|
|
53
54
|
"anndata>=0.8",
|
|
54
55
|
"boolean.py>=4.0",
|
|
55
56
|
"clingo>=5.6",
|
|
@@ -60,8 +60,7 @@ def _as_anndata_axis(
|
|
|
60
60
|
|
|
61
61
|
expected = "'obs', 'var' or 'both'" if allow_both else "'obs' or 'var'"
|
|
62
62
|
raise ValueError(
|
|
63
|
-
f"invalid argument value for 'axis': expected {expected} "
|
|
64
|
-
f"but received {axis!r}"
|
|
63
|
+
f"invalid argument value for 'axis': expected {expected} but received {axis!r}"
|
|
65
64
|
)
|
|
66
65
|
|
|
67
66
|
|
|
@@ -122,7 +121,7 @@ def _as_var_subset(adata: AnnData, var_subset: VarSubset) -> Optional[np.ndarray
|
|
|
122
121
|
formatted_missing = ", ".join(repr(variable) for variable in missing)
|
|
123
122
|
raise KeyError(f"variable(s) not found in adata.var_names: {formatted_missing}")
|
|
124
123
|
|
|
125
|
-
mask = np.asarray(adata.var_names.isin(
|
|
124
|
+
mask = np.asarray(adata.var_names.isin(variables), dtype=bool)
|
|
126
125
|
if not bool(mask.any()):
|
|
127
126
|
raise ValueError(
|
|
128
127
|
"invalid argument value for 'var_subset': no variables selected"
|
|
@@ -544,7 +544,7 @@ def _paga_graph(
|
|
|
544
544
|
) -> nx.Graph[Any]:
|
|
545
545
|
|
|
546
546
|
categories = adata.obs[obs].cat.categories
|
|
547
|
-
representation_mtx = adata.obsm[representation]
|
|
547
|
+
representation_mtx = cast(np.ndarray, adata.obsm[representation])
|
|
548
548
|
barycenters = {
|
|
549
549
|
category: np.nanmean(representation_mtx[adata.obs[obs] == category], axis=0)
|
|
550
550
|
for category in categories
|
{bonesistools-1.7.0 → bonesistools-1.7.1}/src/bonesistools/omics/preprocessing/_duplicates.py
RENAMED
|
@@ -333,8 +333,8 @@ def _consensus_value(values: Any) -> Any:
|
|
|
333
333
|
def _metadata_values_equal(left: Any, right: Any) -> bool:
|
|
334
334
|
|
|
335
335
|
try:
|
|
336
|
-
left_is_nan = bool(np.isscalar(left) and np.isnan(left))
|
|
337
|
-
right_is_nan = bool(np.isscalar(right) and np.isnan(right))
|
|
336
|
+
left_is_nan = bool(np.isscalar(left) and np.isnan(cast(Any, left)))
|
|
337
|
+
right_is_nan = bool(np.isscalar(right) and np.isnan(cast(Any, right)))
|
|
338
338
|
except TypeError:
|
|
339
339
|
left_is_nan = False
|
|
340
340
|
right_is_nan = False
|
|
@@ -93,7 +93,8 @@ def get_expression(
|
|
|
93
93
|
Raises
|
|
94
94
|
------
|
|
95
95
|
ValueError
|
|
96
|
-
If `use_raw` and `layer` are both specified
|
|
96
|
+
If `use_raw` and `layer` are both specified, or `use_raw=True` and
|
|
97
|
+
`adata.raw` is absent.
|
|
97
98
|
"""
|
|
98
99
|
|
|
99
100
|
if use_raw and layer is not None:
|
|
@@ -106,9 +107,15 @@ def get_expression(
|
|
|
106
107
|
var_names = adata.var_names
|
|
107
108
|
var = adata.var
|
|
108
109
|
elif use_raw:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
raw = adata.raw
|
|
111
|
+
if raw is None:
|
|
112
|
+
raise ValueError(
|
|
113
|
+
"invalid argument value for 'use_raw': "
|
|
114
|
+
"adata.raw is required when use_raw=True"
|
|
115
|
+
)
|
|
116
|
+
matrix = raw.X
|
|
117
|
+
var_names = raw.var_names
|
|
118
|
+
var = raw.var
|
|
112
119
|
else:
|
|
113
120
|
matrix = adata.X
|
|
114
121
|
var_names = adata.var_names
|
|
@@ -145,8 +152,7 @@ def get_expression(
|
|
|
145
152
|
if missing:
|
|
146
153
|
formatted_missing = ", ".join(repr(variable) for variable in missing)
|
|
147
154
|
raise KeyError(
|
|
148
|
-
"variable(s) not found in adata.raw.var_names: "
|
|
149
|
-
f"{formatted_missing}"
|
|
155
|
+
f"variable(s) not found in adata.raw.var_names: {formatted_missing}"
|
|
150
156
|
)
|
|
151
157
|
mask = var_names.isin(variables)
|
|
152
158
|
else:
|
|
@@ -398,8 +404,7 @@ def _resolve_obsm_argument(
|
|
|
398
404
|
_warn_deprecated_argument("use_rep", "obsm", stacklevel=stacklevel)
|
|
399
405
|
if obsm is not _UNSET:
|
|
400
406
|
raise TypeError(
|
|
401
|
-
"received both 'obsm' and deprecated 'use_rep'; "
|
|
402
|
-
"please use only 'obsm'"
|
|
407
|
+
"received both 'obsm' and deprecated 'use_rep'; please use only 'obsm'"
|
|
403
408
|
)
|
|
404
409
|
obsm = use_rep
|
|
405
410
|
elif obsm is _UNSET:
|
|
@@ -5,6 +5,7 @@ Management of locally cached biological resources.
|
|
|
5
5
|
|
|
6
6
|
Current remote resources are reused for up to 72 hours before revalidation.
|
|
7
7
|
Versioned archives remain cached until explicitly removed.
|
|
8
|
+
Transient failures allow up to three download attempts without caching partial data.
|
|
8
9
|
"""
|
|
9
10
|
|
|
10
11
|
from __future__ import annotations
|
|
@@ -17,7 +18,9 @@ import sys
|
|
|
17
18
|
import tempfile
|
|
18
19
|
import time
|
|
19
20
|
import warnings
|
|
21
|
+
from http.client import IncompleteRead
|
|
20
22
|
from pathlib import Path
|
|
23
|
+
from ssl import SSLCertVerificationError, SSLEOFError
|
|
21
24
|
from typing import Dict, List, Mapping, Optional, cast
|
|
22
25
|
from urllib.error import HTTPError, URLError
|
|
23
26
|
from urllib.parse import urlsplit
|
|
@@ -28,6 +31,8 @@ from typing_extensions import Protocol
|
|
|
28
31
|
_CACHE_RESOURCES = ("hcop", "ncbi", "omnipath")
|
|
29
32
|
_DOWNLOAD_CHUNK_SIZE = 1024 * 1024
|
|
30
33
|
_DOWNLOAD_HEADERS = {"User-Agent": "bonesistools"}
|
|
34
|
+
_DOWNLOAD_ATTEMPTS = 3
|
|
35
|
+
_RETRYABLE_HTTP_STATUSES = frozenset((408, 429, 500, 502, 503, 504))
|
|
31
36
|
|
|
32
37
|
__all__ = [
|
|
33
38
|
"clear",
|
|
@@ -41,6 +46,10 @@ class _DownloadResponse(Protocol):
|
|
|
41
46
|
def read(self, size: int = -1) -> bytes: ...
|
|
42
47
|
|
|
43
48
|
|
|
49
|
+
class _IncompleteDownloadError(ConnectionError):
|
|
50
|
+
pass
|
|
51
|
+
|
|
52
|
+
|
|
44
53
|
def path(resource: Optional[str] = None) -> Path:
|
|
45
54
|
"""
|
|
46
55
|
Return the local cache path for downloaded biological resources.
|
|
@@ -127,17 +136,7 @@ def _cached_download(
|
|
|
127
136
|
|
|
128
137
|
request = Request(url, headers=headers)
|
|
129
138
|
try:
|
|
130
|
-
|
|
131
|
-
response = cast(_DownloadResponse, raw_response)
|
|
132
|
-
_write_response(cache_file, response)
|
|
133
|
-
_write_metadata(
|
|
134
|
-
metadata_file,
|
|
135
|
-
{
|
|
136
|
-
"url": url,
|
|
137
|
-
"etag": response.headers.get("ETag"),
|
|
138
|
-
"last_modified": response.headers.get("Last-Modified"),
|
|
139
|
-
},
|
|
140
|
-
)
|
|
139
|
+
_download_response(request, cache_file, metadata_file)
|
|
141
140
|
except HTTPError as error:
|
|
142
141
|
if error.code == 304 and cache_file.exists():
|
|
143
142
|
cache_file.touch()
|
|
@@ -146,7 +145,7 @@ def _cached_download(
|
|
|
146
145
|
_warn_stale_cache(resource_name, url, error)
|
|
147
146
|
return cache_file
|
|
148
147
|
raise
|
|
149
|
-
except (OSError, URLError) as error:
|
|
148
|
+
except (OSError, URLError, IncompleteRead) as error:
|
|
150
149
|
if cache_file.exists():
|
|
151
150
|
_warn_stale_cache(resource_name, url, error)
|
|
152
151
|
return cache_file
|
|
@@ -155,6 +154,44 @@ def _cached_download(
|
|
|
155
154
|
return cache_file
|
|
156
155
|
|
|
157
156
|
|
|
157
|
+
def _download_response(request: Request, cache_file: Path, metadata_file: Path) -> None:
|
|
158
|
+
"""Retry transient GET failures, restarting each atomic transfer."""
|
|
159
|
+
|
|
160
|
+
for attempt in range(_DOWNLOAD_ATTEMPTS):
|
|
161
|
+
try:
|
|
162
|
+
with urlopen(request) as raw_response:
|
|
163
|
+
response = cast(_DownloadResponse, raw_response)
|
|
164
|
+
_write_response(cache_file, response)
|
|
165
|
+
_write_metadata(
|
|
166
|
+
metadata_file,
|
|
167
|
+
{
|
|
168
|
+
"url": request.full_url,
|
|
169
|
+
"etag": response.headers.get("ETag"),
|
|
170
|
+
"last_modified": response.headers.get("Last-Modified"),
|
|
171
|
+
},
|
|
172
|
+
)
|
|
173
|
+
return
|
|
174
|
+
except (
|
|
175
|
+
URLError,
|
|
176
|
+
ConnectionError,
|
|
177
|
+
TimeoutError,
|
|
178
|
+
IncompleteRead,
|
|
179
|
+
SSLEOFError,
|
|
180
|
+
) as error:
|
|
181
|
+
if (
|
|
182
|
+
isinstance(error, HTTPError)
|
|
183
|
+
and error.code not in _RETRYABLE_HTTP_STATUSES
|
|
184
|
+
):
|
|
185
|
+
raise
|
|
186
|
+
if isinstance(error, URLError) and isinstance(
|
|
187
|
+
error.reason, SSLCertVerificationError
|
|
188
|
+
):
|
|
189
|
+
raise
|
|
190
|
+
if attempt == _DOWNLOAD_ATTEMPTS - 1:
|
|
191
|
+
raise
|
|
192
|
+
time.sleep(2**attempt)
|
|
193
|
+
|
|
194
|
+
|
|
158
195
|
def _user_cache_path() -> Path:
|
|
159
196
|
|
|
160
197
|
return _platform_cache_path(
|
|
@@ -267,7 +304,7 @@ def _write_response(cache_file: Path, response: _DownloadResponse) -> None:
|
|
|
267
304
|
downloaded += len(chunk)
|
|
268
305
|
|
|
269
306
|
if expected_size is not None and downloaded != expected_size:
|
|
270
|
-
raise
|
|
307
|
+
raise _IncompleteDownloadError(
|
|
271
308
|
f"incomplete download: expected {expected_size} bytes but "
|
|
272
309
|
f"received {downloaded}"
|
|
273
310
|
)
|