Skip to content

Commit 0590b4e

Browse files
author
leotenshii
committed
thesis notebooks
1 parent e1481e8 commit 0590b4e

155 files changed

Lines changed: 27328 additions & 118725 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: Bug report
2+
description: Report something that is broken or incorrect
3+
labels: 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+
* Sometimes it is not possible to share the data, but usually it is possible to replicate problems on publicly
13+
available datasets or to share a subset of your data.
14+
15+
- type: textarea
16+
id: report
17+
attributes:
18+
label: Report
19+
description: A clear and concise description of what the bug is.
20+
validations:
21+
required: true
22+
23+
- type: textarea
24+
id: versions
25+
attributes:
26+
label: Versions
27+
description: |
28+
Which version of packages.
29+
30+
Please install `session-info2`, run the following command in a notebook,
31+
click the “Copy as Markdown” button, then paste the results into the text box below.
32+
33+
```python
34+
In[1]: import session_info2; session_info2.session_info(dependencies=True)
35+
```
36+
37+
Alternatively, run this in a console:
38+
39+
```python
40+
>>> import session_info2; print(session_info2.session_info(dependencies=True)._repr_mimebundle_()["text/markdown"])
41+
```
42+
render: python
43+
placeholder: |
44+
scanpy 1.11.1
45+
pandas 2.2.3
46+
numpy 2.1.3
47+
plotnine 0.14.5
48+
decoupler 1.9.2
49+
liana 1.5.1
50+
partipy 0.0.1
51+
---- ----
52+
decorator 5.2.1
53+
session-info2 0.1.2
54+
pytz 2025.2
55+
pyzmq 26.3.0
56+
debugpy 1.8.13
57+
python-dateutil 2.9.0.post0
58+
setuptools 75.8.2
59+
pyparsing 3.2.3
60+
appnope 0.1.4
61+
stack_data 0.6.3
62+
zipp 3.21.0
63+
ptyprocess 0.7.0
64+
threadpoolctl 3.6.0
65+
kiwisolver 1.4.8
66+
typing_extensions 4.13.0
67+
pyarrow 20.0.0
68+
zarr 2.18.7
69+
plotly 6.0.1
70+
defusedxml 0.7.1
71+
PyYAML 6.0.2
72+
packaging 24.2
73+
cloudpickle 3.1.1
74+
jedi 0.19.2
75+
asciitree 0.3.3
76+
patsy 1.0.1
77+
comm 0.2.2
78+
sphinxcontrib-htmlhelp 2.1.0
79+
Jinja2 3.1.6
80+
numba 0.61.0
81+
executing 2.1.0
82+
mudata 0.3.1
83+
sphinxcontrib-devhelp 2.0.0
84+
wcwidth 0.2.13
85+
pexpect 4.9.0
86+
statsmodels 0.14.4
87+
sphinxcontrib-applehelp 2.0.0
88+
parso 0.8.4
89+
Pygments 2.19.1
90+
matplotlib 3.10.1
91+
traitlets 5.14.3
92+
scikit-learn 1.5.2
93+
pure_eval 0.2.3
94+
wrapt 1.17.2
95+
Deprecated 1.2.18
96+
natsort 8.4.0
97+
platformdirs 4.3.7
98+
prompt_toolkit 3.0.50
99+
legacy-api-wrap 1.4.1
100+
MarkupSafe 3.0.2
101+
ipykernel 6.29.5
102+
tabulate 0.9.0
103+
anndata 0.11.4
104+
h5py 3.13.0
105+
mizani 0.13.1
106+
sphinxcontrib-serializinghtml 2.0.0
107+
tqdm 4.67.1
108+
dask 2024.11.2
109+
sphinxcontrib-jquery 4.1
110+
jupyter_core 5.7.2
111+
networkx 3.4.2
112+
sphinxcontrib-qthelp 2.0.0
113+
xarray 2024.11.0
114+
numcodecs 0.15.1
115+
scipy 1.15.2
116+
charset-normalizer 3.4.1
117+
six 1.17.0
118+
toolz 1.0.0
119+
ipywidgets 8.1.5
120+
importlib_metadata 8.6.1
121+
asttokens 3.0.0
122+
llvmlite 0.44.0
123+
ipython 9.0.2
124+
joblib 1.4.2
125+
psutil 7.0.0
126+
jupyter_client 8.6.3
127+
pillow 11.1.0
128+
docrep 0.3.2
129+
sphinxcontrib-jsmath 1.0.1
130+
cycler 0.12.1
131+
coverage 7.8.0
132+
narwhals 1.32.0
133+
tornado 6.4.2
134+
---- ----
135+
Python 3.11.11 | packaged by conda-forge | (main, Mar 3 2025, 20:44:07) [Clang 18.1.8 ]
136+
OS macOS-15.4.1-arm64-arm-64bit
137+
Updated 2025-05-09 09:44
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Feature Request
2+
description: Suggest a new feature or enhancement for the Partipy package.
3+
labels: enhancement
4+
body:
5+
- type: textarea
6+
id: feature-description
7+
attributes:
8+
label: Feature Description
9+
description: Describe the feature you are requesting. It might help to describe a problem or use case. If applicable, mention any alternative approaches you have considered.
10+
validations:
11+
required: true
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Question
2+
description: Ask a question about how to use the Partipy package or about the underlying theory.
3+
labels: question
4+
body:
5+
- type: textarea
6+
id: question
7+
attributes:
8+
label: Your Question
9+
description: Describe your question. If it relates to a specific function or workflow in Partipy, please mention it. Feel free to include example code or errors you're encountering.
10+
placeholder: |
11+
Example:
12+
validations:
13+
required: true

.github/workflows/build.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
defaults:
14+
run:
15+
# to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
16+
shell: bash -euo pipefail {0}
17+
18+
jobs:
19+
package:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
filter: blob:none
25+
fetch-depth: 0
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v5
28+
with:
29+
cache-dependency-glob: pyproject.toml
30+
- name: Build package
31+
run: uv build
32+
- name: Check package
33+
run: uvx twine check --strict dist/*.whl

.github/workflows/testing.yaml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
# runs at 05:00 UTC on the 1st and 15th of each month.
10+
- cron: "0 5 1,15 * *"
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
defaults:
17+
run:
18+
# to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
19+
shell: bash -euo pipefail {0}
20+
21+
jobs:
22+
# Get the test environment from hatch as defined in pyproject.toml.
23+
# This ensures that the pyproject.toml is the single point of truth for test definitions and the same tests are
24+
# run locally and on continuous integration.
25+
# Check [[tool.hatch.envs.hatch-test.matrix]] in pyproject.toml and https://hatch.pypa.io/latest/environment/
26+
get-environments:
27+
runs-on: ubuntu-latest
28+
outputs:
29+
envs: ${{ steps.get-envs.outputs.envs }}
30+
steps:
31+
- name: Clone repository code into the GitHub Actions runner
32+
uses: actions/checkout@v4
33+
with:
34+
filter: blob:none
35+
fetch-depth: 0
36+
- name: Install uv
37+
uses: astral-sh/setup-uv@v5
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+
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
os: [ubuntu-latest]
60+
env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
61+
62+
name: ${{ matrix.env.label }}
63+
runs-on: ${{ matrix.os }}
64+
65+
steps:
66+
- uses: actions/checkout@v4
67+
with:
68+
filter: blob:none
69+
fetch-depth: 0
70+
- name: Install uv
71+
uses: astral-sh/setup-uv@v5
72+
with:
73+
python-version: ${{ matrix.env.python }}
74+
cache-dependency-glob: pyproject.toml
75+
- name: create hatch environment
76+
run: uvx hatch env create ${{ matrix.env.name }}
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
83+
- name: Upload coverage reports to Codecov
84+
uses: codecov/codecov-action@v5
85+
with:
86+
token: ${{ secrets.CODECOV_TOKEN }}
87+
88+
# Check that all tests defined above pass. This makes it easy to set a single "required" test in branch
89+
# protection instead of having to update it frequently. See https://github.com/re-actors/alls-green#why.
90+
check:
91+
name: Tests pass in all hatch environments
92+
if: always()
93+
needs:
94+
- get-environments
95+
- test
96+
runs-on: ubuntu-latest
97+
steps:
98+
- uses: re-actors/alls-green@release/v1
99+
with:
100+
jobs: ${{ toJSON(needs) }}

.gitignore

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,38 @@
1-
# compiled code
2-
*.pyc
3-
41
# IDE stuff
52
.vscode/
63

7-
# caches
4+
# caches and compiled files
5+
*.pyc
86
__pycache__/
97
.mypy_cache
108
.ruff_cache
119
.pytest_cache
10+
.venv/
1211

13-
# data directory
14-
data/*
12+
# Distribution / packaging
13+
/dist/
1514

16-
# mac stuff
15+
# temp files
1716
.DS_Store
1817

1918
# package stuff
2019
partipy.egg-info/
2120
build/*
2221
.coverage
2322

24-
# others
25-
spams
23+
# docs
24+
/docs/_build/
25+
/docs/generated/
26+
docs/api/generated
27+
/docs/notebooks/data
28+
/docs/notebooks/*.h5ad
29+
/docs/notebooks/*.sqlite
30+
/docs/notebooks/*.txt.gz
31+
32+
# log files
33+
*.log
34+
.coverage*
35+
coverage.xml
36+
37+
# jupyter
38+
.ipynb_checkpoints/

.pre-commit-config.yaml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
fail_fast: false # do not stop after failure (can still interupt manually...)
2+
3+
ci:
4+
skip: [testing] # pre-commit.ci should ignore the testing hook
5+
26
repos:
37
# Add some general purpose useful hooks
48
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -24,29 +28,29 @@ repos:
2428
# Check for python syntax errors
2529
- id: check-ast
2630

31+
# formating / linting with ruff
2732
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: v0.9.9
33+
rev: v0.11.10
2934
hooks:
3035
- id: ruff
3136
types_or: [python] # ignore jupyter for now [python, jupyter]
3237
args: [--fix]
3338
- id: ruff-format
3439
types_or: [python] # ignore jupyter for now [python, jupyter]
3540

36-
# pytest hook to run tests on commit
37-
- repo: local
38-
hooks:
39-
- id: pytest
40-
name: Run pytest
41-
#entry: pytest --cov partipy --cov-report=html
42-
entry: pytest
43-
language: system
44-
types: [python]
45-
pass_filenames: false
46-
always_run: true
47-
4841
# type checking
4942
- repo: https://github.com/pre-commit/mirrors-mypy
5043
rev: v1.15.0
5144
hooks:
5245
- id: mypy
46+
47+
# pytest hook to run tests on commit
48+
# - repo: local
49+
# hooks:
50+
# - id: testing
51+
# name: Run pytest
52+
# entry: uvx hatch run hatch-test.py3.10-stable:pytest
53+
# language: system
54+
# types: [python]
55+
# pass_filenames: false # ignore file changes?
56+
# always_run: true

0 commit comments

Comments
 (0)