From 6ae6773b884b2f32741728be4ecf7bfe2dfa8e8d Mon Sep 17 00:00:00 2001 From: jreps Date: Wed, 16 Aug 2023 08:35:36 -0400 Subject: [PATCH 01/13] Update DESCRIPTION --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 73929b7e0..d8262eee5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: PatientLevelPrediction Type: Package Title: Developing patient level prediction using data in the OMOP Common Data Model -Version: 6.3.4 +Version: 6.3.4.9000 Date: 2023-08-15 Authors@R: c( person("Jenna", "Reps", email = "jreps@its.jnj.com", role = c("aut", "cre")), From 92047a87a304d8e0c911715bbe6a7d2068c4320d Mon Sep 17 00:00:00 2001 From: egillax Date: Fri, 25 Aug 2023 13:36:26 +0200 Subject: [PATCH 02/13] remove python setup from action yml --- .github/workflows/R_CMD_check_Hades.yaml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/R_CMD_check_Hades.yaml b/.github/workflows/R_CMD_check_Hades.yaml index 27dcc8d23..ad343813d 100644 --- a/.github/workflows/R_CMD_check_Hades.yaml +++ b/.github/workflows/R_CMD_check_Hades.yaml @@ -46,20 +46,6 @@ jobs: steps: - uses: actions/checkout@v2 - - - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: "3.7" - activate-environment: r-reticulate - - - name: python main dependencies - run: conda install --name r-reticulate numpy scipy scikit-learn pandas pydotplus joblib - - - name: python json dependencies - run: conda install --name r-reticulate -c conda-forge sklearn-json - - - name: python scikit-survival dependencies - run: conda install --name r-reticulate -c sebp scikit-survival - uses: r-lib/actions/setup-r@v2 with: From 05d79ac5261942c85dc7b1f8934d1a930c91e8d6 Mon Sep 17 00:00:00 2001 From: egillax Date: Fri, 25 Aug 2023 13:36:26 +0200 Subject: [PATCH 03/13] remove python setup from action yml --- .github/workflows/R_CMD_check_Hades.yaml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.github/workflows/R_CMD_check_Hades.yaml b/.github/workflows/R_CMD_check_Hades.yaml index 27dcc8d23..3d9835b69 100644 --- a/.github/workflows/R_CMD_check_Hades.yaml +++ b/.github/workflows/R_CMD_check_Hades.yaml @@ -46,20 +46,6 @@ jobs: steps: - uses: actions/checkout@v2 - - - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: "3.7" - activate-environment: r-reticulate - - - name: python main dependencies - run: conda install --name r-reticulate numpy scipy scikit-learn pandas pydotplus joblib - - - name: python json dependencies - run: conda install --name r-reticulate -c conda-forge sklearn-json - - - name: python scikit-survival dependencies - run: conda install --name r-reticulate -c sebp scikit-survival - uses: r-lib/actions/setup-r@v2 with: @@ -83,11 +69,6 @@ jobs: with: extra-packages: any::rcmdcheck needs: check - - - name: use r-reticulate environment - run: | - reticulate::use_condaenv("r-reticulate", required = TRUE) - shell: Rscript {0} - uses: r-lib/actions/check-r-package@v2 with: From 98cf353981721f09d955c38be8a24c3d9d9c172c Mon Sep 17 00:00:00 2001 From: egillax Date: Fri, 25 Aug 2023 13:44:04 +0200 Subject: [PATCH 04/13] update deprecated actions --- .github/workflows/R_CMD_check_Hades.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/R_CMD_check_Hades.yaml b/.github/workflows/R_CMD_check_Hades.yaml index 3d9835b69..5021748dc 100644 --- a/.github/workflows/R_CMD_check_Hades.yaml +++ b/.github/workflows/R_CMD_check_Hades.yaml @@ -51,9 +51,9 @@ jobs: with: r-version: ${{ matrix.config.r }} - - uses: r-lib/actions/setup-tinytex@v1 + - uses: r-lib/actions/setup-tinytex@v2 - - uses: r-lib/actions/setup-pandoc@v1 + - uses: r-lib/actions/setup-pandoc@v2 - name: Install system requirements if: runner.os == 'Linux' From 40aff5b030401367811a419d4c24f1fb7eac74e0 Mon Sep 17 00:00:00 2001 From: egillax Date: Fri, 25 Aug 2023 14:45:37 +0200 Subject: [PATCH 05/13] fix decision tree node deSerialization for sklearn>=1.3 --- R/SklearnToJson.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/SklearnToJson.R b/R/SklearnToJson.R index 9c1dba1ae..2a2771338 100644 --- a/R/SklearnToJson.R +++ b/R/SklearnToJson.R @@ -89,7 +89,11 @@ deSerializeTree <- function(tree_dict, nFeatures, nClasses, nOutputs) { reticulate::tuple(reticulate::py_to_r(tree_dict["nodes"][i]))) } - names = list("left_child", "right_child", "feature", "threshold", "impurity", "n_node_samples", "weighted_n_node_samples") + names <- list("left_child", "right_child", "feature", "threshold", "impurity", "n_node_samples", "weighted_n_node_samples") + if (length(tree_dict["nodes"][0])==8) { + # model used sklearn>=1.3 which added a parameter + names[[8]] <- "missing_go_to_left" + } sklearn <- reticulate::import("sklearn") np <- reticulate::import("numpy", convert = FALSE) From 790f31798be3740b979130324984ee96f7b400e0 Mon Sep 17 00:00:00 2001 From: egillax Date: Fri, 25 Aug 2023 14:45:57 +0200 Subject: [PATCH 06/13] tell windows where miniconda is --- .github/workflows/R_CMD_check_Hades.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/R_CMD_check_Hades.yaml b/.github/workflows/R_CMD_check_Hades.yaml index 5021748dc..e63a80757 100644 --- a/.github/workflows/R_CMD_check_Hades.yaml +++ b/.github/workflows/R_CMD_check_Hades.yaml @@ -64,6 +64,8 @@ jobs: do eval sudo $cmd done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') + if: runner.os == 'Windows' + run: Add-Content $env:PATH "C:\Miniconda" - uses: r-lib/actions/setup-r-dependencies@v2 with: From 93bc937598ef7e32235e458f289603644c5c7bc8 Mon Sep 17 00:00:00 2001 From: egillax Date: Fri, 25 Aug 2023 14:47:27 +0200 Subject: [PATCH 07/13] separate workflow item for windows miniconda --- .github/workflows/R_CMD_check_Hades.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/R_CMD_check_Hades.yaml b/.github/workflows/R_CMD_check_Hades.yaml index e63a80757..55bdd25a5 100644 --- a/.github/workflows/R_CMD_check_Hades.yaml +++ b/.github/workflows/R_CMD_check_Hades.yaml @@ -64,6 +64,8 @@ jobs: do eval sudo $cmd done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') + + - name: Tell windows about miniconda if: runner.os == 'Windows' run: Add-Content $env:PATH "C:\Miniconda" From 89505933d95896060dd1647ea66906bfd74a6ade Mon Sep 17 00:00:00 2001 From: Egill Axfjord Fridgeirsson Date: Fri, 25 Aug 2023 15:00:37 +0200 Subject: [PATCH 08/13] use bash to add windows path --- .github/workflows/R_CMD_check_Hades.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/R_CMD_check_Hades.yaml b/.github/workflows/R_CMD_check_Hades.yaml index 55bdd25a5..515d110a1 100644 --- a/.github/workflows/R_CMD_check_Hades.yaml +++ b/.github/workflows/R_CMD_check_Hades.yaml @@ -66,8 +66,9 @@ jobs: done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') - name: Tell windows about miniconda - if: runner.os == 'Windows' - run: Add-Content $env:PATH "C:\Miniconda" + shell: bash + run: | + echo "C:\Miniconda" >> $GITHUB_PATH - uses: r-lib/actions/setup-r-dependencies@v2 with: From 23bd6bbc01505ab9563d87e03935d8f801be7fa3 Mon Sep 17 00:00:00 2001 From: Egill Axfjord Fridgeirsson Date: Fri, 25 Aug 2023 15:51:32 +0200 Subject: [PATCH 09/13] Update R_CMD_check_Hades.yaml --- .github/workflows/R_CMD_check_Hades.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R_CMD_check_Hades.yaml b/.github/workflows/R_CMD_check_Hades.yaml index 515d110a1..e3dc98159 100644 --- a/.github/workflows/R_CMD_check_Hades.yaml +++ b/.github/workflows/R_CMD_check_Hades.yaml @@ -68,7 +68,7 @@ jobs: - name: Tell windows about miniconda shell: bash run: | - echo "C:\Miniconda" >> $GITHUB_PATH + echo "C:\Miniconda\bin" >> $GITHUB_PATH - uses: r-lib/actions/setup-r-dependencies@v2 with: From 84602e7a767a4519a4eb22b50f1373299830aa76 Mon Sep 17 00:00:00 2001 From: Egill Axfjord Fridgeirsson Date: Fri, 25 Aug 2023 16:11:24 +0200 Subject: [PATCH 10/13] Update R_CMD_check_Hades.yaml --- .github/workflows/R_CMD_check_Hades.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/R_CMD_check_Hades.yaml b/.github/workflows/R_CMD_check_Hades.yaml index e3dc98159..8e27ec827 100644 --- a/.github/workflows/R_CMD_check_Hades.yaml +++ b/.github/workflows/R_CMD_check_Hades.yaml @@ -65,10 +65,10 @@ jobs: eval sudo $cmd done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') - - name: Tell windows about miniconda - shell: bash - run: | - echo "C:\Miniconda\bin" >> $GITHUB_PATH + - name: Setup conda + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: "r-reticulate" - uses: r-lib/actions/setup-r-dependencies@v2 with: From d9a609c7382d13d33f85a5d1691565ca2e0ea42a Mon Sep 17 00:00:00 2001 From: Egill Axfjord Fridgeirsson Date: Fri, 25 Aug 2023 17:10:10 +0200 Subject: [PATCH 11/13] Update R_CMD_check_Hades.yaml --- .github/workflows/R_CMD_check_Hades.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/R_CMD_check_Hades.yaml b/.github/workflows/R_CMD_check_Hades.yaml index 8e27ec827..b85c0c946 100644 --- a/.github/workflows/R_CMD_check_Hades.yaml +++ b/.github/workflows/R_CMD_check_Hades.yaml @@ -22,7 +22,7 @@ jobs: config: - {os: windows-latest, r: 'release'} # Does not appear to have Java 32-bit, hence the --no-multiarch - {os: macOS-latest, r: 'release'} - - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-22.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"} env: GITHUB_PAT: ${{ secrets.GH_TOKEN }} @@ -63,7 +63,7 @@ jobs: while read -r cmd do eval sudo $cmd - done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') + done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "22.04"))') - name: Setup conda uses: conda-incubator/setup-miniconda@v2 From 0d32abd6bca82079b462523a4672aa4e35c2bafb Mon Sep 17 00:00:00 2001 From: egillax Date: Fri, 25 Aug 2023 18:03:35 +0200 Subject: [PATCH 12/13] prepare release --- DESCRIPTION | 2 +- NEWS.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 73929b7e0..a16e3f37e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: PatientLevelPrediction Type: Package Title: Developing patient level prediction using data in the OMOP Common Data Model -Version: 6.3.4 +Version: 6.3.5 Date: 2023-08-15 Authors@R: c( person("Jenna", "Reps", email = "jreps@its.jnj.com", role = c("aut", "cre")), diff --git a/NEWS.md b/NEWS.md index 33ce2fe7d..be5c6e18f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +PatientLevelPrediction 6.3.5 +====================== +- Fix sklearnToJson to be compatible with scikit-learn>=1.3 +- Fix github actions so it's not hardcoded to use python 3.7 + + PatientLevelPrediction 6.3.4 ====================== - added spline feature engineering From 2653c39c8524f7563eb23150146cc5054a2b3f71 Mon Sep 17 00:00:00 2001 From: egillax Date: Fri, 25 Aug 2023 18:17:51 +0200 Subject: [PATCH 13/13] update python version mentioned in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 52a2ac8bc..838a82cff 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ System Requirements Requires R (version 4.0 or higher). Installation on Windows requires [RTools](http://cran.r-project.org/bin/windows/Rtools/). Libraries used in PatientLevelPrediction require Java and Python. The python installation is required for some of the machine learning algorithms. We advise to -install Python 3.7 using Anaconda (https://www.continuum.io/downloads). +install Python 3.8 or higher using Anaconda (https://www.continuum.io/downloads). Getting Started ===============