Skip to content

Commit 3c799d0

Browse files
Feat/remove ignore errors in mypy settings (#78)
* feat: Add competing risks models and enhance data visualization * feat: Add competing risks models and enhance data visualization * chore: fixes * chore: fixes unit test * chore: solve issues with formatting * Add files via upload * docs: update fix reference (#37) * Add missing dependencies and configure quality tools (#39) * feat: add dataset export utility (#41) * Fix black formatting (#43) * Add extensive summary tests (#45) * Add visualization CLI tests (#47) * Expand validate tests (#49) * docs: rewrite README (#51) * Increase test coverage (#52) * Fix docs build and sort imports (#54) * Add scikit-survival integration (#56) * chore: finalize 1.0.9 release metadata (#58) * refactor: unify error handling (#60) * Feat/consolidate and optimize (#63) * chore: tighten tooling and fix visualization * docs: document Python 3.10 requirement * ci: align workflow with review template * feat: expose dev extras (#65) * test: broaden competing risks coverage (#67) * fix: ensure doc links and tag workflow (#69) * ci: streamline coverage and install flags (#71) * feat: share covariate utilities (#73) * ci: separate manual pypi publish (#76) * fix: tighten sequence checks and streamline competing-risk helpers
1 parent b3abc8f commit 3c799d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+7811
-888
lines changed

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length = 120
3+
extend-ignore = E501,W291,W293,W391,E402,E302,E305

.github/workflows/bump-version.yml

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,26 @@
11
# .github/workflows/bump-version.yml
2-
name: Bump Version on Merge to Main
3-
2+
name: Tag Version on Merge to Main
3+
44
on:
55
push:
66
branches:
77
- main
88

99
jobs:
10-
bump-version:
10+
tag-version:
1111
runs-on: ubuntu-latest
1212
permissions:
1313
contents: write
14-
id-token: write
1514

1615
steps:
1716
- uses: actions/checkout@v4
1817
with:
19-
fetch-depth: 0 # Fetch all history for all branches and tags
18+
fetch-depth: 0
2019

2120
- uses: actions/setup-python@v5
2221
with:
2322
python-version: "3.11"
2423

25-
- run: pip install python-semantic-release
26-
27-
- name: Configure Git
28-
run: |
29-
git config user.name "github-actions[bot]"
30-
git config user.email "github-actions[bot]@users.noreply.github.com"
31-
32-
- name: Run Semantic Release
33-
env:
34-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35-
run: semantic-release version
24+
- name: Tag repository from pyproject
25+
run: python scripts/check_version_match.py --fix
3626

37-
- name: Push changes
38-
run: |
39-
git push --follow-tags
40-
- name: "Install Poetry"
41-
run: pip install poetry
42-
- name: "Determine version bump type"
43-
run: |
44-
git fetch --tags
45-
# This defaults to a patch type, unless a feature commit was pushed, then set type to minor
46-
LAST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
47-
LAST_COMMIT=$(git log -1 --format='%H')
48-
echo "Last git tag: $LAST_TAG"
49-
echo "Last git commit: $LAST_COMMIT"
50-
echo "Commits:"
51-
git log --no-merges --pretty=oneline $LAST_TAG...$LAST_COMMIT
52-
git log --no-merges --pretty=format:"%s" $LAST_TAG...$LAST_COMMIT | grep -q ^feat: && BUMP_TYPE="minor" || BUMP_TYPE="patch"
53-
echo "Version bump type: $BUMP_TYPE"
54-
echo "BUMP_TYPE=$BUMP_TYPE" >> $GITHUB_ENV
55-
env:
56-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57-
- name: "Version bump"
58-
run: |
59-
poetry version $BUMP_TYPE
60-
- name: "Push new version"
61-
run: |
62-
git add pyproject.toml
63-
git commit -m "Update version to $(poetry version -s)"
64-
git pull --ff-only origin main
65-
git push origin main --follow-tags
66-
env:
67-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
test:
15+
name: Test with Python ${{ matrix.python-version }}
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: ["3.10", "3.11", "3.12"]
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Cache Poetry dependencies
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.cache/pypoetry
34+
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
35+
36+
- name: Install Poetry
37+
run: |
38+
curl -sSL https://install.python-poetry.org | python3 -
39+
echo "$HOME/.local/bin" >> $GITHUB_PATH
40+
41+
- name: Install dependencies
42+
run: poetry install --with dev --no-interaction --no-root
43+
44+
- name: Check runtime dependencies
45+
run: |
46+
poetry run python - <<'PY'
47+
import importlib, sys
48+
missing = [m for m in ("pandas",) if importlib.util.find_spec(m) is None]
49+
if missing:
50+
print("Missing dependencies:", ", ".join(missing))
51+
sys.exit(1)
52+
PY
53+
54+
- name: Verify version matches tag
55+
if: startsWith(github.ref, 'refs/tags/')
56+
run: python scripts/check_version_match.py
57+
58+
- name: Run tests with coverage
59+
run: poetry run pytest --cov=gen_surv --cov-report=xml --cov-report=term
60+
61+
- name: Upload coverage to Codecov
62+
if: matrix.python-version == '3.11'
63+
uses: codecov/codecov-action@v5
64+
with:
65+
files: coverage.xml
66+
token: ${{ secrets.CODECOV_TOKEN }}
67+
68+
lint:
69+
name: Code Quality
70+
runs-on: ubuntu-latest
71+
72+
steps:
73+
- name: Checkout code
74+
uses: actions/checkout@v4
75+
76+
- name: Set up Python
77+
uses: actions/setup-python@v5
78+
with:
79+
python-version: "3.11"
80+
81+
- name: Cache Poetry dependencies
82+
uses: actions/cache@v4
83+
with:
84+
path: ~/.cache/pypoetry
85+
key: ${{ runner.os }}-poetry-3.11-${{ hashFiles('**/poetry.lock') }}
86+
87+
- name: Install Poetry
88+
run: |
89+
curl -sSL https://install.python-poetry.org | python3 -
90+
echo "$HOME/.local/bin" >> $GITHUB_PATH
91+
92+
- name: Install dependencies
93+
run: poetry install --with dev --no-interaction --no-root
94+
95+
- name: Run pre-commit checks
96+
run: poetry run pre-commit run --all-files

.github/workflows/docs.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Documentation Build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
docs:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.11'
17+
- name: Cache Poetry dependencies
18+
uses: actions/cache@v4
19+
with:
20+
path: ~/.cache/pypoetry
21+
key: ${{ runner.os }}-poetry-3.11-${{ hashFiles('**/poetry.lock') }}
22+
- name: Install Poetry
23+
run: |
24+
curl -sSL https://install.python-poetry.org | python3 -
25+
echo "$HOME/.local/bin" >> $GITHUB_PATH
26+
- name: Install dependencies
27+
run: poetry install --with docs
28+
- name: Build documentation
29+
run: poetry run sphinx-build -W -b html docs/source docs/build
30+
- name: Upload artifacts
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: documentation
34+
path: docs/build/

.github/workflows/publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.11"
18+
- name: Verify version matches tag
19+
run: python scripts/check_version_match.py
20+
- name: Install Poetry
21+
run: |
22+
curl -sSL https://install.python-poetry.org | python3 -
23+
echo "$HOME/.local/bin" >> $GITHUB_PATH
24+
- name: Publish
25+
env:
26+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
27+
run: poetry publish --build --no-interaction

.github/workflows/test.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ dist/
5050
# Temporary
5151
*.log
5252
*.tmp
53+
.hypothesis/

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 24.1.0
4+
hooks:
5+
- id: black
6+
- repo: https://github.com/pycqa/isort
7+
rev: 5.13.2
8+
hooks:
9+
- id: isort
10+
- repo: https://github.com/pycqa/flake8
11+
rev: 6.1.0
12+
hooks:
13+
- id: flake8
14+
- repo: https://github.com/pre-commit/mirrors-mypy
15+
rev: v1.15.0
16+
hooks:
17+
- id: mypy
18+
pass_filenames: false
19+
args: [--config-file=pyproject.toml, gen_surv]

.readthedocs.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,22 @@ build:
44
os: ubuntu-22.04
55
tools:
66
python: "3.11"
7+
jobs:
8+
post_create_environment:
9+
- pip install poetry
10+
post_install:
11+
- poetry config virtualenvs.create false
12+
- poetry install --with docs
713

814
python:
915
install:
10-
- requirements: docs/requirements.txt
16+
- method: pip
17+
path: .
1118

1219
sphinx:
1320
configuration: docs/source/conf.py
21+
fail_on_warning: false
22+
23+
formats:
24+
- pdf
25+
- epub

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# CHANGELOG
22

3+
## v1.0.9 (2025-08-02)
4+
5+
### Features
6+
- export datasets to RDS files
7+
- test workflow runs on a Python version matrix
8+
- scikit-learn compatible data generator
9+
- compatibility helpers for lifelines and scikit-survival
10+
11+
### Documentation
12+
- updated usage examples and tutorials
13+
- document optional scikit-survival dependency throughout the docs
14+
15+
### Continuous Integration
16+
- auto-tag releases using the version check script
17+
18+
### Misc
19+
- README quick example uses `covariate_range`
20+
21+
## v1.0.8 (2025-07-30)
22+
23+
### Documentation
24+
- ensure absolute path resolution in `conf.py`
25+
- drop unsupported theme option
26+
- define bibliography anchors and headings
27+
- fix tutorial links to non-existing docs
28+
- add additional references to the bibliography
29+
30+
### Testing
31+
- add CLI integration test
32+
- expand piecewise generator test coverage
33+
34+
### Misc
35+
- remove fix_recommendations.md
36+
37+
338

439
## v1.0.0 (2025-06-06)
540

0 commit comments

Comments
 (0)