Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix failing tests on Linux #882

Merged
merged 10 commits into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ Imports:
stringr,
tidyr,
tlf
Suggests:
Suggests:
ggplot2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IndrajeetPatil @PavelBal @msevestre
Do we want to have tlf and patchwork as mandatory prerequisites (like now) or is it sufficient to have them as optional prereqs?
I would vote for optional, because - except for plots - ospsuite is still fully functional without those packages installed.

Copy link
Member Author

@IndrajeetPatil IndrajeetPatil Apr 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly speaking, I think this function (plotGrid()) should live in tlf. It sticks out like a sore thumb in ospsuite at the moment. We can re-export it from ospsuite for convenience, but it doesn't feel like its natural home.

In any case, I can move tlf and patchwork to Suggests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I think this should be part of a separate PR. This is not in the scope of the current PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function should live in tlf.

Which function?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plotGrid()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a general plotting function with no ties to DataCombined, and so more appropriate for tlf than ospsuite.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok. Yes, I agree. Would expect it in the tlf as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I will create a separate issue to track this, both here and in tlf.

knitr,
rmarkdown,
testthat (>= 2.1.0),
vdiffr (>= 1.0.0)
testthat (>= 3.1.0),
vdiffr (>= 1.0.4)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.2
Expand Down
26 changes: 26 additions & 0 deletions R/plot-grid.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#' library(ggplot2)
#' library(tlf)
#'
#' # only `{tlf}` ---------------------
#'
#' # plots to be arranged in a grid
#' set.seed(123)
#' ls_plots <- list(
Expand All @@ -37,6 +39,30 @@
#'
#' # plot the grid
#' plotGrid(plotGridObj)
#'
#' # `{tlf}` and `{ggplot2}` ---------------------
#'
#' # `{tlf}` plot
#' set.seed(123)
#' p1 <- tlf::plotBoxWhisker(mtcars,
#' dataMapping = tlf::BoxWhiskerDataMapping$new(x = "am", y = "wt"), outliers = FALSE
#' )
#'
#' # custom `{ggplot2}` plot
#' set.seed(123)
#' p2 <- ggplot(mtcars, aes(wt, mpg)) +
#' geom_point()
#'
#' # create an instance of plot configuration class
#' plotGridObj2 <- PlotGridConfiguration$new(list(p1, p2))
#'
#' # specify further customizations for the plot grid
#' plotGridObj2$nColumns <- 1L
#' plotGridObj2$tagLevels <- "i"
#'
#' # plot the grid
#' plotGrid(plotGridObj2)
#'
#' @references
#' For more, see: <https://patchwork.data-imaginist.com/articles/patchwork.html>
#'
Expand Down
13 changes: 10 additions & 3 deletions R/utilities-data-importer-configuration.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,26 @@ createImporterConfigurationForFile <- function(filePath, sheet = NULL) {
#'
#' @return A new `DataImporterConfiguration` object to be used with
#' `loadDataSetsFromExcel()`.
#' @export
#'
#' @examples
#' configurationFilePath <- system.file("extdata", "dataImporterConfiguration.xml", package = "ospsuite")
#'
#' configurationFilePath <- system.file(
#' "extdata", "dataImporterConfiguration.xml",
#' package = "ospsuite"
#' )
#'
#' importerConfiguration <- loadDataImporterConfiguration(configurationFilePath)
#' # Specifyin which sheet to load
#'
#' # Specifying which sheet to load
#' importerConfiguration$sheets <- "TestSheet_1"
#' xlsFilePath <- system.file("extdata", "CompiledDataSet.xlsx", package = "ospsuite")
#' dataSets <- loadDataSetsFromExcel(
#' xlsFilePath = xlsFilePath,
#' importerConfigurationOrPath = importerConfiguration,
#' importAllSheets = FALSE
#' )
#'
#' @export
loadDataImporterConfiguration <- function(configurationFilePath) {
validateIsString(configurationFilePath)
importerTask <- getNetTask("DataImporterTask")
Expand Down
12 changes: 10 additions & 2 deletions R/utilities-data-set.R
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ dataSetToTibble <- function(dataSets) {
#' @export
#'
#' @examples
#' xlsFilePath <- system.file("extdata", "CompiledDataSet.xlsx", package = "ospsuite")
#'
#' xlsFilePath <- system.file(
#' "extdata", "CompiledDataSet.xlsx",
#' package = "ospsuite"
#' )
#'
#' importerConfiguration <- createImporterConfigurationForFile(xlsFilePath)
#' importerConfiguration$sheets <- "TestSheet_1"
#'
Expand All @@ -146,7 +151,10 @@ dataSetToTibble <- function(dataSets) {
#' importAllSheets = FALSE
#' )
#'
#' importerConfigurationFilePath <- system.file("extdata", "dataImporterConfiguration.xml", package = "ospsuite")
#' importerConfigurationFilePath <- system.file(
#' "extdata", "dataImporterConfiguration.xml",
#' package = "ospsuite"
#' )
#'
#' dataSets <- loadDataSetsFromExcel(
#' xlsFilePath = xlsFilePath,
Expand Down
4 changes: 2 additions & 2 deletions R/utilities-pk-analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ pkAnalysesToDataFrame <- function(pkAnalyses) {
#' @rdname pkAnalysesToDataFrame
#'
#' @export
pkAnalysesToTibble <- function(pkAnalysess) {
df <- pkAnalysesToDataFrame(pkAnalysess)
pkAnalysesToTibble <- function(pkAnalyses) {
df <- pkAnalysesToDataFrame(pkAnalyses)

# consistently return a tibble data frame
return(dplyr::as_tibble(df))
Expand Down
4 changes: 2 additions & 2 deletions R/utilities-population.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ populationToDataFrame <- function(population) {
#' @rdname populationToDataFrame
#'
#' @export
populationToTibble <- function(populations) {
df <- populationToDataFrame(populations)
populationToTibble <- function(population) {
df <- populationToDataFrame(population)

# consistently return a tibble data frame
return(dplyr::as_tibble(df))
Expand Down
4 changes: 1 addition & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ environment:
NOT_CRAN: true
KEEP_VIGNETTES: true
R_ARCH: x64
R_VERSION: "4.0.5"
R_VERSION: 4.1.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's important to test on 4.1.0 now because visual regression tests are running only on R > 4.1.

COVERALLS_TOKEN:
secure: xIz/WZT0ex3bs/CMBJTzzdXLhl3sqfSqJ3MshlSY03pZKuyYQN7Z1FprVgnlFMUZ



before_build:
- nuget sources add -name utility -source https://ci.appveyor.com/nuget/ospsuite-utility
- nuget sources add -name serializer -source https://ci.appveyor.com/nuget/ospsuite-serializer
Expand Down
11 changes: 9 additions & 2 deletions man/loadDataImporterConfiguration.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions man/loadDataSetsFromExcel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/pkAnalysesToDataFrame.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions man/plotGrid.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/populationToDataFrame.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading