Skip to content

Commit a429562

Browse files
Feat/update review (#86)
* 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) * Revert 78 feat/remove ignore errors in mypy settings (#79) * 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 * Revert "Feat/remove ignore errors in mypy settings (#78)" This reverts commit 3c799d0. * fix: tighten sequence checks and streamline competing-risk helpers (#81) * Mege Main in to branch (#82) * 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 * Revert "Feat/remove ignore errors in mypy settings (#78)" (#80) This reverts commit 3c799d0. * Update version to 1.0.9 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: sync version and tidy changelog (#84) * Merge main in to branch (#85) * 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 * Revert "Feat/remove ignore errors in mypy settings (#78)" (#80) This reverts commit 3c799d0. * Update version to 1.0.9 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Feat/add unit tests (#88) * tests: remove regression baselines * tests: add deterministic generation and visualize CLI integration * docs: refresh readme (#90) * fix: fix unit tests * fix: fix type annotation * fix: fix black and mypi issues --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent fc121a3 commit a429562

File tree

111 files changed

+9067
-1082
lines changed

Some content is hidden

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

111 files changed

+9067
-1082
lines changed

.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: Sync 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: Synchronize tag and pyproject version
25+
run: python scripts/check_version_match.py --fix --write
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
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
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.

.github/workflows/version-check.yml

Lines changed: 0 additions & 18 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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
additional_dependencies: [flake8-pyproject]
15+
- repo: https://github.com/pre-commit/mirrors-mypy
16+
rev: v1.15.0
17+
hooks:
18+
- id: mypy
19+
pass_filenames: false
20+
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

0 commit comments

Comments
 (0)