Skip to content
Merged
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
34 changes: 0 additions & 34 deletions .devcontainer/py/Dockerfile

This file was deleted.

28 changes: 0 additions & 28 deletions .devcontainer/py/devcontainer.json

This file was deleted.

45 changes: 16 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,28 @@ name: CI

on:
push:
branches: [main]
pull_request:

jobs:
r-smoke:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build R image
run: |
docker build -t project-r -f .devcontainer/r/Dockerfile .
- uses: actions/checkout@v4

- name: Run R smoke test (and restore if lock exists)
run: |
docker run --rm \
-v "${{ github.workspace }}:/workspaces/project" \
-w /workspaces/project \
project-r \
bash -lc 'if [ -f renv.lock ]; then R -q -e "renv::restore(prompt=FALSE)"; fi; R -q -f analysis/r/smoke.R'
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

py-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install package and test dependencies
run: pip install . pytest scipy ruff

- name: Build Python image
run: |
docker build -t project-py -f .devcontainer/py/Dockerfile .
- name: Lint
run: ruff check src tests

- name: Run Python smoke test (Poetry)
run: |
docker run --rm \
--user root \
-v "${{ github.workspace }}:/workspaces/project" \
-w /workspaces/project \
project-py \
bash -lc 'chown -R vscode:vscode /workspaces/project && poetry install && poetry run python analysis/py/smoke.py'
- name: Test
run: pytest
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ data/**/processed/
.devcontainer/.env
.env
config/local.env

# Output files
*.h5ad
*.zarr
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BSD 3-Clause License

Copyright (c) 2026, Juan Henao and Stefano Mangiola

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
69 changes: 25 additions & 44 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,58 +1,39 @@
SHELL := bash

.PHONY: help r-restore r-snapshot r-init r-check py-install py-lock py-run py-check
.PHONY: help install lock test lint format readme build clean

help:
@echo "Common commands:"
@echo " make r-init - Initialize renv (run inside R container)"
@echo " make r-restore - Restore R deps from renv.lock"
@echo " make r-snapshot - Snapshot R deps to renv.lock"
@echo " make r-check - Run R smoke test"
@echo " make py-install - Poetry install (sync venv)"
@echo " make py-lock - Poetry lock"
@echo " make py-run ARGS='...' - Run python with Poetry"
@echo " make py-check - Run Python smoke test"

# -------- R --------

r-init:
R -q -e "renv::init(bare = TRUE)"

r-restore:
R -q -e "renv::restore(prompt = FALSE)"

r-snapshot:
R -q -e "renv::snapshot(prompt = FALSE)"

r-check:
R -q -f analysis/r/smoke.R

# -------- Python --------

py-install:
@echo " make install - Install the package and dev dependencies (poetry install)"
@echo " make lock - Update poetry.lock after changing pyproject.toml"
@echo " make test - Run the test suite"
@echo " make lint - Check code style with ruff"
@echo " make format - Format code with black"
@echo " make readme - Regenerate README.md from demo.ipynb"
@echo " make build - Build the wheel and sdist into dist/"
@echo " make clean - Remove build artifacts and caches"

install:
poetry install

py-lock:
lock:
poetry lock

py-run:
poetry run python $(ARGS)

py-check:
poetry run python analysis/py/smoke.py

.PHONY: q-render q-preview q-check rmd-render
test:
poetry run pytest

q-check:
quarto check
lint:
poetry run ruff check src tests

q-render:
quarto render
format:
poetry run black src tests

q-preview:
quarto preview --no-watch-inputs
readme:
bash make_readme.sh

# If you still render legacy .Rmd directly (optional)
rmd-render:
R -q -e "rmarkdown::render(commandArgs(TRUE)[1])"
build: clean
poetry build

clean:
rm -rf dist/ .pytest_cache/ .ruff_cache/
find . -name __pycache__ -type d -prune -exec rm -rf {} +
Loading
Loading