mantispy 0.1.0a1__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.
Files changed (126) hide show
  1. mantispy-0.1.0a1/.codecov.yaml +17 -0
  2. mantispy-0.1.0a1/.cruft.json +44 -0
  3. mantispy-0.1.0a1/.editorconfig +15 -0
  4. mantispy-0.1.0a1/.github/ISSUE_TEMPLATE/bug_report.yml +93 -0
  5. mantispy-0.1.0a1/.github/ISSUE_TEMPLATE/config.yml +5 -0
  6. mantispy-0.1.0a1/.github/ISSUE_TEMPLATE/feature_request.yml +11 -0
  7. mantispy-0.1.0a1/.github/dependabot.yml +21 -0
  8. mantispy-0.1.0a1/.github/workflows/autofix.yaml +29 -0
  9. mantispy-0.1.0a1/.github/workflows/build.yaml +30 -0
  10. mantispy-0.1.0a1/.github/workflows/release.yaml +33 -0
  11. mantispy-0.1.0a1/.github/workflows/test.yaml +163 -0
  12. mantispy-0.1.0a1/.gitignore +28 -0
  13. mantispy-0.1.0a1/.pre-commit-config.yaml +65 -0
  14. mantispy-0.1.0a1/.readthedocs.yaml +16 -0
  15. mantispy-0.1.0a1/.scripts/ci/download_data.py +67 -0
  16. mantispy-0.1.0a1/.scripts/ci/scrub_notebook_outputs.py +178 -0
  17. mantispy-0.1.0a1/.vscode/extensions.json +18 -0
  18. mantispy-0.1.0a1/.vscode/launch.json +33 -0
  19. mantispy-0.1.0a1/.vscode/settings.json +18 -0
  20. mantispy-0.1.0a1/CHANGELOG.md +114 -0
  21. mantispy-0.1.0a1/CITATION.cff +11 -0
  22. mantispy-0.1.0a1/LICENSE +28 -0
  23. mantispy-0.1.0a1/PKG-INFO +197 -0
  24. mantispy-0.1.0a1/README.md +105 -0
  25. mantispy-0.1.0a1/benchmarks/test_performance.py +129 -0
  26. mantispy-0.1.0a1/biome.jsonc +17 -0
  27. mantispy-0.1.0a1/pyproject.toml +292 -0
  28. mantispy-0.1.0a1/scripts/build_dataset.py +60 -0
  29. mantispy-0.1.0a1/scripts/build_staged_datasets.py +48 -0
  30. mantispy-0.1.0a1/scripts/check_staged_drift.py +83 -0
  31. mantispy-0.1.0a1/spec/morphology-schema-2.0.md +806 -0
  32. mantispy-0.1.0a1/spec/schema-0.1.json +52 -0
  33. mantispy-0.1.0a1/spec/schema-1.0.json +115 -0
  34. mantispy-0.1.0a1/spec/schema-2.0.json +134 -0
  35. mantispy-0.1.0a1/src/mantispy/__init__.py +10 -0
  36. mantispy-0.1.0a1/src/mantispy/_core/__init__.py +1 -0
  37. mantispy-0.1.0a1/src/mantispy/_core/_corr.py +495 -0
  38. mantispy-0.1.0a1/src/mantispy/_core/_distance.py +86 -0
  39. mantispy-0.1.0a1/src/mantispy/_core/_ecod.py +81 -0
  40. mantispy-0.1.0a1/src/mantispy/_core/_numba.py +444 -0
  41. mantispy-0.1.0a1/src/mantispy/_core/_reduce.py +278 -0
  42. mantispy-0.1.0a1/src/mantispy/_core/_stats.py +187 -0
  43. mantispy-0.1.0a1/src/mantispy/_core/data/blocklist_cellprofiler.txt +59 -0
  44. mantispy-0.1.0a1/src/mantispy/_core/features.py +373 -0
  45. mantispy-0.1.0a1/src/mantispy/_core/frames.py +33 -0
  46. mantispy-0.1.0a1/src/mantispy/_core/logging.py +29 -0
  47. mantispy-0.1.0a1/src/mantispy/_core/masks.py +152 -0
  48. mantispy-0.1.0a1/src/mantispy/_core/mutation.py +115 -0
  49. mantispy-0.1.0a1/src/mantispy/_core/plate.py +113 -0
  50. mantispy-0.1.0a1/src/mantispy/_core/provenance.py +36 -0
  51. mantispy-0.1.0a1/src/mantispy/_core/schema.py +1073 -0
  52. mantispy-0.1.0a1/src/mantispy/_settings.py +63 -0
  53. mantispy-0.1.0a1/src/mantispy/ds/__init__.py +55 -0
  54. mantispy-0.1.0a1/src/mantispy/ds/_blobs.py +210 -0
  55. mantispy-0.1.0a1/src/mantispy/ds/_build.py +621 -0
  56. mantispy-0.1.0a1/src/mantispy/ds/_datasets.py +1313 -0
  57. mantispy-0.1.0a1/src/mantispy/ds/_resources.py +133 -0
  58. mantispy-0.1.0a1/src/mantispy/ds/_synthetic.py +252 -0
  59. mantispy-0.1.0a1/src/mantispy/ds/registry.yaml +4778 -0
  60. mantispy-0.1.0a1/src/mantispy/get/__init__.py +40 -0
  61. mantispy-0.1.0a1/src/mantispy/get/_accessors.py +137 -0
  62. mantispy-0.1.0a1/src/mantispy/io/__init__.py +35 -0
  63. mantispy-0.1.0a1/src/mantispy/io/_cellprofiler.py +184 -0
  64. mantispy-0.1.0a1/src/mantispy/io/_export.py +247 -0
  65. mantispy-0.1.0a1/src/mantispy/io/_gallery.py +515 -0
  66. mantispy-0.1.0a1/src/mantispy/io/_jump.py +226 -0
  67. mantispy-0.1.0a1/src/mantispy/io/_plate.py +154 -0
  68. mantispy-0.1.0a1/src/mantispy/io/_profiles.py +722 -0
  69. mantispy-0.1.0a1/src/mantispy/metrics/__init__.py +22 -0
  70. mantispy-0.1.0a1/src/mantispy/metrics/_common.py +71 -0
  71. mantispy-0.1.0a1/src/mantispy/metrics/_diagnose.py +487 -0
  72. mantispy-0.1.0a1/src/mantispy/metrics/_evaluate.py +283 -0
  73. mantispy-0.1.0a1/src/mantispy/metrics/_relationships.py +211 -0
  74. mantispy-0.1.0a1/src/mantispy/metrics/_variance.py +254 -0
  75. mantispy-0.1.0a1/src/mantispy/pl/__init__.py +62 -0
  76. mantispy-0.1.0a1/src/mantispy/pl/_cluster.py +55 -0
  77. mantispy-0.1.0a1/src/mantispy/pl/_common.py +206 -0
  78. mantispy-0.1.0a1/src/mantispy/pl/_diagnostics.py +208 -0
  79. mantispy-0.1.0a1/src/mantispy/pl/_evaluation.py +398 -0
  80. mantispy-0.1.0a1/src/mantispy/pl/_features.py +132 -0
  81. mantispy-0.1.0a1/src/mantispy/pl/_heterogeneity.py +233 -0
  82. mantispy-0.1.0a1/src/mantispy/pl/_hits.py +435 -0
  83. mantispy-0.1.0a1/src/mantispy/pl/_moa.py +285 -0
  84. mantispy-0.1.0a1/src/mantispy/pl/_plate.py +128 -0
  85. mantispy-0.1.0a1/src/mantispy/pl/_qc.py +303 -0
  86. mantispy-0.1.0a1/src/mantispy/pl/_signature.py +111 -0
  87. mantispy-0.1.0a1/src/mantispy/pl/_transport.py +151 -0
  88. mantispy-0.1.0a1/src/mantispy/pp/__init__.py +53 -0
  89. mantispy-0.1.0a1/src/mantispy/pp/_annotate.py +153 -0
  90. mantispy-0.1.0a1/src/mantispy/pp/_batch.py +706 -0
  91. mantispy-0.1.0a1/src/mantispy/pp/_chatterjee.py +155 -0
  92. mantispy-0.1.0a1/src/mantispy/pp/_feature_qc.py +168 -0
  93. mantispy-0.1.0a1/src/mantispy/pp/_image_qc.py +199 -0
  94. mantispy-0.1.0a1/src/mantispy/pp/_names.py +63 -0
  95. mantispy-0.1.0a1/src/mantispy/pp/_normalize.py +184 -0
  96. mantispy-0.1.0a1/src/mantispy/pp/_outliers.py +113 -0
  97. mantispy-0.1.0a1/src/mantispy/pp/_qc.py +224 -0
  98. mantispy-0.1.0a1/src/mantispy/pp/_sample.py +77 -0
  99. mantispy-0.1.0a1/src/mantispy/pp/_select.py +460 -0
  100. mantispy-0.1.0a1/src/mantispy/pp/_sphere.py +507 -0
  101. mantispy-0.1.0a1/src/mantispy/pp/_transform.py +104 -0
  102. mantispy-0.1.0a1/src/mantispy/pp/_well_qc.py +94 -0
  103. mantispy-0.1.0a1/src/mantispy/py.typed +0 -0
  104. mantispy-0.1.0a1/src/mantispy/tl/__init__.py +70 -0
  105. mantispy-0.1.0a1/src/mantispy/tl/_aggregate.py +154 -0
  106. mantispy-0.1.0a1/src/mantispy/tl/_cluster.py +248 -0
  107. mantispy-0.1.0a1/src/mantispy/tl/_consensus.py +155 -0
  108. mantispy-0.1.0a1/src/mantispy/tl/_design.py +306 -0
  109. mantispy-0.1.0a1/src/mantispy/tl/_differential.py +263 -0
  110. mantispy-0.1.0a1/src/mantispy/tl/_distance.py +257 -0
  111. mantispy-0.1.0a1/src/mantispy/tl/_dose.py +1055 -0
  112. mantispy-0.1.0a1/src/mantispy/tl/_effect.py +285 -0
  113. mantispy-0.1.0a1/src/mantispy/tl/_empirical_fdr.py +175 -0
  114. mantispy-0.1.0a1/src/mantispy/tl/_enrich.py +357 -0
  115. mantispy-0.1.0a1/src/mantispy/tl/_gene_aggregation.py +245 -0
  116. mantispy-0.1.0a1/src/mantispy/tl/_guide_activity.py +88 -0
  117. mantispy-0.1.0a1/src/mantispy/tl/_heterogeneity.py +535 -0
  118. mantispy-0.1.0a1/src/mantispy/tl/_hits.py +361 -0
  119. mantispy-0.1.0a1/src/mantispy/tl/_knowledge.py +221 -0
  120. mantispy-0.1.0a1/src/mantispy/tl/_map.py +390 -0
  121. mantispy-0.1.0a1/src/mantispy/tl/_moa.py +211 -0
  122. mantispy-0.1.0a1/src/mantispy/tl/_network.py +110 -0
  123. mantispy-0.1.0a1/src/mantispy/tl/_ora.py +133 -0
  124. mantispy-0.1.0a1/src/mantispy/tl/_signature.py +127 -0
  125. mantispy-0.1.0a1/src/mantispy/tl/_similarity.py +246 -0
  126. mantispy-0.1.0a1/src/mantispy/tl/_transport.py +275 -0
@@ -0,0 +1,17 @@
1
+ # Based on pydata/xarray
2
+ codecov:
3
+ require_ci_to_pass: no
4
+
5
+ coverage:
6
+ status:
7
+ project:
8
+ default:
9
+ # Require 1% coverage, i.e., always succeed
10
+ target: 1
11
+ patch: false
12
+ changes: false
13
+
14
+ comment:
15
+ layout: diff, flags, files
16
+ behavior: once
17
+ require_base: no
@@ -0,0 +1,44 @@
1
+ {
2
+ "template": "https://github.com/scverse/cookiecutter-scverse",
3
+ "commit": "e6f473c32cd4bda50015ac236697ee3223c70bde",
4
+ "checkout": null,
5
+ "context": {
6
+ "cookiecutter": {
7
+ "project_name": "mantispy",
8
+ "package_name": "mantispy",
9
+ "project_description": "Image-based profiling on AnnData",
10
+ "author_full_name": "Tim Treis",
11
+ "author_email": "tim.treis@outlook.de",
12
+ "github_user": "scverse",
13
+ "github_repo": "mantispy",
14
+ "license": "BSD 3-Clause License",
15
+ "ide_integration": true,
16
+ "issue_categorization": "issue types",
17
+ "_copy_without_render": [
18
+ ".github/workflows/build.yaml",
19
+ ".github/workflows/test.yaml",
20
+ "docs/_templates/autosummary/**.rst"
21
+ ],
22
+ "_exclude_on_template_update": [
23
+ "CHANGELOG.md",
24
+ "LICENSE",
25
+ "README.md",
26
+ "docs/api.md",
27
+ "docs/index.md",
28
+ "docs/notebooks/example.ipynb",
29
+ "docs/references.bib",
30
+ "docs/references.md",
31
+ "src/**",
32
+ "tests/**"
33
+ ],
34
+ "_render_devdocs": false,
35
+ "_jinja2_env_vars": {
36
+ "lstrip_blocks": true,
37
+ "trim_blocks": true
38
+ },
39
+ "_template": "https://github.com/scverse/cookiecutter-scverse",
40
+ "_commit": "e6f473c32cd4bda50015ac236697ee3223c70bde"
41
+ }
42
+ },
43
+ "directory": null
44
+ }
@@ -0,0 +1,15 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 4
6
+ end_of_line = lf
7
+ charset = utf-8
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
10
+
11
+ [{*.{yml,yaml,toml},.cruft.json}]
12
+ indent_size = 2
13
+
14
+ [Makefile]
15
+ indent_style = tab
@@ -0,0 +1,93 @@
1
+ name: Bug report
2
+ description: Report something that is broken or incorrect
3
+ type: Bug
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ **Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)
9
+ detailing how to provide the necessary information for us to reproduce your bug. In brief:
10
+ * Please provide exact steps how to reproduce the bug in a clean Python environment.
11
+ * In case it's not clear what's causing this bug, please provide the data or the data generation procedure.
12
+ * Replicate problems on public datasets or share data subsets when full sharing isn't possible.
13
+
14
+ - type: textarea
15
+ id: report
16
+ attributes:
17
+ label: Report
18
+ description: A clear and concise description of what the bug is.
19
+ validations:
20
+ required: true
21
+
22
+ - type: textarea
23
+ id: versions
24
+ attributes:
25
+ label: Versions
26
+ description: |
27
+ Which version of packages.
28
+
29
+ Please install `session-info2`, run the following command in a notebook,
30
+ click the “Copy as Markdown” button, then paste the results into the text box below.
31
+
32
+ ```python
33
+ In[1]: import session_info2; session_info2.session_info(dependencies=True)
34
+ ```
35
+
36
+ Alternatively, run this in a console:
37
+
38
+ ```python
39
+ >>> import session_info2; print(session_info2.session_info(dependencies=True)._repr_mimebundle_()["text/markdown"])
40
+ ```
41
+ render: python
42
+ placeholder: |
43
+ anndata 0.11.3
44
+ ---- ----
45
+ charset-normalizer 3.4.1
46
+ coverage 7.7.0
47
+ psutil 7.0.0
48
+ dask 2024.7.1
49
+ jaraco.context 5.3.0
50
+ numcodecs 0.15.1
51
+ jaraco.functools 4.0.1
52
+ Jinja2 3.1.6
53
+ sphinxcontrib-jsmath 1.0.1
54
+ sphinxcontrib-htmlhelp 2.1.0
55
+ toolz 1.0.0
56
+ session-info2 0.1.2
57
+ PyYAML 6.0.2
58
+ llvmlite 0.44.0
59
+ scipy 1.15.2
60
+ pandas 2.2.3
61
+ sphinxcontrib-devhelp 2.0.0
62
+ h5py 3.13.0
63
+ tblib 3.0.0
64
+ setuptools-scm 8.2.0
65
+ more-itertools 10.3.0
66
+ msgpack 1.1.0
67
+ sparse 0.15.5
68
+ wrapt 1.17.2
69
+ jaraco.collections 5.1.0
70
+ numba 0.61.0
71
+ pyarrow 19.0.1
72
+ pytz 2025.1
73
+ MarkupSafe 3.0.2
74
+ crc32c 2.7.1
75
+ sphinxcontrib-qthelp 2.0.0
76
+ sphinxcontrib-serializinghtml 2.0.0
77
+ zarr 2.18.4
78
+ asciitree 0.3.3
79
+ six 1.17.0
80
+ sphinxcontrib-applehelp 2.0.0
81
+ numpy 2.1.3
82
+ cloudpickle 3.1.1
83
+ sphinxcontrib-bibtex 2.6.3
84
+ natsort 8.4.0
85
+ jaraco.text 3.12.1
86
+ setuptools 76.1.0
87
+ Deprecated 1.2.18
88
+ packaging 24.2
89
+ python-dateutil 2.9.0.post0
90
+ ---- ----
91
+ Python 3.13.2 | packaged by conda-forge | (main, Feb 17 2025, 14:10:22) [GCC 13.3.0]
92
+ OS Linux-6.11.0-109019-tuxedo-x86_64-with-glibc2.39
93
+ Updated 2025-03-18 15:47
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Scverse Community Forum
4
+ url: https://discourse.scverse.org/
5
+ about: If you have questions about “How to do X”, please ask them here.
@@ -0,0 +1,11 @@
1
+ name: Feature request
2
+ description: Propose a new feature for mantispy
3
+ type: Enhancement
4
+ body:
5
+ - type: textarea
6
+ id: description
7
+ attributes:
8
+ label: Description of feature
9
+ description: Please describe your suggestion for a new feature. It might help to describe a problem or use case, plus any alternatives that you have considered.
10
+ validations:
11
+ required: true
@@ -0,0 +1,21 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: pre-commit
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ cooldown:
8
+ default-days: 7
9
+ groups:
10
+ pre-commit:
11
+ patterns: ["*"]
12
+ - package-ecosystem: github-actions
13
+ directory: /
14
+ schedule:
15
+ interval: weekly
16
+ cooldown:
17
+ default-days: 7
18
+ groups:
19
+ actions-deps:
20
+ patterns:
21
+ - "*"
@@ -0,0 +1,29 @@
1
+ # The workflow name is mandated by autofix.ci.
2
+ # It needs to be a dedicated workflow, as autofix.ci times out on long runs.
3
+ name: autofix.ci
4
+
5
+ on:
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ lint:
14
+ name: Pre-commit checks
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
18
+ with:
19
+ fetch-depth: 0
20
+ filter: blob:none
21
+ persist-credentials: false
22
+ - uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
23
+ with:
24
+ enable-cache: true
25
+ - run: uv tool install hatch
26
+ - name: Run pre-commit hooks
27
+ run: uvx prek run --all-files --show-diff-on-failure --color=always
28
+ - uses: autofix-ci/action@c5b2d67aa2274e7b5a18224e8171550871fc7e4a # v1.3.4
29
+ if: '!cancelled()'
@@ -0,0 +1,30 @@
1
+ name: Check Build
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ package:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
21
+ with:
22
+ filter: blob:none
23
+ fetch-depth: 0
24
+ persist-credentials: false
25
+ - name: Install uv
26
+ uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
27
+ - name: Build package
28
+ run: uv build
29
+ - name: Check package
30
+ run: uvx twine check --strict dist/*.whl
@@ -0,0 +1,33 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ # Use "trusted publishing", see https://docs.pypi.org/trusted-publishers/
8
+ permissions: {}
9
+
10
+ jobs:
11
+ release:
12
+ name: Upload release to PyPI
13
+ runs-on: ubuntu-latest
14
+ environment:
15
+ name: pypi
16
+ url: https://pypi.org/p/mantispy
17
+ permissions:
18
+ contents: read
19
+ id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
20
+ steps:
21
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
22
+ with:
23
+ filter: blob:none
24
+ fetch-depth: 0
25
+ persist-credentials: false
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
28
+ with:
29
+ enable-cache: false
30
+ - name: Build package
31
+ run: uv build
32
+ - name: Publish package distributions to PyPI
33
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
@@ -0,0 +1,163 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ schedule:
9
+ - cron: "0 5 1,15 * *"
10
+
11
+ concurrency:
12
+ group: ${{ github.workflow }}-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ # Get the test environment from hatch as defined in pyproject.toml.
20
+ # This ensures that the pyproject.toml is the single point of truth for test definitions and the same tests are
21
+ # run locally and on continuous integration.
22
+ # Check [[tool.hatch.envs.hatch-test.matrix]] in pyproject.toml and https://hatch.pypa.io/latest/environment/ for
23
+ # more details.
24
+ get-environments:
25
+ runs-on: ubuntu-slim
26
+ outputs:
27
+ envs: ${{ steps.get-envs.outputs.envs }}
28
+ steps:
29
+ - &clone
30
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
31
+ with:
32
+ filter: blob:none
33
+ fetch-depth: 0
34
+ persist-credentials: false
35
+ - &setup-uv
36
+ uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
37
+ - name: Get test environments
38
+ id: get-envs
39
+ run: |
40
+ ENVS_JSON=$(uvx hatch env show --json | jq -c 'to_entries
41
+ | map(
42
+ select(.key | startswith("hatch-test"))
43
+ | {
44
+ name: .key,
45
+ label: (if (.key | contains("pre")) then .key + " (PRE-RELEASE DEPENDENCIES)" else .key end),
46
+ python: .value.python
47
+ }
48
+ )')
49
+ echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT
50
+
51
+ # Run tests through hatch. Spawns a separate runner for each environment defined in the hatch matrix obtained above.
52
+ test:
53
+ needs: get-environments
54
+ permissions:
55
+ id-token: write # for codecov OIDC
56
+ contents: read
57
+
58
+ strategy:
59
+ fail-fast: false
60
+ matrix:
61
+ os: [ubuntu-latest]
62
+ env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
63
+
64
+ name: ${{ matrix.env.label }}
65
+ runs-on: ${{ matrix.os }}
66
+ continue-on-error: ${{ contains(matrix.env.name, 'pre') }} # make "all-green" pass even if pre-release job fails
67
+ env:
68
+ UV_PYTHON: ${{ matrix.env.python }}
69
+
70
+ steps:
71
+ - *clone
72
+ - *setup-uv
73
+ - name: create hatch environment
74
+ run: uvx hatch env create ${{ matrix.env.name }}
75
+ - name: list all all installed package versions
76
+ run: uvx hatch run ${{ matrix.env.name }}:uv pip list
77
+ - name: run tests using hatch
78
+ env:
79
+ MPLBACKEND: agg
80
+ PLATFORM: ${{ matrix.os }}
81
+ DISPLAY: :42
82
+ run: uvx hatch run ${{ matrix.env.name }}:run-cov -v --color=yes -n auto
83
+ - name: generate coverage report
84
+ run: |
85
+ # See https://coverage.readthedocs.io/page/config.html#run-patch
86
+ test -f .coverage || uvx hatch run ${{ matrix.env.name }}:cov-combine
87
+ uvx hatch run ${{ matrix.env.name }}:cov-report # report visibly
88
+ uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload
89
+ - name: Upload coverage
90
+ uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
91
+ with:
92
+ fail_ci_if_error: true
93
+ use_oidc: true
94
+
95
+ # Check that all tests defined above pass. This makes it easy to set a single "required" test in branch
96
+ # protection instead of having to update it frequently. See https://github.com/re-actors/alls-green#why.
97
+ check:
98
+ name: Tests pass in all hatch environments
99
+ if: always()
100
+ needs:
101
+ - get-environments
102
+ - test
103
+ - tutorials
104
+ runs-on: ubuntu-latest
105
+ steps:
106
+ - uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0
107
+ with:
108
+ jobs: ${{ toJSON(needs) }}
109
+
110
+ ensure-data-is-cached:
111
+ runs-on: ubuntu-latest
112
+ steps:
113
+ - *clone
114
+ - *setup-uv
115
+ - &restore-data
116
+ name: Restore data cache
117
+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
118
+ with:
119
+ path: ~/.cache/mantispy # IMPORTANT: this will fail if mantispy.settings.cache_dir default changes
120
+ key: data-${{ hashFiles('**/download_data.py') }}
121
+ restore-keys: |
122
+ data-
123
+ enableCrossOsArchive: true
124
+ - name: Download datasets
125
+ # Always run to ensure any missing files are downloaded
126
+ # (restore-keys may provide partial cache)
127
+ run: uvx hatch run data:download
128
+
129
+ tutorials:
130
+ name: Tutorials run
131
+ needs: ensure-data-is-cached
132
+ runs-on: ubuntu-latest
133
+ steps:
134
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
135
+ with:
136
+ persist-credentials: false
137
+ - *setup-uv
138
+ - name: Restore the notebook execution cache
139
+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
140
+ with:
141
+ path: docs/_build/.jupyter_cache
142
+ key: jupyter-cache-${{ hashFiles('docs/tutorials/**/*.ipynb', 'src/mantispy/**/*.py') }}
143
+ - *restore-data
144
+ - name: Execute every notebook
145
+ run: uvx hatch run tutorials:run
146
+
147
+ # Non-blocking, main and schedule only (never on a pull request): rebuilds every staged variant from the
148
+ # current pipeline and compares against the shipped artifacts. The registry sha256 is the hard gate on
149
+ # downloads; this only has to notice on main if the pipeline diverges from the uploaded bytes. A rebuild
150
+ # pulls the raw inputs, sometimes multiple gigabytes, so it is too heavy to gate a pull request on. On
151
+ # drift: regenerate, re-upload, and re-pin the sha256 in registry.yaml.
152
+ data-drift-check:
153
+ name: Staged variants match the pipeline
154
+ if: github.event_name != 'pull_request'
155
+ needs: ensure-data-is-cached
156
+ runs-on: ubuntu-latest
157
+ continue-on-error: true
158
+ steps:
159
+ - *clone
160
+ - *setup-uv
161
+ - *restore-data
162
+ - name: Rebuild every variant and compare against the shipped artifacts
163
+ run: uvx hatch run data:drift-check --include-heavy
@@ -0,0 +1,28 @@
1
+ # Temp files
2
+ .DS_Store
3
+ *~
4
+ buck-out/
5
+
6
+ # Compiled files
7
+ .venv/
8
+ uv.lock
9
+ __pycache__/
10
+ .*cache/
11
+
12
+ # Distribution / packaging
13
+ /dist/
14
+ # written by scripts/build_dataset.py
15
+ /build/
16
+
17
+ # Tests and coverage
18
+ /data/
19
+ /node_modules/
20
+ /.coverage*
21
+
22
+ # docs
23
+ /docs/api/generated/
24
+ /docs/_build/
25
+
26
+ # planning docs kept out of the repo
27
+ mantispy_release_plan.md
28
+ /tasks/
@@ -0,0 +1,65 @@
1
+ fail_fast: false
2
+ default_language_version:
3
+ python: python3
4
+ default_stages:
5
+ - pre-commit
6
+ - pre-push
7
+ minimum_pre_commit_version: 2.16.0
8
+ repos:
9
+ - repo: https://github.com/biomejs/pre-commit
10
+ rev: v2.5.15
11
+ hooks:
12
+ - id: biome-format
13
+ exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually.
14
+ groups: [format]
15
+ - repo: https://github.com/tox-dev/pyproject-fmt
16
+ rev: v2.30.3
17
+ hooks:
18
+ - id: pyproject-fmt
19
+ groups: [format]
20
+ - repo: https://github.com/astral-sh/ruff-pre-commit
21
+ rev: v0.17.0
22
+ hooks:
23
+ - id: ruff-check
24
+ args: [--fix, --exit-non-zero-on-fix]
25
+ - id: ruff-format
26
+ groups: [format]
27
+ - repo: local
28
+ hooks:
29
+ - id: mypy
30
+ name: mypy
31
+ entry: hatch check types
32
+ language: system
33
+ types: [python]
34
+ files: ^(src|tests)/
35
+ require_serial: true
36
+ pass_filenames: false
37
+ groups: [typecheck]
38
+ - id: scrub-notebook-outputs
39
+ name: scrub-notebook-outputs
40
+ entry: python .scripts/ci/scrub_notebook_outputs.py
41
+ language: system
42
+ files: ^docs/.*\.ipynb$
43
+ groups: [format]
44
+ - repo: https://github.com/pre-commit/pre-commit-hooks
45
+ rev: v6.0.0
46
+ hooks:
47
+ - id: detect-private-key
48
+ - id: check-ast
49
+ - id: end-of-file-fixer
50
+ groups: [format]
51
+ - id: mixed-line-ending
52
+ args: [--fix=lf]
53
+ groups: [format]
54
+ - id: trailing-whitespace
55
+ groups: [format]
56
+ - id: check-case-conflict
57
+ # Check that there are no merge conflicts (could be generated by template sync)
58
+ - id: check-merge-conflict
59
+ args: [--assume-in-merge]
60
+
61
+ - repo: https://github.com/zizmorcore/zizmor-pre-commit
62
+ rev: v1.30.1
63
+ hooks:
64
+ - id: zizmor
65
+ args: [--no-progress, --fix]
@@ -0,0 +1,16 @@
1
+ # https://docs.readthedocs.io/page/config-file/v2.html
2
+ version: 2
3
+ build:
4
+ os: ubuntu-24.04
5
+ tools:
6
+ python: "3.14"
7
+ nodejs: latest
8
+ jobs:
9
+ create_environment:
10
+ - asdf plugin add uv
11
+ - asdf install uv latest
12
+ - asdf global uv latest
13
+ build:
14
+ html:
15
+ - uvx hatch run docs:build
16
+ - mv docs/_build $READTHEDOCS_OUTPUT
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env python3
2
+ """Download datasets to populate CI cache.
3
+
4
+ This script downloads every dataset the tutorials need.
5
+ The loaders cache to mantispy.settings.cache_dir.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import argparse
11
+
12
+ _CNT = 2 # increment this when you want to rebuild the CI cache
13
+
14
+ # The plates docs/tutorials/multisite/cross_laboratory.ipynb loads by name for its cross-source hierarchy.
15
+ _TARGET2_HIERARCHY = [
16
+ "JCPQC051", "JCPQC052", "JCPQC053", "JCPQC054",
17
+ "BR00121438", "BR00121439", "BR00126113", "BR00126114",
18
+ "110000294936", "110000296682", "110000296339", "110000296356",
19
+ ] # fmt: skip
20
+
21
+
22
+ def main(args: argparse.Namespace) -> None:
23
+ """Call each loader once, so its files and anything it assembles from them land in the cache."""
24
+ import mantispy as mt
25
+
26
+ def jump_lite_all() -> None:
27
+ """Every feature set, because tutorial 12 compares them and each is a separate file."""
28
+ for model in mt.ds.JUMP_LITE_MODELS:
29
+ mt.ds.jump_lite(model=model)
30
+ mt.ds.jump_lite_targets()
31
+
32
+ loaders = {
33
+ "bbbc021": mt.ds.bbbc021,
34
+ "rohban": mt.ds.rohban,
35
+ # The staged rohban variants, so tutorials and tests that load them hit the cache (<7 MB each).
36
+ "rohban_selected": lambda: mt.ds.rohban(feature_selected=True),
37
+ "rohban_gene": lambda: mt.ds.rohban(aggregated=True),
38
+ "rohban_gene_selected": lambda: mt.ds.rohban(aggregated=True, feature_selected=True),
39
+ "pki": mt.ds.pki,
40
+ # These two come to ~1.2 GB; all 141 plates would be 9.4 GB, over GitHub's 10 GB cache.
41
+ "jump_target2": mt.ds.jump_target2,
42
+ "jump_target2_hierarchy": lambda: mt.ds.jump_target2(plates=_TARGET2_HIERARCHY),
43
+ "jump_cells": mt.ds.jump_cells,
44
+ "jump_plate": mt.ds.jump_plate,
45
+ "jump_export": mt.ds.jump_export,
46
+ "jump_lite": jump_lite_all,
47
+ "oasis_pilot": mt.ds.oasis_pilot,
48
+ "jump_crispr": mt.ds.jump_crispr,
49
+ "corum": mt.ds.corum,
50
+ }
51
+ if args.dry_run:
52
+ print(f"Cache: {mt.settings.cache_dir}\nWould download: {', '.join(loaders)}")
53
+ return
54
+
55
+ for load in loaders.values():
56
+ load()
57
+
58
+
59
+ if __name__ == "__main__":
60
+ parser = argparse.ArgumentParser(description="Download datasets to populate CI cache.")
61
+ parser.add_argument(
62
+ "--dry-run",
63
+ action="store_true",
64
+ help="Do not download, just print what would be downloaded.",
65
+ )
66
+
67
+ main(parser.parse_args())