Open-Systems-Pharmacology / OSPSuite.Core

Core functionalities of the Open Systems Pharmacology Suite
Other
5 stars 8 forks source link

Cannot run PI if it is not already open #2288

Closed PavelBal closed 3 months ago

PavelBal commented 4 months ago
  1. Open the "Midazolam" project from here https://github.com/Open-Systems-Pharmacology/OSP-PBPK-Model-Library/tree/master/Midazolam
  2. Try to open a parameter identification:

Application: PK-Sim® 12.0.299

Exception has been thrown by the target of an invocation.

Object reference not set to an instance of an object.

Stack trace:

at OSPSuite.Core.Domain.SimulationQuantitySelection.setQuantity()
   at OSPSuite.Core.Domain.SimulationQuantitySelection.get_Quantity()
   at OSPSuite.Core.Domain.OutputMapping.get_Output()
   at OSPSuite.Core.Domain.OutputMapping.get_IsValid()
   at OSPSuite.Core.Domain.Services.ParameterIdentificationValidator.<>c.<Validate>b__2_3(OutputMapping x)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at OSPSuite.Core.Domain.Services.ParameterIdentificationValidator.Validate(ParameterIdentification parameterIdentification)
   at OSPSuite.Core.Domain.Services.EntityValidator.Visit(ParameterIdentification parameterIdentification)
 --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at OSPSuite.Utility.Visitor.VisitorInvoker.invokeVisitMethod[T](IVisitor visitor, T objectToVisit, MethodInfo method)
   at OSPSuite.Utility.Visitor.VisitorInvoker.InvokeVisit[T](IVisitor visitor, T objectToVisit)
   at OSPSuite.Utility.Visitor.VisitorExtensions.Visit[T](IVisitor visitor, T objectToVisit)
   at OSPSuite.Core.Domain.ObjectBase.AcceptVisitor(IVisitor visitor)
   at OSPSuite.Core.Domain.ParameterIdentifications.ParameterIdentification.AcceptVisitor(IVisitor visitor)
   at OSPSuite.Core.Domain.Services.EntityValidator.<validateEntities>b__5_0(IObjectBase entity)
   at OSPSuite.Utility.Extensions.EnumerableExtensions.Each[T](IEnumerable`1 list, Action`1 action)
   at OSPSuite.Core.Domain.Services.EntityValidator.validateEntities(IReadOnlyList`1 entities)
   at OSPSuite.Core.Domain.Services.EntityValidator.Validate(IObjectBase objectBase)
   at OSPSuite.Presentation.Services.EntityValidationTask.Validate(IObjectBase objectToValidate)
   at OSPSuite.Core.Domain.Services.ParameterIdentifications.ParameterIdentificationRunner.<Run>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at OSPSuite.Core.Extensions.ExceptionExtensions.<DoWithinExceptionHandler>d__6.MoveNext()
rwmcintosh commented 4 months ago

At the time of this bug report another bug meant that if you double clicked on a PI, the PI would run instead of open. @PavelBal thought the issue was related to opening the PI, but it's related to running a PI that is not already open (in PK-Sim).

Fixing this issue of running a not-open PI and then updating core will fix both issues