Skip to content

Commit

Permalink
Giving up variables.R
Browse files Browse the repository at this point in the history
  • Loading branch information
Ecnama committed Dec 2, 2024
1 parent 30aae2c commit 1e64d82
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
^\.lintr$
^LICENSE\.md$
^\.github$
^\.github$
1 change: 0 additions & 1 deletion .lintr
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ linters: linters_with_defaults(
object_name_linter = object_name_linter(styles = c("snake_case", "symbols", "SNAKE_CASE"))
) # see vignette("lintr")
encoding: "UTF-8"

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2024
COPYRIGHT HOLDER: Hector Vernet, Marie Revol, Noemie Wawrzyniak, Amance Graindorge
COPYRIGHT HOLDER: Hector Vernet, Marie Revol, Noemie Wawrzyniak, Amance Graindorge
7 changes: 5 additions & 2 deletions R/input.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
library(openxlsx)
library(readODS)

source("R/variables.R")
# Prefixes of the head of the wishes columns
Q2_PREFIX <- "Q02_Voeux->"
Q3_PREFIX <- "Q03_VoeuxEMIR->"
Q4_PREFIX <- "Q04_voeuxMICA->"

#' Reads the file and selects the needed columns
#'
Expand Down Expand Up @@ -98,4 +101,4 @@ parse_file <- function(file_path) {
data[i, 3:(length(synthesized_wishes) + 2)] <- synthesized_wishes
}
return(data)
}
}
6 changes: 0 additions & 6 deletions R/variables.R

This file was deleted.

2 changes: 1 addition & 1 deletion tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ library(mockr)
library(openxlsx)
library(readODS)

test_check("ADSPlanner")
test_check("ADSPlanner")
2 changes: 1 addition & 1 deletion tests/testthat/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ parse_file_output <- data.frame(
Aff_V3_S1 = c(NA_character_, NA_character_, NA_character_),
Aff_V3_S2 = c(NA_character_, NA_character_, NA_character_),
Aff_V3_S3 = c(NA_character_, NA_character_, NA_character_)
)
)
2 changes: 1 addition & 1 deletion tests/testthat/test-input.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ test_that("parse_file throws error for invalid data", {
synthesize_wishes = function(wishes) stop("Unknown filière")
)
expect_error(parse_file("../data/test_file.xlsx"), "Error while synthesizing the wishes \\(l\\.1\\): Unknown filière")
})
})

0 comments on commit 1e64d82

Please sign in to comment.