From b707d2fbc7483ddb075dda1ba5c644e2797160a2 Mon Sep 17 00:00:00 2001 From: "Peter Krusche (Novartis)" Date: Fri, 19 Apr 2024 09:39:40 +0200 Subject: [PATCH] Update dependencies & changes (#26) * Update dependencies & changes * Try fix action to check changelog * ... * mailto links added malto link for each maintainer with subject title * removed banner * Shorten README.md * bump version --------- Co-authored-by: Thibaud Coroller <14895385+tcoroller@users.noreply.github.com> --- .github/workflows/check-changelog.yml | 25 ++++++++++++++++++++++ README.md | 30 +++++++++++++++++++-------- docs/CHANGELOG.md | 6 ++++++ pyproject.toml | 3 +-- 4 files changed, 53 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/check-changelog.yml diff --git a/.github/workflows/check-changelog.yml b/.github/workflows/check-changelog.yml new file mode 100644 index 0000000..24c3784 --- /dev/null +++ b/.github/workflows/check-changelog.yml @@ -0,0 +1,25 @@ +name: "Check Changelog Update" + +on: + pull_request: + branches: [ main ] # or the default branch of your repo + +jobs: + check-changelog: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Check for Changelog Updates + run: | + HEAD_CHANGELOG_HASH=$(git log -1 --format=format:%H -- docs/CHANGELOG.md) + git fetch origin ${{ github.base_ref }} + git checkout origin/${{ github.base_ref }} + BASE_CHANGELOG_HASH=$(git log -1 --format=format:%H -- docs/CHANGELOG.md) + + if [ "$BASE_CHANGELOG_HASH" == "$HEAD_CHANGELOG_HASH" ]; then + echo "Changelog must be updated with every pull request." + exit 1 + fi diff --git a/README.md b/README.md index 04cbc49..29c6663 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Deep survival analysis made easy -> :warning: :construction: **We are still working on the publication of this project and appreciate your patience until everything will be ready.** :construction: :warning: - ![CodeQC](https://github.com/Novartis/torchsurv/actions/workflows/codeqc.yml/badge.svg?branch=main) ![Docs](https://github.com/Novartis/torchsurv/actions/workflows/docs.yml/badge.svg?branch=main) [![PyPI - Version](https://img.shields.io/pypi/v/torchsurv)](https://pypi.org/project/torchsurv/) @@ -9,7 +7,6 @@ [![Documentation](https://img.shields.io/badge/GithubPage-Sphinx-blue)](https://opensource.nibr.com/torchsurv/) [![Downloads](https://static.pepy.tech/badge/torchsurv)](https://pepy.tech/project/torchsurv) - `TorchSurv` is a Python package that serves as a companion tool to perform deep survival modeling within the `PyTorch` environment. Unlike existing libraries that impose specific parametric forms on users, `TorchSurv` enables the use of custom `PyTorch`-based deep survival models. With its lightweight design, minimal input requirements, full `PyTorch` backend, and freedom from restrictive survival model parameterizations, `TorchSurv` facilitates efficient survival model implementation, particularly beneficial for high-dimensional input data scenarios. ## TL;DR @@ -43,7 +40,7 @@ cindex.p_value(method="noether", alternative="two_sided") cindex.compare(cindexB) ``` -## Installation +## Installation and dependencies First, install the package: @@ -51,7 +48,7 @@ First, install the package: pip install torchsurv ``` -or for local installation (from package root) +or for local installation (from package root / clone of this git repository): ```bash pip install -e . @@ -60,6 +57,21 @@ pip install -e . If you use Conda, you can install requirements into a conda environment using the `environment.yml` file included in the `dev` subfolder of the source repository. +Using the package has the following dependencies which will be installed automatically via pip: + +* [torch](https://pytorch.org/): Consider pre-installing if you have specific system requirements (CPU / GPU / CUDA version). +* [scipy](https://scipy.org/): We use some statistical helper functions to calculate metrics. +* [torchmetrics](https://lightning.ai/docs/torchmetrics/stable/): We use some statistical helper functions to calculate metrics. + +To run the tests and example notebooks, you need to install the following additional packages: + +* [lifelines](https://lifelines.readthedocs.io/en/latest/) +* [scikit-survival](https://scikit-survival.readthedocs.io/en/stable/) +* [pytorch_lightning](https://lightning.ai/docs/pytorch/stable/) (and [lightning](https://lightning.ai/)) + +To build the documentation and for package development, please see [the development notes](https://opensource.nibr.com/torchsurv/devnotes.html) and +[dev/environment.yml](dev/environment.yml). + ## Getting started We recommend starting with the [introductory guide](https://opensource.nibr.com/torchsurv/notebooks/introduction.html), where you'll find an overview of the package's functionalities. @@ -213,10 +225,10 @@ By contributing to this project, you agree to license your contributions under t ## Contacts -* Thibaud Coroller thibaud.coroller@novartis.com `(creator, maintainer)` -* Mélodie Monod melodie.monod@novartis.com `(creator, maintainer)` -* Peter Krusche peter.krusche@novartis.com `(author, maintainer)` -* Qian Cao qian.cao@fda.hhs.gov `(author, maintainer)` +* [Thibaud Coroller](mailto:thibaud.coroller@novartis.com?subject=TorchSurv) `(creator, maintainer)` +* [Mélodie Monod](mailto:melodie.monod@novartis.com?subject=TorchSurv) `(creator, maintainer)` +* [Peter Krusche](mailto:peter.krusche@novartis.com?subject=TorchSurv) `(author, maintainer)` +* [Qian Cao](mailto:qian.cao@fda.hhs.gov@novartis.com?subject=TorchSurv) `(author, maintainer)` If you have any questions, suggestions, or feedback, feel free to reach out the developement team [us](https://opensource.nibr.com/torchsurv/AUTHORS.html). diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 392371d..1762da4 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,12 @@ Change log ========= +Version 0.1.2 +------------- + +* Updated package documentation with publication links & badges (#9, #14, #16, #19, #21, #22, #24) +* Fixed and documented package dependencies (#1) + Version 0.1.1 ------------- diff --git a/pyproject.toml b/pyproject.toml index 0587552..8e10020 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "torchsurv" -version = "0.1.1" +version = "0.1.2" description = "Survival analysis made easy with pytorch" authors = [ {name = "Thibaud Coroller", email = "thibaud.coroller@novartis.com"}, @@ -30,7 +30,6 @@ classifiers = [ dependencies = [ "torch", - "lightning", "scipy", "numpy", "torchmetrics",