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

Consolidate with utils #777

Merged
merged 16 commits into from
Feb 21, 2022
Merged

Consolidate with utils #777

merged 16 commits into from
Feb 21, 2022

Conversation

PavelBal
Copy link
Member

Fixes #774
Fixes #730
Fixes #714

Move all messages to utils
Add enum for global settings names
Move global settings env to ospsuite.utils
remove error checks (use from utils)
mu-symbol back to ospsuite-env.R
path separator back to ospsuite-env.R
@@ -12,9 +12,7 @@ ospsuiteEnv <- new.env(parent = emptyenv())
# name of the package. This will be used to retrieve information on the package at run time
ospsuiteEnv$packageName <- "ospsuite"

ospsuiteEnv$suiteName <- "Open Systems Pharmacology"
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved to Utils as the name is global for the whole ecosystem?

@@ -23,10 +21,6 @@ ospsuiteEnv$containerTask <- NULL
# Separator defined in OSPSuite.Core.
ospsuiteEnv$pathSeparator <- "|"

# Default values for the formatNumerics() helper 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.

Not used any more

@@ -53,7 +53,7 @@ initPKSim <- function(pksimFolderPath = NULL) {
stop("Only Windows platforms are supported")
}

suite.name <- ospsuiteEnv$suiteName
suite.name <- ospsuite.utils::getOSPSuiteUtilsSetting("suiteName")
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know, maybe move it back to this package..

#' If validations are successful, `NULL` is returned. Otherwise, error is
#' signaled.
#' @export
validateHasUnit <- function(quantity, unit) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Just moved it from the utilities.R file.

Copy link
Member

Choose a reason for hiding this comment

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

We were not exporting this function, but we do now. I think we should make an entry for this new export in NEWS.md.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually I removed as export. We didn't export it so far, and unless there is a need for it, let's not export too much.

@PavelBal
Copy link
Member Author

Mainly just using messages from utils

@PavelBal PavelBal changed the title Consolidate with utils WIP: Consolidate with utils Feb 18, 2022
@PavelBal
Copy link
Member Author

@IndrajeetPatil OK how do I make it to use the latest utils version?

@IndrajeetPatil
Copy link
Member

Can I try something by directly pushing into this PR?
I will be changing the DESCRIPTION file, so shouldn't interfere with any of your changes.

P.S. I will also be updating the utilities package on CRAN today (see Open-Systems-Pharmacology/OSPSuite.RUtils#70), but CRAN usually takes a day or two to build the binaries that AppVeyor can use.

@PavelBal
Copy link
Member Author

Can I try something by directly pushing into this PR?

sure

@IndrajeetPatil
Copy link
Member

Unfortunately, downloading the GitHub package doesn't work because we seem to be running into this issue.

But the updated version of the utility package is already on CRAN, and the binaries should be built in a day or two, and then the AppVeyor check can be run again.

R/cache.R Outdated Show resolved Hide resolved
#' If validations are successful, `NULL` is returned. Otherwise, error is
#' signaled.
#' @export
validateHasUnit <- function(quantity, unit) {
Copy link
Member

Choose a reason for hiding this comment

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

We were not exporting this function, but we do now. I think we should make an entry for this new export in NEWS.md.

R/utilities-units.R Outdated Show resolved Hide resolved
#' Names of the settings stored in ospsuiteEnv. Can be used with `getOSPSuiteSetting()`
#' @include utilities.R
#' @export
ospsuiteSettingNames <- enum(names(ospsuiteEnv))
Copy link
Member

Choose a reason for hiding this comment

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

Worth logging this new export in NEWS.md.

Copy link
Member Author

Choose a reason for hiding this comment

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

Would add it when we have the separation between user-defined "global" settings and "read-only".

@codecov-commenter
Copy link

Codecov Report

Merging #777 (b003ead) into develop (50f16d1) will decrease coverage by 0.01%.
The diff coverage is 93.47%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #777      +/-   ##
===========================================
- Coverage    90.85%   90.83%   -0.02%     
===========================================
  Files           78       76       -2     
  Lines         2121     2117       -4     
===========================================
- Hits          1927     1923       -4     
  Misses         194      194              
Impacted Files Coverage Δ
R/output-selections.R 37.50% <0.00%> (ø)
R/utilities-data-combined.R 97.43% <ø> (ø)
R/utilities.R 100.00% <ø> (ø)
R/utilities-pksim.R 45.90% <50.00%> (ø)
R/create-individual.R 78.26% <66.66%> (ø)
R/utilities-pk-analysis.R 79.48% <75.00%> (ø)
R/utilities-simulation.R 98.07% <95.00%> (ø)
R/create-population.R 100.00% <100.00%> (ø)
R/data-importer-configuration.R 95.42% <100.00%> (ø)
R/data-repository.R 88.37% <100.00%> (ø)
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 50f16d1...b003ead. Read the comment docs.

@msevestre msevestre merged commit 6b98679 into develop Feb 21, 2022
@msevestre msevestre deleted the consolidate-with-utils branch February 21, 2022 20:53
@IndrajeetPatil IndrajeetPatil changed the title WIP: Consolidate with utils Consolidate with utils Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Printable getOSPSuiteSetting: enum instead of string? Use messages from OSPSuite.RUtils
4 participants