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
2 changes: 1 addition & 1 deletion .chglog/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/rmnldwg/lyscripts
repository_url: https://github.com/lycosystem/lyscripts
options:
commits:
filters:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and release Python package on PyPI
name: Build

on:
release:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testpypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and release Python package on TestPyPI
name: Test Build

on:
push:
Expand Down
66 changes: 42 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,56 @@
# This is a workflow that runs test on the package
name: Tests
name: tests

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
tests:
name: Run tests & report coverage
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
permissions:
pull-requests: write
contents: write
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install python 3
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: install dependencies
run: |
python3 -m pip install -U pip setuptools setuptools-scm wheel
python3 -m pip install .[test]
- name: Run tests
python-version: "3.10"

- name: Install dependencies
run: |
python3 -m pytest --doctest-modules
python -m pip install --upgrade pip
python -m pip install .[tests]

# Below, we first run pytest in the `tests/` folder. Because we use a `src`
# layout, this will fail if the package is not installed correctly.
- name: Test package is installable
run: pytest --cov=lyscripts --cov-config=pyproject.toml tests
env:
COVERAGE_FILE: .coverage.is_installable

# Now, we execute all doctests in the `src` tree. This will NOT run with
# the installed code, but it doesn't matter, because we already know it is
# installable from the step above.
- name: Run doctests
if: success() || failure() # run these even if previous step fails
run: pytest --cov=lyscripts --cov-config=pyproject.toml --doctest-modules src
env:
COVERAGE_FILE: .coverage.doctests
GITHUB_TOKEN: ${{ secrets.LYCOSYSTEM_READALL }}

# Lastly, we collect all files that start with `.coverage` into one file and
# create a report either as a comment on the PR or in a separate branch if its
# a commit to the main branch. From that branch we can put badges and coverage
# reports into e.g. our main README.md
- name: Add coverage comment
if: success() || failure() # run these even if previous step fails
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}
MERGE_COVERAGE_FILES: true
11 changes: 8 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
default_install_hook_types: [pre-commit, commit-msg]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-toml
- id: check-yaml
- id: check-json
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.4
rev: v0.12.0
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.3.0
rev: v4.2.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
Expand Down
146 changes: 89 additions & 57 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@

All notable changes to this project will be documented in this file.

## [1.0.0rc2] - 2025-06-26

### Bug Fixes

- Divide by midext prevalence. Fixes [#72].\
This fixes a bug we reintroduced where we didn't compute observed and
model prevalence in an analogous and comparable way.

### Documentation

- Fix build badge in README.
- Fix outdated links to rmnldwg.

### Miscellaneous Tasks

- Update pre-commit & ruff rules.

### Testing

- Fix the dataset used for testing prevalences.

### Build

- Switch to `src` layout. Fixes [#74].

### Ci

- Use tests action with coverage.

## [1.0.0rc1] - 2025-05-27

### Bug Fixes
Expand Down Expand Up @@ -819,63 +848,66 @@ returns `None` instead. Fixes [#11]
## [0.5.3] - 2022-08-22

<!-- markdownlint-disable-file MD024 -->
[1.0.0rc1]: https://github.com/rmnldwg/lyscripts/compare/1.0.0.a7...1.0.0rc1
[1.0.0.a7]: https://github.com/rmnldwg/lyscripts/compare/1.0.0.a6...1.0.0.a7
[1.0.0.a6]: https://github.com/rmnldwg/lyscripts/compare/1.0.0.a5...1.0.0.a6
[1.0.0.a5]: https://github.com/rmnldwg/lyscripts/compare/1.0.0.a4...1.0.0.a5
[1.0.0.a4]: https://github.com/rmnldwg/lyscripts/compare/1.0.0.a3...1.0.0.a4
[1.0.0.a3]: https://github.com/rmnldwg/lyscripts/compare/1.0.0.a2...1.0.0.a3
[1.0.0.a2]: https://github.com/rmnldwg/lyscripts/compare/1.0.0.a1...1.0.0.a2
[1.0.0.a1]: https://github.com/rmnldwg/lyscripts/compare/1.0.0.a0...1.0.0.a1
[1.0.0.a0]: https://github.com/rmnldwg/lyscripts/compare/0.7.3...1.0.0.a0
[0.7.3]: https://github.com/rmnldwg/lyscripts/compare/0.7.2...0.7.3
[0.7.2]: https://github.com/rmnldwg/lyscripts/compare/0.7.1...0.7.2
[0.7.1]: https://github.com/rmnldwg/lyscripts/compare/0.7.0...0.7.1
[0.7.0]: https://github.com/rmnldwg/lyscripts/compare/0.6.9...0.7.0
[0.6.9]: https://github.com/rmnldwg/lyscripts/compare/0.6.8...0.6.9
[0.6.8]: https://github.com/rmnldwg/lyscripts/compare/0.6.7...0.6.8
[0.6.7]: https://github.com/rmnldwg/lyscripts/compare/0.6.6...0.6.7
[0.6.6]: https://github.com/rmnldwg/lyscripts/compare/0.6.5...0.6.6
[0.6.5]: https://github.com/rmnldwg/lyscripts/compare/0.6.4...0.6.5
[0.6.4]: https://github.com/rmnldwg/lyscripts/compare/0.6.3...0.6.4
[0.6.3]: https://github.com/rmnldwg/lyscripts/compare/0.6.2...0.6.3
[0.6.2]: https://github.com/rmnldwg/lyscripts/compare/0.6.1...0.6.2
[0.6.1]: https://github.com/rmnldwg/lyscripts/compare/0.6.0...0.6.1
[0.6.0]: https://github.com/rmnldwg/lyscripts/compare/0.5.11...0.6.0
[0.5.11]: https://github.com/rmnldwg/lyscripts/compare/0.5.10...0.5.11
[0.5.10]: https://github.com/rmnldwg/lyscripts/compare/0.5.9...0.5.10
[0.5.9]: https://github.com/rmnldwg/lyscripts/compare/0.5.8...0.5.9
[0.5.8]: https://github.com/rmnldwg/lyscripts/compare/0.5.7...0.5.8
[0.5.7]: https://github.com/rmnldwg/lyscripts/compare/0.5.6...0.5.7
[0.5.6]: https://github.com/rmnldwg/lyscripts/compare/0.5.5...0.5.6
[0.5.5]: https://github.com/rmnldwg/lyscripts/compare/0.5.4...0.5.5
[0.5.4]: https://github.com/rmnldwg/lyscripts/compare/0.5.3...0.5.4
[0.5.3]: https://github.com/rmnldwg/lyscripts/compare/0.5.2...0.5.3

[#2]: https://github.com/rmnldwg/lyscripts/issues/2
[#5]: https://github.com/rmnldwg/lyscripts/issues/5
[#8]: https://github.com/rmnldwg/lyscripts/issues/8
[#11]: https://github.com/rmnldwg/lyscripts/issues/11
[#13]: https://github.com/rmnldwg/lyscripts/issues/13
[#15]: https://github.com/rmnldwg/lyscripts/issues/15
[#16]: https://github.com/rmnldwg/lyscripts/issues/16
[#17]: https://github.com/rmnldwg/lyscripts/issues/17
[#20]: https://github.com/rmnldwg/lyscripts/issues/20
[#21]: https://github.com/rmnldwg/lyscripts/issues/21
[#23]: https://github.com/rmnldwg/lyscripts/issues/23
[#25]: https://github.com/rmnldwg/lyscripts/issues/25
[#30]: https://github.com/rmnldwg/lyscripts/issues/30
[#31]: https://github.com/rmnldwg/lyscripts/issues/31
[#33]: https://github.com/rmnldwg/lyscripts/issues/33
[#40]: https://github.com/rmnldwg/lyscripts/issues/40
[#41]: https://github.com/rmnldwg/lyscripts/issues/41
[#44]: https://github.com/rmnldwg/lyscripts/issues/44
[#45]: https://github.com/rmnldwg/lyscripts/issues/45
[#51]: https://github.com/rmnldwg/lyscripts/issues/51
[#53]: https://github.com/rmnldwg/lyscripts/issues/53
[#54]: https://github.com/rmnldwg/lyscripts/issues/54
[#57]: https://github.com/rmnldwg/lyscripts/issues/57
[#70]: https://github.com/rmnldwg/lyscripts/issues/70
[1.0.0rc2]: https://github.com/lycosystem/lyscripts/compare/1.0.0rc1...1.0.0rc2
[1.0.0rc1]: https://github.com/lycosystem/lyscripts/compare/1.0.0.a7...1.0.0rc1
[1.0.0.a7]: https://github.com/lycosystem/lyscripts/compare/1.0.0.a6...1.0.0.a7
[1.0.0.a6]: https://github.com/lycosystem/lyscripts/compare/1.0.0.a5...1.0.0.a6
[1.0.0.a5]: https://github.com/lycosystem/lyscripts/compare/1.0.0.a4...1.0.0.a5
[1.0.0.a4]: https://github.com/lycosystem/lyscripts/compare/1.0.0.a3...1.0.0.a4
[1.0.0.a3]: https://github.com/lycosystem/lyscripts/compare/1.0.0.a2...1.0.0.a3
[1.0.0.a2]: https://github.com/lycosystem/lyscripts/compare/1.0.0.a1...1.0.0.a2
[1.0.0.a1]: https://github.com/lycosystem/lyscripts/compare/1.0.0.a0...1.0.0.a1
[1.0.0.a0]: https://github.com/lycosystem/lyscripts/compare/0.7.3...1.0.0.a0
[0.7.3]: https://github.com/lycosystem/lyscripts/compare/0.7.2...0.7.3
[0.7.2]: https://github.com/lycosystem/lyscripts/compare/0.7.1...0.7.2
[0.7.1]: https://github.com/lycosystem/lyscripts/compare/0.7.0...0.7.1
[0.7.0]: https://github.com/lycosystem/lyscripts/compare/0.6.9...0.7.0
[0.6.9]: https://github.com/lycosystem/lyscripts/compare/0.6.8...0.6.9
[0.6.8]: https://github.com/lycosystem/lyscripts/compare/0.6.7...0.6.8
[0.6.7]: https://github.com/lycosystem/lyscripts/compare/0.6.6...0.6.7
[0.6.6]: https://github.com/lycosystem/lyscripts/compare/0.6.5...0.6.6
[0.6.5]: https://github.com/lycosystem/lyscripts/compare/0.6.4...0.6.5
[0.6.4]: https://github.com/lycosystem/lyscripts/compare/0.6.3...0.6.4
[0.6.3]: https://github.com/lycosystem/lyscripts/compare/0.6.2...0.6.3
[0.6.2]: https://github.com/lycosystem/lyscripts/compare/0.6.1...0.6.2
[0.6.1]: https://github.com/lycosystem/lyscripts/compare/0.6.0...0.6.1
[0.6.0]: https://github.com/lycosystem/lyscripts/compare/0.5.11...0.6.0
[0.5.11]: https://github.com/lycosystem/lyscripts/compare/0.5.10...0.5.11
[0.5.10]: https://github.com/lycosystem/lyscripts/compare/0.5.9...0.5.10
[0.5.9]: https://github.com/lycosystem/lyscripts/compare/0.5.8...0.5.9
[0.5.8]: https://github.com/lycosystem/lyscripts/compare/0.5.7...0.5.8
[0.5.7]: https://github.com/lycosystem/lyscripts/compare/0.5.6...0.5.7
[0.5.6]: https://github.com/lycosystem/lyscripts/compare/0.5.5...0.5.6
[0.5.5]: https://github.com/lycosystem/lyscripts/compare/0.5.4...0.5.5
[0.5.4]: https://github.com/lycosystem/lyscripts/compare/0.5.3...0.5.4
[0.5.3]: https://github.com/lycosystem/lyscripts/compare/0.5.2...0.5.3

[#2]: https://github.com/lycosystem/lyscripts/issues/2
[#5]: https://github.com/lycosystem/lyscripts/issues/5
[#8]: https://github.com/lycosystem/lyscripts/issues/8
[#11]: https://github.com/lycosystem/lyscripts/issues/11
[#13]: https://github.com/lycosystem/lyscripts/issues/13
[#15]: https://github.com/lycosystem/lyscripts/issues/15
[#16]: https://github.com/lycosystem/lyscripts/issues/16
[#17]: https://github.com/lycosystem/lyscripts/issues/17
[#20]: https://github.com/lycosystem/lyscripts/issues/20
[#21]: https://github.com/lycosystem/lyscripts/issues/21
[#23]: https://github.com/lycosystem/lyscripts/issues/23
[#25]: https://github.com/lycosystem/lyscripts/issues/25
[#30]: https://github.com/lycosystem/lyscripts/issues/30
[#31]: https://github.com/lycosystem/lyscripts/issues/31
[#33]: https://github.com/lycosystem/lyscripts/issues/33
[#40]: https://github.com/lycosystem/lyscripts/issues/40
[#41]: https://github.com/lycosystem/lyscripts/issues/41
[#44]: https://github.com/lycosystem/lyscripts/issues/44
[#45]: https://github.com/lycosystem/lyscripts/issues/45
[#51]: https://github.com/lycosystem/lyscripts/issues/51
[#53]: https://github.com/lycosystem/lyscripts/issues/53
[#54]: https://github.com/lycosystem/lyscripts/issues/54
[#57]: https://github.com/lycosystem/lyscripts/issues/57
[#70]: https://github.com/lycosystem/lyscripts/issues/70
[#72]: https://github.com/lycosystem/lyscripts/issues/72
[#74]: https://github.com/lycosystem/lyscripts/issues/74

[`emcee`]: https://emcee.readthedocs.io/en/stable/
[`rich`]: https://rich.readthedocs.io/en/latest/
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<img src="https://raw.githubusercontent.com/rmnldwg/lyscripts/main/github-social-card.png" alt="social card" style="width:830px;"/>
<img src="https://raw.githubusercontent.com/lycosystem/lyscripts/main/github-social-card.png" alt="social card" style="width:830px;"/>

[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/rmnldwg/lyscripts/blob/main/LICENSE)
[![GitHub repo](https://img.shields.io/badge/rmnldwg%2Flymph-grey.svg?style=flat&logo=github)](https://github.com/rmnldwg/lyscripts)
[![build badge](https://github.com/rmnldwg/lyscripts/actions/workflows/build.yml/badge.svg?style=flat)](https://pypi.org/project/lyscripts/)
[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/lycosystem/lyscripts/blob/main/LICENSE)
[![GitHub repo](https://img.shields.io/badge/lycosystem%2Flymph-grey.svg?style=flat&logo=github)](https://github.com/lycosystem/lyscripts)
[![build badge](https://github.com/lycosystem/lyscripts/actions/workflows/release.yml/badge.svg?style=flat)](https://pypi.org/project/lyscripts/)
[![docs badge](https://readthedocs.org/projects/lyscripts/badge/?version=latest)](https://lyscripts.readthedocs.io/en/latest/?badge=latest)
[![tests badge](https://github.com/rmnldwg/lyscripts/actions/workflows/tests.yml/badge.svg?style=flat)](https://lyscripts.readthedocs.io/en/latest/?badge=latest)
[![tests badge](https://github.com/lycosystem/lyscripts/actions/workflows/tests.yml/badge.svg?style=flat)](https://lyscripts.readthedocs.io/en/latest/?badge=latest)
[![Coverage badge](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/lycosystem/lyscripts/python-coverage-comment-action-data/endpoint.json)](https://htmlpreview.github.io/?https://github.com/lycosystem/lyscripts/blob/python-coverage-comment-action-data/htmlcov/index.html)

## What are these `lyscripts`?

This package provides convenient scripts for performing inference and learning regarding the lymphatic spread of head & neck cancer. Essentially, it provides a *command line interface* (CLI) to the [lymph](https://github.com/rmnldwg/lymph) library and the [lydata](https://github.com/rmnldwg/lydata) repository that stores lymphatic progression data.
This package provides convenient scripts for performing inference and learning regarding the lymphatic spread of head & neck cancer. Essentially, it provides a *command line interface* (CLI) to the [lymph](https://github.com/lycosystem/lymph) library and the [lydata](https://github.com/rmnldwg/lydata) repository that stores lymphatic progression data.

We are making these "convenience" scripts public, because doing so is one necessary requirement to making our research easily and fully reproducible. There exists another repository, [lynference](https://github.com/rmnldwg/lynference), where we stored the pipelines that produced our published results in a persistent way.
We are making these "convenience" scripts public, because doing so is one necessary requirement to making our research easily and fully reproducible. There exists another repository, [lynference](https://github.com/lycosystem/lynference), where we stored the pipelines that produced our published results in a persistent way.

## Installation

Expand All @@ -23,7 +24,7 @@ pip install lyscripts
or installed from source by cloning this repo

```bash
git clone https://github.com/rmnldwg/lyscripts.git
git clone https://github.com/lycosystem/lyscripts.git
cd lyscripts
pip install .
```
Expand Down Expand Up @@ -59,7 +60,7 @@ For these YAML files we provide a unified schema containing all possible fields
```json
{
"yaml.schemas": {
"https://raw.githubusercontent.com/rmnldwg/lyscripts/main/schemas/ly.json": "*.ly.yaml"
"https://raw.githubusercontent.com/lycosystem/lyscripts/main/schemas/ly.json": "*.ly.yaml"
}
}
```
Expand Down
28 changes: 19 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies = [
dynamic = ["version"]

[project.urls]
source = "https://github.com/rmnldwg/lyscripts"
source = "https://github.com/lycosystem/lyscripts"
documentation = "https://lyscripts.readthedocs.io"

[project.optional-dependencies]
Expand All @@ -68,41 +68,51 @@ docs = [
"myst_parser",
"autodoc_pydantic",
]
test = [
tests = [
"pytest",
"pytest-cov",
"pytest-mpl",
]
dev = [
"pre-commit",
"git-cliff",
]

[project.scripts]
lyscripts = "lyscripts:main"

[tool.setuptools.packages.find]
include = ["lyscripts"]
where = ["src"]

[tool.setuptools_scm]
write_to = "lyscripts/_version.py"
write_to = "src/lyscripts/_version.py"
local_scheme = "no-local-version"

[tool.setuptools.dynamic]
version = {attr = "lyscripts._version.version"}

[tool.pytest.ini_options]
testpaths = "."

[tool.ruff.lint]
select = ["E", "F", "W", "B", "C", "R", "U", "D", "I", "S", "T", "A", "N"]
select = ["E", "F", "W", "B", "C", "R", "U", "D", "I", "S", "T", "A", "N", "COM", "FURB", "NPY", "UP"]
ignore = ["D409"]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402"]
"**/{tests,docs}/*" = [
"{tests,docs}/*" = [
"D103",
"E402",
"S101",
"S603",
"S607",
]

[tool.coverage.paths]
source = [
"src/",
"**/site-packages/",
]

[tool.coverage.run]
relative_files = true

# git-cliff ~ default configuration file
# https://git-cliff.org/docs/configuration
Expand Down
Loading
Loading