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

Updating simulation but not simulationResult breaks PKAnalysis calculation #1485

Open
pchelle opened this issue Sep 3, 2024 · 0 comments
Open
Labels
question Further information is requested subsystem: R<=>.NET

Comments

@pchelle
Copy link
Contributor

pchelle commented Sep 3, 2024

In a Reporting Engine simulation, the initial endTime was 14400 min. Updating the endTime in the simulation and not the results leads to this odd crash.
I was just wondering if the error message could be more helpful (maybe asking if the simulation and the results do actually match).

library(ospsuite, warn.conflicts = FALSE)
#> Loading required package: rSharp

# Get initial simulation results
sim <- loadSimulation("simulation.pkml")
simResults <- runSimulations(sim)[[1]]
# Update simulation endTime without re-running
sim$outputSchema$intervals[[1]]$endTime$setValue(value = 14400+1, unit = "min")
pkAnalysis <- calculatePKAnalyses(simResults)
#> Error in do.call(".External", c(list("r_call_method", self$pointer, methodName), : Type:    System.ArgumentOutOfRangeException
#> Message: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
#> Method:  Void ThrowArgumentOutOfRange_IndexMustBeLessException()
#> Stack trace:
#>    at System.Collections.Generic.List`1.get_Item(Int32 index)
#>    at OSPSuite.Core.Domain.Services.PKValuesCalculator.setMultipleDosingPKValues(ICache`2 pk, IReadOnlyList`1 allIntervals, PKCalculationOptions options)
#>    at OSPSuite.Core.Domain.Services.PKValuesCalculator.CalculatePK(IReadOnlyList`1 time, IReadOnlyList`1 concentration, PKCalculationOptions options, IReadOnlyList`1 userDefinedPKParameters)
#>    at OSPSuite.Core.Domain.Services.PKAnalysesTask.<>c__DisplayClass8_0.<addPKParametersForOutput>b__1(IndividualResults individualResult)
#>    at OSPSuite.Core.Domain.Services.PKAnalysesTask.scaledIndividualIteration(IModelCoreSimulation simulation, SimulationResults simulationResults, Action`1 performIndividualScalingAction, String moleculeName, PKCalc

Created on 2024-09-03 with reprex v2.1.0

@pchelle pchelle added question Further information is requested subsystem: R<=>.NET labels Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested subsystem: R<=>.NET
Projects
None yet
Development

No branches or pull requests

1 participant