From 60ec3c5d3079ad15e33700946f8267bbeacaeff2 Mon Sep 17 00:00:00 2001 From: Stephan Daus Date: Fri, 10 Jan 2025 15:57:46 +0100 Subject: [PATCH 1/5] Removed quarto-setup GHA --- .github/workflows/quarto-setup.yaml | 121 ---------------------------- 1 file changed, 121 deletions(-) delete mode 100644 .github/workflows/quarto-setup.yaml diff --git a/.github/workflows/quarto-setup.yaml b/.github/workflows/quarto-setup.yaml deleted file mode 100644 index 90ad74a..0000000 --- a/.github/workflows/quarto-setup.yaml +++ /dev/null @@ -1,121 +0,0 @@ -name: 'Setup Quarto' -author: 'Christophe Dervieux' -description: 'This action will setup Quarto from the git repository https://github.com/quarto-dev/quarto-cli/' -inputs: - version: - description: 'The version of Quarto to use. Either a release tag without "v" prefix (e.g., "0.9.486"), "pre-release" for latest built dev version, or "release", for the latest stable version.' - required: false - default: 'release' - tinytex: - description: 'If true, install TinyTex, required for PDF rendering' - required: false - default: 'false' -outputs: - version: - description: 'The installed version of quarto.' -runs: - using: 'composite' - steps: - - name: 'Choose which binary to use' - run: | - # Select correct bundle for OS type - case $RUNNER_OS in - "Linux") - echo "BUNDLE_EXT=linux-amd64.deb" >> $GITHUB_ENV - ;; - "macOS") - echo "BUNDLE_EXT=macos.pkg" >> $GITHUB_ENV - ;; - "Windows") - echo "BUNDLE_EXT=win.msi" >> $GITHUB_ENV - ;; - *) - echo "$RUNNER_OS not supported" - exit 1 - ;; - esac - shell: bash - working-directory: ${{ runner.temp }} - - name: 'Download Quarto' - id: download-quarto - env: - GITHUB_TOKEN: ${{ github.token }} - run: | - if [ ${{ runner.os }} != "Windows" ]; then - # On Windows scoop will be used so no need to download the release - if [ "${{inputs.version}}" == "release" ]; then - # download the latest stable release - gh release download --repo github.com/quarto-dev/quarto-cli --pattern ${{ format('*{0}', env.BUNDLE_EXT) }} - version=$(curl https://quarto.org/docs/download/_download.json | jq -r '.version') - echo "version=${version}" >> $GITHUB_OUTPUT - elif [ "${{inputs.version}}" == "LATEST" -o "${{inputs.version}}" == "pre-release" ]; then - # get latest pre release version - version=$(curl https://quarto.org/docs/download/_prerelease.json | jq -r '.version') - wget https://github.com/quarto-dev/quarto-cli/releases/download/v$version/quarto-$version-${{env.BUNDLE_EXT}} - echo "version=${version}" >> $GITHUB_OUTPUT - else - # download a specific release - wget https://github.com/quarto-dev/quarto-cli/releases/download/v${{inputs.version}}/quarto-${{inputs.version}}-${{env.BUNDLE_EXT}} - echo "version=${{inputs.version}}" >> $GITHUB_OUTPUT - fi - echo "installer=$(ls quarto*${{ env.BUNDLE_EXT }})" >> $GITHUB_OUTPUT - else - : # do nothing for now (https://github.com/quarto-dev/quarto-actions/issues/59 :facepalm:) - # FIXME: how to get version information from scoop in windows runners? - # send the cderv bat-signal! - fi - shell: bash - working-directory: ${{ runner.temp }} - - name: 'Install Quarto' - run: | - # Install quarto - [ ${{ runner.os }} != "Windows" ] && installer=${{ steps.download-quarto.outputs.installer }} - case $RUNNER_OS in - "Linux") - sudo apt install ./$installer - ;; - "macOS") - sudo installer -pkg ./$installer -target '/' - ;; - "Windows") - # can't install msi for now so use scoop - if [ "${{inputs.version}}" == "release" ] - then - powershell -File $GITHUB_ACTION_PATH/install-quarto-windows.ps1 - else - powershell -File $GITHUB_ACTION_PATH/install-quarto-windows.ps1 ${{ inputs.version }} - fi - ;; - *) - echo "$RUNNER_OS not supported" - exit 1 - ;; - esac - [ ${{ runner.os }} != "Windows" ] && rm $installer - echo "Quarto Installed !" - shell: bash - working-directory: ${{ runner.temp }} - - name: 'Install TinyTeX' - env: - QUARTO_PRINT_STACK: true - if: ${{ inputs.tinytex == 'true'}} - run: | - quarto install tool tinytex --no-prompt --log-level warning - case $RUNNER_OS in - "Linux") - echo "$HOME/bin" >> $GITHUB_PATH - ;; - "macOS") - echo "$(dirname $(find ~/Library/TinyTeX -name tlmgr))" >> $GITHUB_PATH - ;; - "Windows") - echo "$(dirname $(find $APPDATA/TinyTeX -name tlmgr.bat))" >> $GITHUB_PATH - ;; - *) - echo "$RUNNER_OS not supported" - exit 1 - ;; - esac - echo "TinyTeX installed !" - shell: bash - working-directory: ${{ runner.temp }} \ No newline at end of file From 7e25f0206ad65f50ca8ffc43685c3350e57da843 Mon Sep 17 00:00:00 2001 From: Stephan Daus Date: Fri, 10 Jan 2025 15:59:13 +0100 Subject: [PATCH 2/5] Vignette modifications --- vignettes/vig_02_project_setup.qmd | 4 ++-- vignettes/vig_04_prepare_data.qmd | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vignettes/vig_02_project_setup.qmd b/vignettes/vig_02_project_setup.qmd index ca9d323..d7e1828 100644 --- a/vignettes/vig_02_project_setup.qmd +++ b/vignettes/vig_02_project_setup.qmd @@ -16,7 +16,7 @@ setwd(tempdir()) # Create a research project folder from scratch - The following is intended for creating and maintaining a consistent and well-organized folder structure, based on some international "standards". -- If you have already set up a project structure or data collection, jump to [step 2](). +- If you have already set up a project structure or data collection, jump to @sec-tailor-project-settings. ## Whatever you chose... @@ -85,7 +85,7 @@ saros.base::initialize_saros_project( ``` -# Tailor project settings +# Tailor project settings{#sec-tailor-project-settings} - Saros expands upon the inheritance idea in Quarto and allows setting and exempting settings inheritance-wise: organization level, project level, report cycle, chapter and chunk. This means that one can set defaults which can be overridden per project or per report. - For instance, [NIFU](www.nifu.no) sets its organization-level settings that apply to all projects in one global R-file, which contains figure colour palette rules, special functions, and so forth. diff --git a/vignettes/vig_04_prepare_data.qmd b/vignettes/vig_04_prepare_data.qmd index 463bc2d..6e3410e 100644 --- a/vignettes/vig_04_prepare_data.qmd +++ b/vignettes/vig_04_prepare_data.qmd @@ -118,7 +118,7 @@ data <- Variable labels are typically the actual question formulation in a questionnaire, or a definition of how data has been collected. -- All variables to be used must have a label, this also applies to e.g. independent variables that you have created yourself. See the [`{labelled}`](https://cran.r-project.org/web/packages/labelled/index.html) package for functions to easily set labels if something is missing. +- All variables to be used must have a label, this also applies to e.g. independent variables that you have created yourself. See the [`{labelled}`](https://CRAN.R-project.org/package=labelled) package for functions to easily set labels if something is missing. - Note that in R, variable labels are not considered to be still valid if you have changed the variable's content (with e.g. `mutate()`), and **the labels therefore unfortunately disappear**. However, you can copy them back in afterwards with `labelled::copy_labels_from(original_data)`. From fd81347c3794a4dd590f725ecb37c5b6762cdc82 Mon Sep 17 00:00:00 2001 From: Stephan Daus Date: Fri, 10 Jan 2025 16:33:34 +0100 Subject: [PATCH 3/5] NEWS --- NEWS.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NEWS.md b/NEWS.md index ad45411..ca82ac4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,14 @@ ## Major changes * Total revision of the entire architecture for maximum flexibility, stability and performance. +* Uses glue templates for creating chunks, see `refine_chapter_structure()`. +* `draft_report()` +* Breaking changes for mesos setup, now uses `setup_mesos()` as well for creating stub files referring to a smaller set of main files created by `draft_report()`. +* Countless bugfixes. + +## Minor changes +* Helper function `remove_entry_from_sidebar()` for post-processing HTML-files +* Many more validations of arguments and better error messages. # saros.base 0.2.2 From 38103387a6709411e6003814103b3b7caf96969e Mon Sep 17 00:00:00 2001 From: Stephan Daus Date: Fri, 10 Jan 2025 16:35:27 +0100 Subject: [PATCH 4/5] cran-comments --- cran-comments.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cran-comments.md b/cran-comments.md index 118005b..f718c29 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,10 +1,4 @@ ## R CMD check results -0 errors | 0 warnings | 4 notes +0 errors | 0 warnings | 0 notes -## Note - -- Fixed return values docs and removed write-by-default. -- Remaining cat() use is merely for writing to disk (main purpose of functions) or if log file has been specified (defaults to off). -- URLs are correct (will be valid upon release). -- rhub fails for MacOS-R-devel due to failure in building RApiSerialize 0.1.3. I have waited to see if it magically got fixed but to no avail. Pretty sure there is nothing I can do on my end, as all other runs succeed. \ No newline at end of file From 58b79151a24e542fb5a66bd231db39a050479831 Mon Sep 17 00:00:00 2001 From: Stephan Daus Date: Fri, 10 Jan 2025 16:52:18 +0100 Subject: [PATCH 5/5] vignette fixes --- vignettes/vig_02_project_setup.qmd | 2 +- vignettes/vig_04_prepare_data.qmd | 4 ++-- vignettes/vig_06_prepare_chapter_overview.qmd | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vignettes/vig_02_project_setup.qmd b/vignettes/vig_02_project_setup.qmd index d7e1828..05aa3ea 100644 --- a/vignettes/vig_02_project_setup.qmd +++ b/vignettes/vig_02_project_setup.qmd @@ -88,7 +88,7 @@ saros.base::initialize_saros_project( # Tailor project settings{#sec-tailor-project-settings} - Saros expands upon the inheritance idea in Quarto and allows setting and exempting settings inheritance-wise: organization level, project level, report cycle, chapter and chunk. This means that one can set defaults which can be overridden per project or per report. -- For instance, [NIFU](www.nifu.no) sets its organization-level settings that apply to all projects in one global R-file, which contains figure colour palette rules, special functions, and so forth. +- For instance, [NIFU](https:://www.nifu.no) sets its organization-level settings that apply to all projects in one global R-file, which contains figure colour palette rules, special functions, and so forth. - This is currently limited to R-files used for generating reports and for rendering reports. The yaml metadata is currently duplicated per project, and will be in the future centralized in one location. - File lanes in particular must be standardized across data collection cycles. Avoid that each implementation has its own folder in the project's main folder - experience shows that it is very difficult to keep consistent folder structures across years when you are rarely confronted with how things have been done in the past. Try as much as possible to have the year folder at the bottom of the hierarchy - even if this means that you have to copy a number of subfolders every year. diff --git a/vignettes/vig_04_prepare_data.qmd b/vignettes/vig_04_prepare_data.qmd index 6e3410e..cbca19e 100644 --- a/vignettes/vig_04_prepare_data.qmd +++ b/vignettes/vig_04_prepare_data.qmd @@ -27,7 +27,7 @@ The principles of variable names and variable labels aim to allow Saros to autom - Try to avoid letters that look the same in upper and lower case. - - See \[standard variable names in longitudinal projects\](vig_05_standard_variable_names.qmd) + - See [standard variable names in longitudinal projects](vig_05_standard_variable_names.qmd) - Optimally, all batteries should share the same prefix in the variable name, which is unique from all other batteries/variables. For example, one can name the variables s_100-s_120 for one battery, g_121-g_129 for another battery, etc. and specify that `variable_name_separator = "_"`. However, another equally fine approach is to name variables in a self-explanatory @@ -80,7 +80,7 @@ ex_survey |> map(~levels(.x)) ``` -- All categorical variables should be of the factor type with all possible response options as its categorical levels (levels). This makes the graphs and tables as correct as possible. See example below to correct this if you receive the data as e.g. `character()` or `integer()` (something you should definitely avoid at all costs as it is time-consuming to restore the data. +- All categorical variables should be of the factor type with all possible response options as its categorical levels (levels). This makes the graphs and tables as correct as possible. See example below to correct this if you receive the data as e.g. `character()` or `integer()` (something you should definitely avoid at all costs as it is time-consuming to restore the data). ```{r} data <- diff --git a/vignettes/vig_06_prepare_chapter_overview.qmd b/vignettes/vig_06_prepare_chapter_overview.qmd index ec6a7b5..937365d 100644 --- a/vignettes/vig_06_prepare_chapter_overview.qmd +++ b/vignettes/vig_06_prepare_chapter_overview.qmd @@ -8,7 +8,7 @@ vignette: > The chapter overview can be made when variable names have been determined. -Each report must have a table, where each line is a chapter. This is typically an Excel file that is easy to edit manually. See an example [here](chapter_overview.xlsx). +Each report must have a table, where each line is a chapter. This is typically an Excel file that is easy to edit manually, or create a data frame in R. ![](screenshot_chapter_overview.png) @@ -29,4 +29,4 @@ May also contain: - Or other variables you may have - can be fine if you need to use the same chapter overview to keep track of who at the client is responsible for the topic, where in the questionnaire the questions are, etc. These are ignored by saros. -`saros::draft_report()` will produce a log of which variables exist in the dataset but are not used in chapter overview, auxiliary_variables or mesos_var. \ No newline at end of file +`saros::draft_report()` will produce a log of which variables exist in the dataset but are not used in chapter overview, auxiliary_variables or mesos_var.