mantpy 0.2.0__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 (147) hide show
  1. mantpy-0.2.0/.codecov.yaml +19 -0
  2. mantpy-0.2.0/.cruft.json +20 -0
  3. mantpy-0.2.0/.editorconfig +15 -0
  4. mantpy-0.2.0/.github/ISSUE_TEMPLATE/bug_report.yml +93 -0
  5. mantpy-0.2.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  6. mantpy-0.2.0/.github/ISSUE_TEMPLATE/feature_request.yml +11 -0
  7. mantpy-0.2.0/.github/dependabot.yml +21 -0
  8. mantpy-0.2.0/.github/workflows/build.yaml +34 -0
  9. mantpy-0.2.0/.github/workflows/release.yaml +33 -0
  10. mantpy-0.2.0/.github/workflows/test.yaml +109 -0
  11. mantpy-0.2.0/.gitignore +35 -0
  12. mantpy-0.2.0/.pre-commit-config.yaml +44 -0
  13. mantpy-0.2.0/.readthedocs.yaml +28 -0
  14. mantpy-0.2.0/CHANGELOG.md +25 -0
  15. mantpy-0.2.0/CODE_OF_CONDUCT.md +16 -0
  16. mantpy-0.2.0/LICENSE +21 -0
  17. mantpy-0.2.0/PKG-INFO +215 -0
  18. mantpy-0.2.0/README.md +135 -0
  19. mantpy-0.2.0/biome.jsonc +17 -0
  20. mantpy-0.2.0/docs/_static/.gitkeep +0 -0
  21. mantpy-0.2.0/docs/_static/css/custom.css +248 -0
  22. mantpy-0.2.0/docs/_static/mantpy_logo.png +0 -0
  23. mantpy-0.2.0/docs/_static/mantpy_overview.png +0 -0
  24. mantpy-0.2.0/docs/_templates/.gitkeep +0 -0
  25. mantpy-0.2.0/docs/_templates/autosummary/module.rst +65 -0
  26. mantpy-0.2.0/docs/api.md +382 -0
  27. mantpy-0.2.0/docs/changelog.md +3 -0
  28. mantpy-0.2.0/docs/concepts.md +66 -0
  29. mantpy-0.2.0/docs/conf.py +158 -0
  30. mantpy-0.2.0/docs/contributing.md +328 -0
  31. mantpy-0.2.0/docs/datasets.md +60 -0
  32. mantpy-0.2.0/docs/extensions/typed_returns.py +32 -0
  33. mantpy-0.2.0/docs/index.md +43 -0
  34. mantpy-0.2.0/docs/installation.md +32 -0
  35. mantpy-0.2.0/docs/tutorials/advanced.md +79 -0
  36. mantpy-0.2.0/docs/tutorials/cell-ecm-graphs.md +107 -0
  37. mantpy-0.2.0/docs/tutorials/ecm-graphs.md +116 -0
  38. mantpy-0.2.0/docs/tutorials/export-anndata.md +130 -0
  39. mantpy-0.2.0/docs/tutorials/export-pytorch-geometric.md +136 -0
  40. mantpy-0.2.0/docs/tutorials/loading-data.md +117 -0
  41. mantpy-0.2.0/pyproject.toml +226 -0
  42. mantpy-0.2.0/src/mantpy/__init__.py +80 -0
  43. mantpy-0.2.0/src/mantpy/_constants.py +34 -0
  44. mantpy-0.2.0/src/mantpy/_core/__init__.py +1 -0
  45. mantpy-0.2.0/src/mantpy/_core/_edges.py +549 -0
  46. mantpy-0.2.0/src/mantpy/_core/_graph_mae_module.py +183 -0
  47. mantpy-0.2.0/src/mantpy/_core/_patching.py +534 -0
  48. mantpy-0.2.0/src/mantpy/_core/_permutation.py +159 -0
  49. mantpy-0.2.0/src/mantpy/_core/_segmentation.py +79 -0
  50. mantpy-0.2.0/src/mantpy/_palette.py +320 -0
  51. mantpy-0.2.0/src/mantpy/_plot_helpers.py +1435 -0
  52. mantpy-0.2.0/src/mantpy/_style.py +68 -0
  53. mantpy-0.2.0/src/mantpy/_utils.py +88 -0
  54. mantpy-0.2.0/src/mantpy/_version.py +24 -0
  55. mantpy-0.2.0/src/mantpy/datasets/__init__.py +25 -0
  56. mantpy-0.2.0/src/mantpy/datasets/_download.py +494 -0
  57. mantpy-0.2.0/src/mantpy/datasets/_loaders.py +742 -0
  58. mantpy-0.2.0/src/mantpy/datasets/_registry.py +41 -0
  59. mantpy-0.2.0/src/mantpy/datasets/_toy.py +152 -0
  60. mantpy-0.2.0/src/mantpy/ds.py +469 -0
  61. mantpy-0.2.0/src/mantpy/fetch.py +621 -0
  62. mantpy-0.2.0/src/mantpy/gr.py +2367 -0
  63. mantpy-0.2.0/src/mantpy/im.py +716 -0
  64. mantpy-0.2.0/src/mantpy/io.py +1119 -0
  65. mantpy-0.2.0/src/mantpy/nn/__init__.py +57 -0
  66. mantpy-0.2.0/src/mantpy/nn/_baselines.py +367 -0
  67. mantpy-0.2.0/src/mantpy/nn/_graph_mae.py +376 -0
  68. mantpy-0.2.0/src/mantpy/nn/_node_classifier.py +967 -0
  69. mantpy-0.2.0/src/mantpy/nn/_patch_encoder.py +647 -0
  70. mantpy-0.2.0/src/mantpy/nn/_utils.py +94 -0
  71. mantpy-0.2.0/src/mantpy/palette.py +10 -0
  72. mantpy-0.2.0/src/mantpy/pl.py +2535 -0
  73. mantpy-0.2.0/src/mantpy/pp.py +4235 -0
  74. mantpy-0.2.0/src/mantpy/style.py +5 -0
  75. mantpy-0.2.0/src/mantpy/tl.py +3987 -0
  76. mantpy-0.2.0/tests/conftest.py +83 -0
  77. mantpy-0.2.0/tests/test_anndata_serialization.py +143 -0
  78. mantpy-0.2.0/tests/test_coliv_raw_workflow.py +302 -0
  79. mantpy-0.2.0/tests/test_core_permutation.py +77 -0
  80. mantpy-0.2.0/tests/test_datasets.py +769 -0
  81. mantpy-0.2.0/tests/test_datasets_toy.py +102 -0
  82. mantpy-0.2.0/tests/test_ds_bunch.py +209 -0
  83. mantpy-0.2.0/tests/test_fetch.py +171 -0
  84. mantpy-0.2.0/tests/test_gr.py +642 -0
  85. mantpy-0.2.0/tests/test_gr_build_graph.py +75 -0
  86. mantpy-0.2.0/tests/test_gr_build_patch_graph.py +108 -0
  87. mantpy-0.2.0/tests/test_gr_connectivity_key.py +120 -0
  88. mantpy-0.2.0/tests/test_gr_ensure_cell_ecm_graph.py +63 -0
  89. mantpy-0.2.0/tests/test_gr_largest_component_radius_reconnect.py +115 -0
  90. mantpy-0.2.0/tests/test_gr_patch_anndata_interop.py +119 -0
  91. mantpy-0.2.0/tests/test_gr_sparse_joint.py +134 -0
  92. mantpy-0.2.0/tests/test_he_api.py +393 -0
  93. mantpy-0.2.0/tests/test_im.py +194 -0
  94. mantpy-0.2.0/tests/test_imports.py +37 -0
  95. mantpy-0.2.0/tests/test_io.py +350 -0
  96. mantpy-0.2.0/tests/test_io_to_spatialdata.py +115 -0
  97. mantpy-0.2.0/tests/test_nn_baselines.py +187 -0
  98. mantpy-0.2.0/tests/test_nn_graph_mae.py +165 -0
  99. mantpy-0.2.0/tests/test_nn_namespace.py +97 -0
  100. mantpy-0.2.0/tests/test_nn_patch_encoder.py +219 -0
  101. mantpy-0.2.0/tests/test_nn_utils.py +60 -0
  102. mantpy-0.2.0/tests/test_node_classifier_grouped.py +144 -0
  103. mantpy-0.2.0/tests/test_node_classifier_summary.py +192 -0
  104. mantpy-0.2.0/tests/test_palette_factor_palette.py +47 -0
  105. mantpy-0.2.0/tests/test_pl.py +346 -0
  106. mantpy-0.2.0/tests/test_pl_cell_ecm_enrichment_heatmap.py +146 -0
  107. mantpy-0.2.0/tests/test_pl_ecm_resolution_selection.py +86 -0
  108. mantpy-0.2.0/tests/test_plot_helpers_cell_ecm_enrichment_bars.py +175 -0
  109. mantpy-0.2.0/tests/test_plot_helpers_channel_overlay_scalebar.py +107 -0
  110. mantpy-0.2.0/tests/test_plot_helpers_cluster_map.py +134 -0
  111. mantpy-0.2.0/tests/test_plot_helpers_delta_masked.py +117 -0
  112. mantpy-0.2.0/tests/test_plot_helpers_lesion_metric_view.py +148 -0
  113. mantpy-0.2.0/tests/test_plot_helpers_marker_otsu_composite.py +43 -0
  114. mantpy-0.2.0/tests/test_plot_helpers_mean_composition.py +115 -0
  115. mantpy-0.2.0/tests/test_plot_helpers_patch_domain_map.py +44 -0
  116. mantpy-0.2.0/tests/test_plot_helpers_serialised_image_container.py +74 -0
  117. mantpy-0.2.0/tests/test_pp.py +633 -0
  118. mantpy-0.2.0/tests/test_pp_segment.py +239 -0
  119. mantpy-0.2.0/tests/test_pp_structure.py +434 -0
  120. mantpy-0.2.0/tests/test_public_api_contract.py +327 -0
  121. mantpy-0.2.0/tests/test_runtime.py +34 -0
  122. mantpy-0.2.0/tests/test_schistosoma_graph_workflow.py +41 -0
  123. mantpy-0.2.0/tests/test_schistosoma_pp_workflow.py +232 -0
  124. mantpy-0.2.0/tests/test_schistosoma_raw_loader.py +36 -0
  125. mantpy-0.2.0/tests/test_style.py +87 -0
  126. mantpy-0.2.0/tests/test_tl.py +322 -0
  127. mantpy-0.2.0/tests/test_tl_cell_ecm_enrichment.py +142 -0
  128. mantpy-0.2.0/tests/test_tl_cell_ecm_enrichment_matrix.py +142 -0
  129. mantpy-0.2.0/tests/test_tl_cluster_cooccurrence_perm.py +129 -0
  130. mantpy-0.2.0/tests/test_tl_compute_cluster_composition.py +97 -0
  131. mantpy-0.2.0/tests/test_tl_cross_compartment_ablation.py +272 -0
  132. mantpy-0.2.0/tests/test_tl_lesion_central_void.py +78 -0
  133. mantpy-0.2.0/tests/test_tl_lesion_stats_metadata_merge.py +62 -0
  134. mantpy-0.2.0/tests/test_tl_lesion_topology_stats_central_hole.py +127 -0
  135. mantpy-0.2.0/tests/test_tl_loo_denoise.py +121 -0
  136. mantpy-0.2.0/tests/test_tl_loo_denoise_groupby.py +210 -0
  137. mantpy-0.2.0/tests/test_tl_pick_representative_samples.py +87 -0
  138. mantpy-0.2.0/tests/test_tl_score_partition.py +49 -0
  139. mantpy-0.2.0/tests/test_tl_select_n_domains.py +128 -0
  140. mantpy-0.2.0/tests/test_tl_spatial_transfer.py +196 -0
  141. mantpy-0.2.0/tests/test_tl_summarize_largest_lesion.py +78 -0
  142. mantpy-0.2.0/tests/test_tutorial_analysis_helpers.py +234 -0
  143. mantpy-0.2.0/tests/test_tutorial_graph_helper.py +64 -0
  144. mantpy-0.2.0/tests/test_tutorial_io_helpers.py +74 -0
  145. mantpy-0.2.0/tests/test_tutorial_plot_helpers.py +123 -0
  146. mantpy-0.2.0/tests/test_tutorial_pp_workflow.py +151 -0
  147. mantpy-0.2.0/tests/test_utils.py +42 -0
@@ -0,0 +1,19 @@
1
+ # Based on pydata/xarray
2
+ codecov:
3
+ require_ci_to_pass: no
4
+
5
+ coverage:
6
+ status:
7
+ project:
8
+ default:
9
+ target: auto
10
+ threshold: 1%
11
+ patch:
12
+ default:
13
+ target: 80%
14
+ changes: false
15
+
16
+ comment:
17
+ layout: diff, flags, files
18
+ behavior: once
19
+ require_base: no
@@ -0,0 +1,20 @@
1
+ {
2
+ "template": "https://github.com/scverse/cookiecutter-scverse",
3
+ "commit": "e2ed7b27425642fa3eb759f0457a2d5d9bd961f2",
4
+ "checkout": null,
5
+ "context": {
6
+ "cookiecutter": {
7
+ "project_name": "mantpy",
8
+ "package_name": "mantpy",
9
+ "project_description": "scverse-aligned spatial omics and ECM analysis on multiplexed imaging and spatial transcriptomics",
10
+ "author_full_name": "Mohamed Ghafoor",
11
+ "author_email": "moeghaf@gmail.com",
12
+ "github_user": "moeghaf",
13
+ "github_repo": "Mantpy",
14
+ "license": "MIT License",
15
+ "ide_integration": "false",
16
+ "_template": "https://github.com/scverse/cookiecutter-scverse"
17
+ }
18
+ },
19
+ "directory": null
20
+ }
@@ -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 mantpy
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,34 @@
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@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
27
+ - name: Build package
28
+ run: uv build
29
+ - name: Check package
30
+ run: uvx twine check --strict dist/*
31
+ - name: Build documentation strictly
32
+ run: >-
33
+ uv run --group doc --extra gnn --extra patch
34
+ sphinx-build -M html docs docs/_build -W --keep-going
@@ -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/mantpy
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@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
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@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
@@ -0,0 +1,109 @@
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
+ name: Install uv
37
+ uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
38
+ - name: Get test environments
39
+ id: get-envs
40
+ run: |
41
+ ENVS_JSON=$(uvx hatch env show --json | jq -c 'to_entries
42
+ | map(
43
+ select(.key | startswith("hatch-test"))
44
+ | {
45
+ name: .key,
46
+ label: (if (.key | contains("pre")) then .key + " (PRE-RELEASE DEPENDENCIES)" else .key end),
47
+ python: .value.python
48
+ }
49
+ )')
50
+ echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT
51
+
52
+ # Run tests through hatch. Spawns a separate runner for each environment defined in the hatch matrix obtained above.
53
+ test:
54
+ needs: get-environments
55
+ permissions:
56
+ id-token: write # for codecov OIDC
57
+ contents: read
58
+
59
+ strategy:
60
+ fail-fast: false
61
+ matrix:
62
+ os: [ubuntu-latest]
63
+ env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
64
+
65
+ name: ${{ matrix.env.label }}
66
+ runs-on: ${{ matrix.os }}
67
+ continue-on-error: ${{ contains(matrix.env.name, 'pre') }} # make "all-green" pass even if pre-release job fails
68
+ env:
69
+ UV_PYTHON: ${{ matrix.env.python }}
70
+
71
+ steps:
72
+ - *clone
73
+ - *setup-uv
74
+ - name: create hatch environment
75
+ run: uvx hatch env create ${{ matrix.env.name }}
76
+ - name: list all all installed package versions
77
+ run: uvx hatch run ${{ matrix.env.name }}:uv pip list
78
+ - name: run tests using hatch
79
+ env:
80
+ MPLBACKEND: agg
81
+ PLATFORM: ${{ matrix.os }}
82
+ DISPLAY: :42
83
+ run: uvx hatch run ${{ matrix.env.name }}:run-cov -v --color=yes -n auto
84
+ - name: generate coverage report
85
+ run: |
86
+ # See https://coverage.readthedocs.io/en/latest/config.html#run-patch
87
+ test -f .coverage || uvx hatch run ${{ matrix.env.name }}:cov-combine
88
+ uvx hatch run ${{ matrix.env.name }}:cov-report # report visibly
89
+ uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload
90
+ - name: Upload coverage
91
+ uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
92
+ with:
93
+ # Test success must not depend on an external reporting integration.
94
+ fail_ci_if_error: false
95
+ use_oidc: true
96
+
97
+ # Check that all tests defined above pass. This makes it easy to set a single "required" test in branch
98
+ # protection instead of having to update it frequently. See https://github.com/re-actors/alls-green#why.
99
+ check:
100
+ name: Tests pass in all hatch environments
101
+ if: always()
102
+ needs:
103
+ - get-environments
104
+ - test
105
+ runs-on: ubuntu-latest
106
+ steps:
107
+ - uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
108
+ with:
109
+ jobs: ${{ toJSON(needs) }}
@@ -0,0 +1,35 @@
1
+ # Temp files
2
+ .DS_Store
3
+ *~
4
+ buck-out/
5
+
6
+ # IDEs
7
+ /.idea/
8
+ /.vscode/
9
+
10
+ # Compiled files
11
+ .venv*/
12
+ __pycache__/
13
+ .*cache/
14
+
15
+ # Distribution / packaging
16
+ /dist/
17
+
18
+ # Tests and coverage
19
+ /data/
20
+ /node_modules/
21
+ /.coverage*
22
+
23
+ # docs
24
+ /docs/generated/
25
+ /docs/_build/
26
+
27
+ # Local-only tooling / editor workspaces
28
+ .claude/
29
+ .codex/
30
+
31
+ # Stray test render artifact
32
+ /tests/_bgfix_triptych.png
33
+
34
+ # hatch-vcs auto-generated version file
35
+ src/mantpy/_version.py
@@ -0,0 +1,44 @@
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.4
11
+ hooks:
12
+ - id: biome-format
13
+ exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually.
14
+ - repo: https://github.com/tox-dev/pyproject-fmt
15
+ rev: v2.25.3
16
+ hooks:
17
+ - id: pyproject-fmt
18
+ - repo: https://github.com/astral-sh/ruff-pre-commit
19
+ rev: v0.15.22
20
+ hooks:
21
+ - id: ruff-check
22
+ types_or: [python, pyi, jupyter]
23
+ args: [--fix, --exit-non-zero-on-fix]
24
+ - id: ruff-format
25
+ types_or: [python, pyi, jupyter]
26
+ - repo: https://github.com/pre-commit/pre-commit-hooks
27
+ rev: v6.0.0
28
+ hooks:
29
+ - id: detect-private-key
30
+ - id: check-ast
31
+ - id: end-of-file-fixer
32
+ - id: mixed-line-ending
33
+ args: [--fix=lf]
34
+ - id: trailing-whitespace
35
+ - id: check-case-conflict
36
+ # Check that there are no merge conflicts (could be generated by template sync)
37
+ - id: check-merge-conflict
38
+ args: [--assume-in-merge]
39
+
40
+ - repo: https://github.com/zizmorcore/zizmor-pre-commit
41
+ rev: v1.27.0
42
+ hooks:
43
+ - id: zizmor
44
+ args: [--no-progress, --fix]
@@ -0,0 +1,28 @@
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
+ # Read the Docs clones shallow and without tags. hatch-vcs derives the
10
+ # version from `git describe`, so without this the docs advertise
11
+ # `0.1.dev1+g<sha>` instead of the released version.
12
+ #
13
+ # Two commands on purpose. Published history is a single commit, so the
14
+ # `--depth 1` clone is already complete and `--unshallow` aborts with
15
+ # "does not make sense"; combined as one command that failure would take
16
+ # the tag fetch with it and the version would stay `0.1.dev1` even after
17
+ # the release is tagged.
18
+ post_checkout:
19
+ - git fetch --unshallow || true
20
+ - git fetch --tags --force || true
21
+ create_environment:
22
+ - asdf plugin add uv
23
+ - asdf install uv latest
24
+ - asdf global uv latest
25
+ build:
26
+ html:
27
+ - uv run --group doc --extra gnn --extra patch sphinx-build -M html docs docs/_build -W
28
+ - mv docs/_build $READTHEDOCS_OUTPUT
@@ -0,0 +1,25 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog][],
6
+ and this project adheres to [Semantic Versioning][].
7
+
8
+ [keep a changelog]: https://keepachangelog.com/en/1.0.0/
9
+ [semantic versioning]: https://semver.org/spec/v2.0.0.html
10
+
11
+ ## [Unreleased]
12
+
13
+ ## [0.2.0]
14
+
15
+ ### Added
16
+
17
+ - AnnData-native ECM image patches, spatial graph construction, cell–ECM
18
+ integration, clustering, permutation analysis, and topology tools.
19
+ - Optional patch encoders, GraphMAE representations, node classification, and
20
+ neighbour-composition baselines.
21
+ - Reusable plotting, palette, and explicit publication-style helpers for Mantpy
22
+ analysis outputs.
23
+ - Verified one-line loaders for the four public tutorial datasets, with safe
24
+ caching, integrity checks, progress reporting, and source citations.
25
+ - Scanpy, Squidpy, PyTorch Geometric, SpatialData, and H5AD interoperability.
@@ -0,0 +1,16 @@
1
+ # Code of Conduct
2
+
3
+ The mantpy project is part of the [scverse](https://scverse.org) ecosystem and
4
+ adopts the **Contributor Covenant**, version 2.1, as its Code of Conduct.
5
+
6
+ The full text is available at:
7
+ <https://www.contributor-covenant.org/version/2/1/code_of_conduct/>
8
+
9
+ All participants in mantpy project spaces — contributors, maintainers and users —
10
+ are expected to follow it, and to uphold the wider
11
+ [scverse community standards](https://scverse.org/about/).
12
+
13
+ ## Reporting
14
+
15
+ To report an issue or a possible violation, contact the maintainer at
16
+ **moeghaf@gmail.com**. Reports will be reviewed and handled confidentially.
mantpy-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026, Mohamed Ghafoor
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.