Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"template": "https://github.com/scverse/cookiecutter-scverse",
"commit": "384fc74318d2afc7ad1d5bda7d0fb3dfbe2fea28",
"checkout": null,
"commit": "d383d94fadff9e4e6fdb59d77c68cb900d7cedec",
"checkout": "v0.6.0",
"context": {
"cookiecutter": {
"project_name": "torchgmm",
Expand All @@ -10,19 +10,33 @@
"author_full_name": "Marco Varrone",
"author_email": "[email protected]",
"github_user": "marcovarrone",
"project_repo": "https://github.com/CSOgroup/torchgmm",
"github_repo": "torchgmm",
"license": "MIT License",
"ide_integration": true,
"_copy_without_render": [
".github/workflows/build.yaml",
".github/workflows/test.yaml",
"docs/_templates/autosummary/**.rst"
],
"_exclude_on_template_update": [
"CHANGELOG.md",
"LICENSE",
"README.md",
"docs/api.md",
"docs/index.md",
"docs/notebooks/example.ipynb",
"docs/references.bib",
"docs/references.md",
"src/**",
"tests/**"
],
"_render_devdocs": false,
"_jinja2_env_vars": {
"lstrip_blocks": true,
"trim_blocks": true
},
"_template": "https://github.com/scverse/cookiecutter-scverse"
"_template": "https://github.com/scverse/cookiecutter-scverse",
"_commit": "d383d94fadff9e4e6fdb59d77c68cb900d7cedec"
}
},
"directory": null
Expand Down
5 changes: 1 addition & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{yml,yaml}]
indent_size = 2

[.cruft.json]
[{*.{yml,yaml,toml},.cruft.json}]
indent_size = 2

[Makefile]
Expand Down
123 changes: 64 additions & 59 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,67 +23,72 @@ body:
- type: textarea
id: versions
attributes:
label: Version information
label: Versions
description: |
Please paste below the output of
Which version of packages.

Please install `session-info2`, run the following command in a notebook,
click the “Copy as Markdown” button, then paste the results into the text box below.

```python
In[1]: import session_info2; session_info2.session_info(dependencies=True)
```

Alternatively, run this in a console:

```python
import session_info
session_info.show(html=False, dependencies=True)
>>> import session_info2; print(session_info2.session_info(dependencies=True)._repr_mimebundle_()["text/markdown"])
```
render: python
placeholder: |
-----
anndata 0.8.0rc2.dev27+ge524389
session_info 1.0.0
-----
asttokens NA
awkward 1.8.0
backcall 0.2.0
cython_runtime NA
dateutil 2.8.2
debugpy 1.6.0
decorator 5.1.1
entrypoints 0.4
executing 0.8.3
h5py 3.7.0
ipykernel 6.15.0
jedi 0.18.1
mpl_toolkits NA
natsort 8.1.0
numpy 1.22.4
packaging 21.3
pandas 1.4.2
parso 0.8.3
pexpect 4.8.0
pickleshare 0.7.5
pkg_resources NA
prompt_toolkit 3.0.29
psutil 5.9.1
ptyprocess 0.7.0
pure_eval 0.2.2
pydev_ipython NA
pydevconsole NA
pydevd 2.8.0
pydevd_file_utils NA
pydevd_plugins NA
pydevd_tracing NA
pygments 2.12.0
pytz 2022.1
scipy 1.8.1
setuptools 62.5.0
setuptools_scm NA
six 1.16.0
stack_data 0.3.0
tornado 6.1
traitlets 5.3.0
wcwidth 0.2.5
zmq 23.1.0
-----
IPython 8.4.0
jupyter_client 7.3.4
jupyter_core 4.10.0
-----
Python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 16:58:50) [GCC 10.3.0]
Linux-5.18.6-arch1-1-x86_64-with-glibc2.35
-----
Session information updated at 2022-07-07 17:55
anndata 0.11.3
---- ----
charset-normalizer 3.4.1
coverage 7.7.0
psutil 7.0.0
dask 2024.7.1
jaraco.context 5.3.0
numcodecs 0.15.1
jaraco.functools 4.0.1
Jinja2 3.1.6
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-htmlhelp 2.1.0
toolz 1.0.0
session-info2 0.1.2
PyYAML 6.0.2
llvmlite 0.44.0
scipy 1.15.2
pandas 2.2.3
sphinxcontrib-devhelp 2.0.0
h5py 3.13.0
tblib 3.0.0
setuptools-scm 8.2.0
more-itertools 10.3.0
msgpack 1.1.0
sparse 0.15.5
wrapt 1.17.2
jaraco.collections 5.1.0
numba 0.61.0
pyarrow 19.0.1
pytz 2025.1
MarkupSafe 3.0.2
crc32c 2.7.1
sphinxcontrib-qthelp 2.0.0
sphinxcontrib-serializinghtml 2.0.0
zarr 2.18.4
asciitree 0.3.3
six 1.17.0
sphinxcontrib-applehelp 2.0.0
numpy 2.1.3
cloudpickle 3.1.1
sphinxcontrib-bibtex 2.6.3
natsort 8.4.0
jaraco.text 3.12.1
setuptools 76.1.0
Deprecated 1.2.18
packaging 24.2
python-dateutil 2.9.0.post0
---- ----
Python 3.13.2 | packaged by conda-forge | (main, Feb 17 2025, 14:10:22) [GCC 13.3.0]
OS Linux-6.11.0-109019-tuxedo-x86_64-with-glibc2.39
Updated 2025-03-18 15:47
24 changes: 14 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,24 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
# to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
shell: bash -euo pipefail {0}

jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
- uses: actions/checkout@v4
with:
filter: blob:none
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "**/pyproject.toml"
- name: Install build dependencies
run: python -m pip install --upgrade pip wheel twine build
cache-dependency-glob: pyproject.toml
- name: Build package
run: python -m build
run: uv build
- name: Check package
run: twine check --strict dist/*.whl
run: uvx twine check --strict dist/*.whl
15 changes: 10 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
release:
types: [published]

defaults:
run:
# to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
shell: bash -euo pipefail {0}

# Use "trusted publishing", see https://docs.pypi.org/trusted-publishers/
jobs:
release:
Expand All @@ -19,11 +24,11 @@ jobs:
with:
filter: blob:none
fetch-depth: 0
- uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.x"
cache: "pip"
- run: pip install build
- run: python -m build
cache-dependency-glob: pyproject.toml
- name: Build package
run: uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
110 changes: 73 additions & 37 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,56 +12,92 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
# to fail on error in multiline statements (-e), in pipes (-o pipefail), and on unset variables (-u).
shell: bash -euo pipefail {0}

jobs:
# Get the test environment from hatch as defined in pyproject.toml.
# This ensures that the pyproject.toml is the single point of truth for test definitions and the same tests are
# run locally and on continuous integration.
# Check [[tool.hatch.envs.hatch-test.matrix]] in pyproject.toml and https://hatch.pypa.io/latest/environment/ for
# more details.
get-environments:
runs-on: ubuntu-latest
outputs:
envs: ${{ steps.get-envs.outputs.envs }}
steps:
- uses: actions/checkout@v4
with:
filter: blob:none
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Get test environments
id: get-envs
run: |
ENVS_JSON=$(uvx hatch env show --json | jq -c 'to_entries
| map(
select(.key | startswith("hatch-test"))
| {
name: .key,
label: (if (.key | contains("pre")) then .key + " (PRE-RELEASE DEPENDENCIES)" else .key end),
python: .value.python
}
)')
echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT

# Run tests through hatch. Spawns a separate runner for each environment defined in the hatch matrix obtained above.
test:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -e {0} # -e to fail on error
needs: get-environments

strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python: "3.10"
- os: ubuntu-latest
python: "3.12"
- os: ubuntu-latest
python: "3.12"
pip-flags: "--pre"
name: PRE-RELEASE DEPENDENCIES
os: [ubuntu-latest]
env: ${{ fromJSON(needs.get-environments.outputs.envs) }}

name: ${{ matrix.name }} Python ${{ matrix.python }}

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
name: ${{ matrix.env.label }}
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
- uses: actions/checkout@v4
with:
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
- name: Install dependencies
run: |
pip install ${{ matrix.pip-flags }} ".[dev,test]"
- name: Test
filter: blob:none
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.env.python }}
cache-dependency-glob: pyproject.toml
- name: create hatch environment
run: uvx hatch env create ${{ matrix.env.name }}
- name: run tests using hatch
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: uvx hatch run ${{ matrix.env.name }}:run-cov -v --color=yes -n auto
- name: generate coverage report
run: |
coverage run -m pytest -v --color=yes
- name: Report coverage
run: |
coverage report
# See https://coverage.readthedocs.io/en/latest/config.html#run-patch
test -f .coverage || uvx hatch run ${{ matrix.env.name }}:cov-combine
uvx hatch run ${{ matrix.env.name }}:cov-report # report visibly
uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload
- name: Upload coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5

# Check that all tests defined above pass. This makes it easy to set a single "required" test in branch
# protection instead of having to update it frequently. See https://github.com/re-actors/alls-green#why.
check:
name: Tests pass in all hatch environments
if: always()
needs:
- get-environments
- test
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
Loading