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

Fixes #1271 remove blanks before anchors in titles #1272

Merged
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
21 changes: 12 additions & 9 deletions R/captions.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ captions <- list(
),
demography = list(
parameterSection = function(sectionId, parameterName) {
paste("##", parameterName, "distributions", anchor(sectionId))
paste("## ", parameterName, " distributions", anchor(sectionId), sep = "")
},
xParameterSection = function(sectionId, parameterName) {
paste("## ", parameterName, "-dependence ", anchor(sectionId), sep = "")
paste("## ", parameterName, "-dependence", anchor(sectionId), sep = "")
},
yParameterSection = function(sectionId, parameterName) {
paste("###", parameterName, anchor(sectionId))
paste("### ", parameterName, anchor(sectionId), sep = "")
},
populationSection = function(sectionId, simulationSetName, descriptor, level = 4) {
tagLevel <- paste0(rep("#", level), collapse = "")
sectionTitle <- paste(tagLevel, "For", reportSimulationSet(simulationSetName, descriptor))
return(paste(sectionTitle, anchor(sectionId)))
return(paste(sectionTitle, anchor(sectionId), sep = ""))
},
histogramLegend = function(data, observed = FALSE) {
if (observed) {
Expand Down Expand Up @@ -163,10 +163,10 @@ captions <- list(
paste0("PK parameters for ", reportSimulationSet(simulationSetName, descriptor))
},
outputSection = function(pathName, pathID) {
paste("## PK Parameters of", pathName, anchor(pathID))
paste("## PK Parameters of ", pathName, anchor(pathID), sep = "")
},
parameterSection = function(parameterName, parameterID) {
paste("###", parameterName, anchor(parameterID))
paste("### ", parameterName, anchor(parameterID), sep = "")
},
boxplot = function(parameterName, pathName, simulationSetName, descriptor, plotScale = "linear") {
paste(
Expand Down Expand Up @@ -324,19 +324,22 @@ getTimeRangeCaption <- function(timeRangeName, reference, simulationSetName) {
if (isIncluded(timeRangeName, ApplicationRanges$total)) {
return(paste(
"### For total simulation time range",
anchor(paste0(reference, "-", removeForbiddenLetters(simulationSetName), "-", "total"))
anchor(paste0(reference, "-", removeForbiddenLetters(simulationSetName), "-", "total")),
sep = ""
))
}
if (isIncluded(timeRangeName, ApplicationRanges$firstApplication)) {
return(paste(
"### For first application range",
anchor(paste0(reference, "-", removeForbiddenLetters(simulationSetName), "-", "first"))
anchor(paste0(reference, "-", removeForbiddenLetters(simulationSetName), "-", "first")),
sep = ""
))
}
if (isIncluded(timeRangeName, ApplicationRanges$lastApplication)) {
return(paste(
"### For last application range",
anchor(paste0(reference, "-", removeForbiddenLetters(simulationSetName), "-", "last"))
anchor(paste0(reference, "-", removeForbiddenLetters(simulationSetName), "-", "last")),
sep = ""
))
}
}
Expand Down
2 changes: 1 addition & 1 deletion R/configuration-plan.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ConfigurationPlan <- R6::R6Class(
# Issue #1084: new reference title get anchor at the end of title
addTextChunk(
fileName = self$getSectionMarkdown(id),
text = paste(self$getSectionTitle(id), anchor(sectionReference))
text = paste(self$getSectionTitle(id), anchor(sectionReference), sep = "")
)
# Add section content
sectionContent <- private$.sections$content[selectedId]
Expand Down
18 changes: 9 additions & 9 deletions R/error-checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -669,25 +669,25 @@ checkSamePopulationIds <- function(setIds,
#' @keywords internal
checkMetaDataIsConsistent <- function(metaData) {
groupId <- unique(metaData$group)
if(!isOfLength(unique(metaData$unit), 1)){
if (!isOfLength(unique(metaData$unit), 1)) {
warning(
messages$inconsistentMetaData(
values = metaData$unit,
id = groupId,
values = metaData$unit,
id = groupId,
dataType = "units"
),
),
call. = FALSE
)
)
}
if(!isOfLength(unique(metaData$residualScale), 1)){
if (!isOfLength(unique(metaData$residualScale), 1)) {
warning(
messages$inconsistentMetaData(
values = metaData$residualScale,
id = groupId,
values = metaData$residualScale,
id = groupId,
dataType = "residualScale"
),
call. = FALSE
)
}
return()
}
}
10 changes: 6 additions & 4 deletions R/gof-plot-task.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ GofPlotTask <- R6::R6Class(
addTextChunk(
fileName = self$fileName,
text = paste(
"##", self$title, "for", simulationSetName,
anchor(paste0(self$reference, "-", removeForbiddenLetters(simulationSetName)))
"## ", self$title, " for ", simulationSetName,
anchor(paste0(self$reference, "-", removeForbiddenLetters(simulationSetName))),
sep = ""
)
)
for (result in taskResults) {
Expand Down Expand Up @@ -76,7 +77,8 @@ GofPlotTask <- R6::R6Class(
fileName = self$fileName,
text = paste(
"## Residuals across all simulations",
anchor(paste0(self$reference, "-residuals-across-all-simulations"))
anchor(paste0(self$reference, "-residuals-across-all-simulations")),
sep = ""
)
)
for (result in taskResults) {
Expand Down Expand Up @@ -136,7 +138,7 @@ GofPlotTask <- R6::R6Class(
resetReport(self$fileName)
addTextChunk(
fileName = self$fileName,
text = paste("#", self$title, anchor(self$reference))
text = paste("# ", self$title, anchor(self$reference), sep = "")
)
if (!is.null(self$outputFolder)) {
dir.create(file.path(self$workflowFolder, self$outputFolder), showWarnings = FALSE)
Expand Down
30 changes: 15 additions & 15 deletions R/messages.R
Original file line number Diff line number Diff line change
Expand Up @@ -255,46 +255,46 @@ messages <- list(
warningNAFoundInPKAnalysisFile = function(filePath) {
paste0(highlight("NaN"), " found in PK analysis file '", highlight(filePath), "'.")
},
warningPKAnalysesMissingIds = function(ids, setName){
warningPKAnalysesMissingIds = function(ids, setName) {
paste0(
"Missing ", highlight("IndividualIds"), " in PKAnalysis file for simulation set '",
"Missing ", highlight("IndividualIds"), " in PKAnalysis file for simulation set '",
highlight(setName), "': ",
paste0("'", highlight(ids), "'", collapse = ", ")
)
},
warningPKAnalysesMissingIds = function(ids, setName){
warningPKAnalysesMissingIds = function(ids, setName) {
paste0(
"Missing ", highlight("IndividualIds"), " in PKAnalysis file for simulation set '",
"Missing ", highlight("IndividualIds"), " in PKAnalysis file for simulation set '",
highlight(setName), "': ",
paste0("'", highlight(ids), "'", collapse = ", ")
)
},
warningMissingFromReferenceSet = function(path, simulationSetName, pkParameters = NULL){
if(is.null(pkParameters)){
warningMissingFromReferenceSet = function(path, simulationSetName, pkParameters = NULL) {
if (is.null(pkParameters)) {
return(
paste0(
"Output path '", highlight(path),
"' was NOT defined for reference simulation set '", highlight(simulationSetName),
"Output path '", highlight(path),
"' was NOT defined for reference simulation set '", highlight(simulationSetName),
"'. Ouptut path and its PK Parameters were added to the list of figures to export."
)
)
}
return(
paste0(
"The following PK Parameters '",
paste(highlight(pkParameters), collapse = "', '"),
"' were NOT defined for the Ouptut path '", highlight(path),
"' in the reference simulation set '", highlight(simulationSetName),
"The following PK Parameters '",
paste(highlight(pkParameters), collapse = "', '"),
"' were NOT defined for the Ouptut path '", highlight(path),
"' in the reference simulation set '", highlight(simulationSetName),
"'. The PK Parameters were added to the list of figures to export."
)
)
},
inconsistentMetaData = function(values, id, dataType = "units"){
inconsistentMetaData = function(values, id, dataType = "units") {
paste0(
"Inconsistent ", highlight(dataType),
"Inconsistent ", highlight(dataType),
" found within Group ID '", highlight(id), "': '",
paste0(highlight(unique(values)), collapse = "', '"), "'."
)
)
},
#----- Info messages ----
runStarting = function(runName, subRun = NULL) {
Expand Down
7 changes: 4 additions & 3 deletions R/plot-task.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ PlotTask <- R6::R6Class(
addTextChunk(
fileName = self$fileName,
text = paste(
"##", self$title, "for", simulationSetName,
anchor(paste0(self$reference, "-", removeForbiddenLetters(simulationSetName)))
"## ", self$title, " for ", simulationSetName,
anchor(paste0(self$reference, "-", removeForbiddenLetters(simulationSetName))),
sep = ""
)
)
for (result in taskResults) {
Expand Down Expand Up @@ -113,7 +114,7 @@ PlotTask <- R6::R6Class(
resetReport(self$fileName)
addTextChunk(
fileName = self$fileName,
text = paste("#", self$title, anchor(self$reference))
text = paste("# ", self$title, anchor(self$reference), sep = "")
)
if (!is.null(self$outputFolder)) {
dir.create(file.path(self$workflowFolder, self$outputFolder), showWarnings = FALSE)
Expand Down
2 changes: 1 addition & 1 deletion R/population-plot-task.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PopulationPlotTask <- R6::R6Class(
resetReport(self$fileName)
addTextChunk(
fileName = self$fileName,
text = paste("#", self$title, anchor(self$reference))
text = paste("# ", self$title, anchor(self$reference), sep = "")
)
for (result in taskResults) {
# Get both absolute and relative paths for figures and tables
Expand Down
8 changes: 6 additions & 2 deletions R/qualification-ddi.R
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,10 @@ plotQualificationDDIs <- function(configurationPlan, settings) {
# Subheading result includes anchor tag to be referenced in TOC
textChunk = paste(
paste0(rep("#", sectionLevel + 1), collapse = ""),
" ",
subplotTypeName,
anchor(paste0(sectionID, "-ddi-subunit-", length(ddiResults) + 1))
anchor(paste0(sectionID, "-ddi-subunit-", length(ddiResults) + 1)),
sep = ""
),
includeTextChunk = TRUE
)
Expand All @@ -562,8 +564,10 @@ plotQualificationDDIs <- function(configurationPlan, settings) {
# Subheading result includes anchor tag to be referenced in TOC
textChunk = paste(
paste0(rep("#", sectionLevel + 2), collapse = ""),
" ",
subplotTypeLevel,
anchor(paste0(sectionID, "-ddi-subunit-", length(ddiResults) + 1))
anchor(paste0(sectionID, "-ddi-subunit-", length(ddiResults) + 1)),
sep = ""
),
includeTextChunk = TRUE
)
Expand Down
8 changes: 4 additions & 4 deletions R/simulation-set.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ SimulationSet <- R6::R6Class(
validateIsString(simulationFile)
validateIsFileExtension(simulationFile, "pkml")
validateIsUnitFromDimension(timeUnit, "Time")

# For optional input, usually null is allowed
# but not here as it would mean that nothing would be reported
validateIsIncluded(c(applicationRanges), ApplicationRanges)
Expand All @@ -66,22 +66,22 @@ SimulationSet <- R6::R6Class(
validateIsFileExtension(massBalanceFile, "json")
self$massBalanceSettings <- jsonlite::fromJSON(massBalanceFile, simplifyVector = FALSE)[["MassBalancePlots"]]
}

# Before loading the simulation, check if the file exists
validateFileExists(simulationFile)
simulation <- ospsuite::loadSimulation(simulationFile, addToCache = FALSE)
validateVector(minimumSimulationEndTime, type = "numeric", valueRange = c(0, Inf), nullAllowed = TRUE)
# Following checks require simulation info
endTime <- max(
minimumSimulationEndTime,
minimumSimulationEndTime,
ospsuite::toUnit(
quantityOrDimension = "Time",
values = simulation$outputSchema$endTime,
targetUnit = timeUnit
)
)
validateVectorRange(timeOffset, type = "numeric", valueRange = c(0, endTime))

# Test and validate outputs and their paths
validateOutputObject(c(outputs), simulation, nullAllowed = TRUE)
validateDataSource(dataSource, c(outputs), nullAllowed = TRUE)
Expand Down
2 changes: 1 addition & 1 deletion R/utilities-goodness-of-fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ getResidualsPlotResultsInGroup <- function(data, metaData, outputId, structureSe
plotConfiguration = qqPlotConfiguration
)
goodnessOfFitCaptions[[resultId$resQQPlot]] <- getGoodnessOfFitCaptions(structureSet, "resQQPlot", residualScale, settings)

return(list(
plots = goodnessOfFitPlots,
captions = goodnessOfFitCaptions
Expand Down
2 changes: 1 addition & 1 deletion R/utilities-mass-balance.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ plotMeanMassBalance <- function(structureSet, settings = NULL) {
sectionId <- defaultFileNames$resultID(length(massBalanceResults) + 1, "mass_balance")
massBalanceResults[[sectionId]] <- saveTaskResults(
id = sectionId,
textChunk = paste("###", plotSettings$Name, anchor(sectionId)),
textChunk = paste("### ", plotSettings$Name, anchor(sectionId), sep = ""),
includeTextChunk = TRUE
)
}
Expand Down
Loading
Loading