Skip to content

Commit

Permalink
Merge pull request #1
Browse files Browse the repository at this point in the history
Add initial structure
  • Loading branch information
pawel-czyz authored Oct 27, 2023
2 parents 3720375 + 6bad695 commit 1b302b9
Show file tree
Hide file tree
Showing 10 changed files with 244 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This pipeline builds the documentation.
name: docs

on:
push:
branches: [ main ]

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
version: "1.5.1"
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v2
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}
- name: Install the dependencies
run: poetry install --no-interaction --no-root --with dev
if: steps.cache-deps.outputs.cache-hit != 'true'
- name: Install the module
run: poetry install --with dev --no-interaction
- name: Generate the documentation
run: poetry run mkdocs gh-deploy --force
53 changes: 53 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This pipeline checks whether the package
# installs properly, passes unit tests and whether
# the code formatting is right.
name: build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.10"]
poetry-version: ["1.3.2"]

steps:
- uses: actions/checkout@v3
- name: Run black formatting check
uses: psf/black@stable
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
version: ${{ matrix.poetry-version }}
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v2
with:
path: .venv
key: pydeps-${{ hashFiles('**/poetry.lock') }}
- name: Install the dependencies
run: poetry install --no-interaction --no-root --with dev
if: steps.cache-deps.outputs.cache-hit != 'true'
- name: Install the module
run: poetry install --with dev --no-interaction
- name: Run unit tests
run: poetry run pytest
- name: Run Ruff
run: poetry run ruff check .
- name: Run Pyright (type checking)
run: poetry run pyright

17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Notebooks by default should not be uploaded (use Quarto Markdown as an alternative)
*.nb
*.ipynb

# Data and plots
*.csv
*.jpg
*.jpeg
*.npy
*.npz
*.pdf
*.png
*.zip

# Poetry lock file
poetry.lock

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.245'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: local
hooks:
- id: pyright
name: pyright
entry: poetry run pyright
language: node
pass_filenames: true
types: [python]
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,37 @@
# covvfit-
fitness estimates of SARS-CoV-2 variants
[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![build](https://github.com/cbg-ethz/covvfit/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/cbg-ethz/covvfit/actions/workflows/test.yml)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/charliermarsh/ruff)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)


# covvfit
Fitness estimates of SARS-CoV-2 variants.

- **Documentation:** [https://cbg-ethz.github.io/covvfit](https://cbg-ethz.github.io/covvfit)
- **Source code:** [https://github.com/cbg-ethz/covvfit](https://github.com/cbg-ethz/covvfit)
- **Bug reports:** [https://github.com/cbg-ethz/covvfit/issues](https://github.com/cbg-ethz/covvfit/issues)


## Installation

### Developers
Create a new environment, e.g., using [Micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html):
```bash
$ micromamba create -n covvfit -c conda-forge python=3.10
```

Then, install the package.

For a machine where development happens it comes with developer utilities:

```bash
$ pip install poetry
$ poetry install --with dev
$ pre-commit install
```

## See Also

- [V-pipe](https://cbg-ethz.github.io/V-pipe/): a bioinformatics pipeline for viral sequencing data.
- [cojac](https://github.com/cbg-ethz/cojac): command-line tools for the analysis of co-occurrence of mutations on amplicons.

1 change: 1 addition & 0 deletions docs/index.md
47 changes: 47 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
site_name: Inference of SARS-Cov-2 variant fitness

theme:
name: "material"
features:
- navigation.tabs
- navigation.sections
- toc.integrate
- search.suggest
- search.highlight
- content.tabs.link
- content.code.annotation
- content.code.copy
language: en
palette:
- scheme: default
toggle:
icon: material/toggle-switch-off-outline
name: Switch to dark mode
primary: teal
accent: purple
- scheme: slate
toggle:
icon: material/toggle-switch
name: Switch to light mode
primary: teal
accent: lime

plugins:
- search
- mkdocstrings:
default_handler: python
handlers:
python:
options:
show_source: false
show_root_heading: true

nav:
- Documentation: index.md
- API Reference: api.md

repo_name: covvfit
repo_url: https://github.com/cbg-ethz/covvfit

watch:
- src/covvfit
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[tool.poetry]
name = "covvfit"
version = "0.1.0"
description = ""
authors = ["David Dreifuss <[email protected]>", "Paweł Czyż <[email protected]>"]
readme = "README.md"
packages = [{include = "covvfit", from = "src"}]

[tool.poetry.dependencies]
python = ">=3.10,<3.12"
numpy = "^1.25"
matplotlib = "^3.8.0"
pymc = "^5.9.1"
scipy = "^1.11.3"


[tool.poetry.group.dev.dependencies]
pytest = "^7.4.3"
ruff = "^0.1.3"
black = "^23.10.1"
pre-commit = "^3.5.0"
pyright = "^1.1.333"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
1 change: 1 addition & 0 deletions src/covvfit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION = "0.1.0"
5 changes: 5 additions & 0 deletions tests/test_installed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import covvfit


def test_imports() -> None:
assert isinstance(covvfit.VERSION, str)

0 comments on commit 1b302b9

Please sign in to comment.