Open-Systems-Pharmacology / PK-Sim

PK-Sim® is a comprehensive software tool for whole-body physiologically based pharmacokinetic modeling
Other
103 stars 50 forks source link

Deletion of MoBi-imported simulation from PI possible #1389

Open AndreDlm opened 4 years ago

AndreDlm commented 4 years ago

Following the subsequently described workflow, PK-Sim throws the error message below. I am not sure how to interpret it and where the error is exactly located. What I did is:


Information: Loading Project from snapshot file 'C:\Projects\GitHub\Erythromycin.json' Error: Object reference not set to an instance of an object.

Stack trace: at OSPSuite.Core.Domain.Services.ParameterIdentifications.IdentificationParameterFactory.<>c.b__8_0(IParameter x) at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Linq.Enumerable.<DistinctIterator>d__641.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at OSPSuite.Core.Domain.Services.ParameterIdentifications.IdentificationParameterFactory.ensureThatDimensionsAreEqual(IEnumerable1 parameters) at OSPSuite.Core.Domain.Services.ParameterIdentifications.IdentificationParameterFactory.CreateFor(IEnumerable1 parameterSelections, ParameterIdentification parameterIdentification) at PKSim.Core.Snapshots.Mappers.IdentificationParameterMapper.<MapToModel>d__6.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.TaskAwaiter1.GetResult() at PKSim.Core.Snapshots.Mappers.SnapshotMapperBaseExtensions.d92.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.TaskAwaiter1.GetResult() at PKSim.Core.Snapshots.Mappers.ParameterIdentificationMapper.d8.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.TaskAwaiter1.GetResult() at PKSim.Core.Snapshots.Mappers.SnapshotMapperBaseExtensions.<MapTo>d__92.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.TaskAwaiter1.GetResult() at PKSim.Core.Snapshots.Mappers.ProjectMapper.<MapToModel>d__11.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.TaskAwaiter1.GetResult() at PKSim.Core.Snapshots.Mappers.SnapshotMapperBase2.<MapToModel>d__1.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.TaskAwaiter1.GetResult() at PKSim.Core.Snapshots.Services.SnapshotTask.d161.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.TaskAwaiter1.GetResult() at PKSim.Core.Snapshots.Services.SnapshotTask.d151.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.TaskAwaiter1.GetResult() at PKSim.Core.Snapshots.Services.SnapshotTask.d17.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`1.GetResult() at PKSim.Presentation.Presenters.Snapshots.LoadProjectFromSnapshotPresenter.d4.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.TaskAwaiter1.GetResult() at PKSim.Presentation.Presenters.Snapshots.LoadFromSnapshotPresenter1.d19.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 PKSim.Presentation.Presenters.Snapshots.LoadFromSnapshotPresenter`1.d14.MoveNext()

Yuri05 commented 4 years ago

I think it has nothing to do with the MoBi simulations (in your project they are not part of the PI anyway). It's something in the PI itself which prevents importing it from the snapshot

msevestre commented 4 years ago

There is no way that the simulation can be recreated from snapshot. An error/warning should be shown when exporting to snapshot that the project won't be valid anymore

Yuri05 commented 4 years ago

As long as MoBi simulations are part of the project, Export to snapshot stops with an error (as expected). grafik After 2 MoBi simulations are removed from the project, it can be exported to snapshot, but reimport crashes during recreation of PI.

msevestre commented 4 years ago

Oh I see. Is it possible to delete a normal simulation from a project when used in a PI? (E.g would we have the same behavior when taking Mobi out if the picture?)

If yes the snapshot reimport needs to be more resilient