-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add observed data to time profiles #674
base: main
Are you sure you want to change the base?
Conversation
…for conversion of observed data for plotting
Merge branch 'main' into add-observed-data-to-time-profiles # Conflicts: # R/sensivitity-time-profiles.R
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #674 +/- ##
==========================================
+ Coverage 85.62% 85.94% +0.32%
==========================================
Files 29 29
Lines 2163 2220 +57
==========================================
+ Hits 1852 1908 +56
- Misses 311 312 +1 ☔ View full report in Codecov by Sentry. |
R/sensivitity-time-profiles.R
Outdated
timeSeriesDataFrame <- timeSeriesDataFrame %>% | ||
dplyr::filter(grepl("Concentration", Dimension)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if restricting to Concentrations is really needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, any kind of dimension should be supported.
R/sensivitity-time-profiles.R
Outdated
@@ -21,6 +21,10 @@ | |||
#' (linear scale), to set the x-axis scale. Default is "lin". | |||
#' @param yAxisScale Character string, either "log" or "lin", sets the y-axis | |||
#' scale similarly to `xAxisScale`. Default is "log". | |||
#' @param observedData Optional. A named set of `DataSet` objects containing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why must the list be named?
R/sensivitity-time-profiles.R
Outdated
@@ -158,13 +163,21 @@ sensitivityTimeProfiles <- function(sensitivityCalculation, | |||
) | |||
) | |||
|
|||
# add observed data to time series data frame |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add validation:
ospsuite.utils::validateIsOfType(observedData, DataSet, nullAllowed = TRUE)
R/sensivitity-time-profiles.R
Outdated
timeSeriesDataFrame <- timeSeriesDataFrame %>% | ||
dplyr::filter(grepl("Concentration", Dimension)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, any kind of dimension should be supported.
R/sensivitity-time-profiles.R
Outdated
@@ -242,6 +271,22 @@ sensitivityTimeProfiles <- function(sensitivityCalculation, | |||
na.rm = TRUE | |||
) | |||
|
|||
# add line for observed data | |||
if (addObeservedData) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Observed data should be added as symbols, not as lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did the analysis results change?
Also the legend for parameter factor is incomplete now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a mistake in the previous test for multiple output paths where results
instead of results_multiple
(now resultsMultiple
) is used for plotting:
test_that("sensitivityTimeProfiles plots are as expected for multiple output paths", { set.seed(123) p_list <- sensitivityTimeProfiles(results)
…t with OutputPath
…h multiple observed data sets
R/sensivitity-time-profiles.R
Outdated
@@ -242,6 +272,22 @@ sensitivityTimeProfiles <- function(sensitivityCalculation, | |||
na.rm = TRUE | |||
) | |||
|
|||
# add line for observed data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"add symbols"?
Adds a new parameter
observedData
to the functionsensitivityTimeProfiles
to include observed data in the plots. Closes #259