Skip to content

Commit

Permalink
Merge pull request #9 from meyer-lab/Rye
Browse files Browse the repository at this point in the history
Change to rye
  • Loading branch information
andrewram4287 authored Sep 16, 2024
2 parents 6f7ced2 + 974c0be commit 71a67e4
Show file tree
Hide file tree
Showing 7 changed files with 695 additions and 2,223 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ jobs:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: poetry install
- name: Setup rye
uses: eifinger/setup-rye@v4
with:
enable-cache: true
version: '0.39.0'
- name: Setup environment
run: make .venv
- name: Build figures
run: make all -j 2
- name: Upload files
uses: actions/upload-artifact@v4
with:
name: files
path: |
output/*.svg
output/*.svg
30 changes: 0 additions & 30 deletions .github/workflows/test.yml

This file was deleted.

29 changes: 13 additions & 16 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
SHELL := /bin/bash

.PHONY: clean test
.PHONY: clean test pyright

flist = $(wildcard spatialpf2/figures/figure*.py)
allOutput = $(patsubst spatialpf2/figures/figure%.py, output/figure%.svg, $(flist))
Expand All @@ -9,21 +7,20 @@ all: $(allOutput)

output/figure%.svg: spatialpf2/figures/figure%.py
@ mkdir -p ./output
poetry run fbuild $*
rye run fbuild $*

test:
poetry run pytest -s -x -v
test: .venv
rye run pytest -s -v -x

coverage.xml:
poetry run pytest --cov=spatialpf2 --cov-report=xml
.venv:
rye sync

clean:
rm -rf output profile profile.svg
rm -rf factor_cache
coverage.xml: .venv
rye run pytest --junitxml=junit.xml --cov=spatialpf2 --cov-report xml:coverage.xml

testprofile:
poetry run python3 -m cProfile -o profile -m pytest -s -v -x
gprof2dot -f pstats --node-thres=5.0 profile | dot -Tsvg -o profile.svg
pyright: .venv
rye run pyright spatialpf2

mypy:
poetry run mypy --install-types --non-interactive --ignore-missing-imports --check-untyped-defs spatialpf2
clean:
rm -rf output profile profile.svg
rm -rf factor_cache
2,147 changes: 0 additions & 2,147 deletions poetry.lock

This file was deleted.

92 changes: 65 additions & 27 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,69 @@
[tool.poetry]
[project]
name = "spatialpf2"
version = "0.0.0"
version = "0.1.0"
description = "Spatial data analysis using PARAFAC2."
authors = ["Andrew Ramirez", "Nathaniel Thomas", "Breanna Remigio", "Aaron Meyer <git@asmlab.org>"]
authors = [{name = "Nathaniel Thomas"}, {name="Breanna Remigio"}, {name = "Andrew Ramirez"}, {name="Aaron Meyer", email = "git@asmlab.org"}]
license = "MIT"
requires-python = ">= 3.11, <= 3.13"

[tool.poetry.dependencies]
python = ">=3.11,<3.13"
numpy = "^1.26"
scipy = "^1.12"
scikit-learn = "^1.4"
seaborn = "^0.13.2"
pandas = "^2.2.1"
tensorly = "0.8.1"
parafac2 = { git = "https://github.com/meyer-lab/parafac2.git", rev = "b0bf58fd3b285d5cf6e598ccd254f7df04c083b9" }
h5netcdf = "^1.3"
anndata = "^0.10.3"
datashader = "^0.16"
gseapy = "^1.1"
scanpy = "^1.10"
pacmap = "^0.7.1"
leidenalg = "^0.10.1"
tqdm = "^4.66.1"
tlviz = "^0.1.1"
statsmodels = "^0.14.1"
dask = {extras = ["dataframe"], version = "^2024.3.1"}
ruff = "^0.4.2"

[tool.poetry.scripts]
fbuild = "spatialpf2.figures.common:genFigure"

dependencies = [
"pandas>=2.1.3",
"scanpy>=1.9.6",
"matplotlib>=3.9",
"scikit-learn>=1.5",
"tensorly>=0.8.1",
"numpy>=1.26.2",
"parafac2 @ git+https://github.com/meyer-lab/parafac2.git@793f8ad06791ffcc698105d80941774741722574",
"pacmap>=0.7.3",
"anndata>=0.10.3",
"tlviz>=0.1.1",
"datashader>=0.16.2",
"dask[dataframe]>=2024.5.0",
"setuptools>=69.5",
"doubletdetection>=4.2",
"networkx>=3.3"
]


readme = "README.md"

[project.scripts]
fbuild = "spatialpf2.figures.common:genFigure"
factor = "spatialpf2.imports:factorSave"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.0",
"pytest-cov>=5.0",
"pyright>=1.1",
]

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.build.targets.wheel]
packages = ["spatialpf2"]

[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
# Unused arguments
"ARG",
]
Loading

0 comments on commit 71a67e4

Please sign in to comment.