Skip to content

Commit

Permalink
34 convert distribution system from poetry to uv (#35)
Browse files Browse the repository at this point in the history
* chore: convert from poetry to uv

* chore: convert poetry to uv in github action

* fix: use specific uv venv

* fix: install uv manually

* fix: create a venv with uv

* fix: use dot notation in imports with main

* fix: remove dot notation and call from package directly

* fix: add all namespaces to __all__ in __init__

* chore: troubleshooting CI

* chore: troubleshooting CI

* chore: troubleshooting CI

* chore: formatting

* chore: troubleshooting CI

* chore: troubleshooting CI

* chore: troubleshooting CI

* chore: troubleshooting CI

* chore: troubleshooting CI

* chore: troubleshooting CI

* chore: troubleshooting CI

* chore: troubleshooting CI

* chore: troubleshooting CI

* chore: troubleshooting CI

* chore: troubleshooting CI

* chore: troubleshooting CI

* chore: troubleshooting CI

* chore: troubleshooting CI

* chore: troubleshooting CI

* docs: update readme with table

* chore: bump minor version, potential breaking changes with installation
  • Loading branch information
noamteyssier authored Oct 3, 2024
1 parent d428010 commit 4fd3902
Show file tree
Hide file tree
Showing 7 changed files with 875 additions and 67 deletions.
58 changes: 30 additions & 28 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Python Package using Conda
name: Python Package CI

on: [push]

jobs:

ci:
needs: [ostest, full-ci]
needs: [
ostest,
full-ci,
]
name: CI
runs-on: 'ubuntu-latest'
steps:
Expand All @@ -17,65 +19,65 @@ jobs:
strategy:
max-parallel: 5
matrix:
python-version: [ "3.9", "3.10", "3.11" ]
python-version: ["3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4

- name: Install poetry
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up Python ${{ matrix.python-version }}
run: |
pip install poetry
uv python install ${{ matrix.python-version }}
uv venv
- name: Install project
run: |
poetry install
uv sync --all-extras --dev
uv tool install .
- name: Test with pytest
run: |
poetry run pytest -v
uv run pytest -v
- name: Test table io from commandline
run: |
poetry run geomux -i example/example.tsv.gz -o results_table.tab
uvx geomux -i example/example.tsv.gz -o results_table.tab
- name: Test adat io from commandline
run: |
poetry run geomux -i example/example.h5ad -o results_table.tab
uvx geomux -i example/example.h5ad -o results_table.tab
ostest:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 5
matrix:
os: [ "windows-latest", "macos-latest" ]
os: ["windows-latest", "macos-latest"]

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- uses: actions/checkout@v4

- name: Install poetry
run: |
pip install poetry
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up Python 3.11
run: uv python install 3.11

- name: Install project
run: |
poetry install
uv sync --all-extras --dev
uv tool install .
- name: Test with pytest
run: |
poetry run pytest -v
uv run pytest -v
- name: Test table io from commandline
run: |
poetry run geomux -i example/example.tsv.gz -o results_table.tab
uvx geomux -i example/example.tsv.gz -o results_table.tab
- name: Test adat io from commandline
run: |
poetry run geomux -i example/example.h5ad -o results_table.tab
uvx geomux -i example/example.h5ad -o results_table.tab
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,15 @@ observations as there are input cells.

The columns of this dataframe will include:

- cell_id
- The name of the cell provided or the index.
- assignment
- A list representing all significant guides within that cell.
- moi
- The number of significant guides within the cell.
- n_umi
- The number of UMIs observed in the cell.
- p_value
- The adjusted p-value of the hypergeometric test for that cell/guide test.
- log_odds
- The log odds of observing the highest scoring guide compared to the second highest.
- tested
- A bool flag representing whether the cell was included in the test (or `False` if it was filtered for low UMI counts)
| Column Name | Description |
| ----------- | ----------- |
| cell_id | The name of the cell provided or the index. |
| assignment | A list representing all significant guides within that cell. |
| counts | The number of UMIs observed in the cell. |
| pvalues | The adjusted p-value of the hypergeometric test for that cell/guide test. |
| log_odds | The log odds of observing the highest scoring guide compared to the second highest. |
| moi | The number of significant guides within the cell. |
| n_umi | The number of UMIs observed in the cell. |
| min_pvalue | The minimum pvalue across all significant guides within the cell. |
| max_count | The maximum count across all significant guides within the cell. |
| tested | A bool flag representing whether the cell was included in the test (or `False` if it was filtered for low UMI counts) |
5 changes: 4 additions & 1 deletion geomux/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from .geomux import Geomux
from .utils import read_table, read_anndata
from .utils import read_anndata, read_table

__all__ = ["Geomux", "read_table", "read_anndata"]

import logging

logging.basicConfig(
Expand Down
5 changes: 3 additions & 2 deletions geomux/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
import argparse
from geomux import Geomux, read_table, read_anndata
import sys

from geomux import Geomux, read_anndata, read_table


def get_args():
Expand Down
39 changes: 17 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
[tool.poetry]
[project]
name = "geomux"
version = "0.2.10"
version = "0.3.0"
description = "A tool to assign identifiers to cell barcodes"
authors = ["Noam Teyssier"]
license = "MIT"
authors = [{ name = "Noam Teyssier" }]
requires-python = ">=3.10"
license = { file = "LICENSE" }
readme = "README.md"
dependencies = [
"adjustpy>=0.1.1",
"anndata>=0.10.9",
"numpy>=2.1.1",
"pandas>=2.2.3",
"scipy>=1.14.1",
]

[tool.poetry.scripts]
geomux = 'geomux.__main__:main_cli'
[project.scripts]
geomux = "geomux.__main__:main_cli"

[tool.poetry.dependencies]
python = ">=3.9,<3.13"
numpy = "^1.24.0"
pandas = "^2.0.3"
anndata = "^0.9.1"
scipy = "^1.11.1"
adjustpy = "^0.1.1"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.0"
muxsim = "^0.1.0"
black = "^23.3.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.uv]
dev-dependencies = ["pytest>=8.3.3", "muxsim>=0.1.0", "black>=24.8.0"]
package = true
Loading

0 comments on commit 4fd3902

Please sign in to comment.