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

Observed data import crash #2067

Open
Yuri05 opened this issue Aug 4, 2023 · 1 comment
Open

Observed data import crash #2067

Yuri05 opened this issue Aug 4, 2023 · 1 comment
Assignees
Labels
Importer-Redesign Redesign of observed data import type: bug

Comments

@Yuri05
Copy link
Member

Yuri05 commented Aug 4, 2023

BugImport.zip

  1. Open attached project bugImport.pksim5 in PK-Sim
  2. Select Observed Data ➡️ Add Observed Data for ➡️ C1
  3. Select attached file NEW3.csv
  4. Keep the proposed column separator (comma)
  5. In the data import: Load configuration from the attached file NEW3.xml
  6. Click on "Add current sheet"

The error message below comes.

Application:
PK-Sim® 11.2.142

Specified argument was out of the range of valid values.
Parameter name: index

Stack trace:

at System.Linq.Enumerable.ElementAt[TSource](IEnumerable`1 source, Int32 index)
   at OSPSuite.Infrastructure.Import.Core.ParsedDataSet.NameFromConvention(IReadOnlyList`1 mappings, String convention, String fileName, String sheetName)
   at OSPSuite.Infrastructure.Import.Services.Importer.<>c__DisplayClass9_1.<NamesFromConvention>b__1(ParsedDataSet s)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at OSPSuite.Infrastructure.Import.Services.Importer.NamesFromConvention(String namingConvention, String fileName, Cache`2 dataSets, IReadOnlyList`1 mappings)
   at OSPSuite.Infrastructure.Import.Core.DataSource.NamesFromConvention()
   at OSPSuite.Presentation.Presenters.Importer.ImporterPresenter.<>c__DisplayClass15_0.<.ctor>b__2(Object s, NamingConventionChangedEventArgs a)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at OSPSuite.Presentation.Presenters.Importer.ImportConfirmationPresenter.TriggerNamingConventionChanged(String namingConvention)
   at OSPSuite.UI.Views.Importer.ImportConfirmationView.<onNamingConventionChanged>b__16_0()
   at OSPSuite.Utility.Extensions.ExceptionExtensions.DoWithinExceptionHandler(Object callerObject, Action actionToExecute)

The problem seems to be that the user somehow managed to create an invalid importer configuration.

EDIT: this is not the reason for the problem, but still strange. I will create another issue for that After the loading of the configuration, it looks like this:

grafik

But when I click on the measurement unit: I see an empty mapped unit column instead of the selected unit [µg/l]
grafik

I did not manage to fix this wrong configuration. Only if I close the importer, reopen it and map all columns/units manually again, I can import.

I saved the manually recreated configuration and compared it to the corrupted one NEW3_fixed.zip

The only difference is: in the corrupted configuration, molecule mapping appears twice:

grafik

@Yuri05 Yuri05 added type: bug Importer-Redesign Redesign of observed data import labels Aug 4, 2023
@Yuri05
Copy link
Member Author

Yuri05 commented Aug 4, 2023

@georgeDaskalakis OK, one possible scenario to reproduce - if we have an excel column named as our compound
NEW3.csv

  1. I import into the project from the issue description, but not for a compound, just
    Observed Data ➡️ Add Observed Data ...
  2. I map any of the columns (not the molecule) to the Excel column C1
    grafik
  3. I map molecule to C1
    grafik

Now I am in the invalid state. If I finish to map the remaining columns (time/measurement/...) and try to import - I get the error from the issue.

Still not what the user did, though (he did not have such a situation).
But at least a way to reproduce :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Importer-Redesign Redesign of observed data import type: bug
Projects
None yet
Development

No branches or pull requests

2 participants