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

Skip dimension check on geometric error #1435

Merged
merged 4 commits into from
Jan 12, 2022

Conversation

abdelr
Copy link
Member

@abdelr abdelr commented Jan 10, 2022

Fixes #1425

@abdelr abdelr added the Importer Observed data importer label Jan 10, 2022
@abdelr abdelr self-assigned this Jan 10, 2022
@abdelr abdelr marked this pull request as draft January 10, 2022 14:29
@abdelr abdelr marked this pull request as ready for review January 10, 2022 19:58
@@ -68,7 +76,7 @@ public DataSetToDataRepositoryMappingResult ConvertImportDataSet(ImportedDataSet
private bool convertParsedDataColumnAndReturnWarningFlag(DataRepository dataRepository, KeyValuePair<ExtendedColumn, IList<SimulationPoint>> columnAndData, string fileName)
{
DataColumn dataColumn;
var unit = columnAndData.Value.FirstOrDefault(x => !string.IsNullOrEmpty(x.Unit)).Unit;
var unit = columnAndData.Value.FirstOrDefault(x => !string.IsNullOrEmpty(x.Unit))?.Unit ?? _dimensionFactory.NoDimension.DefaultUnit.Name;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is c constant for it to be used instead
Constant.Dimension.NoDimension

Copy link
Member

@msevestre msevestre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment. Use constant instead of injecting dimensionFactory

Copy link
Member

@msevestre msevestre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed required here

@abdelr abdelr requested a review from msevestre January 11, 2022 15:45
@@ -68,7 +69,7 @@ public DataSetToDataRepositoryMappingResult ConvertImportDataSet(ImportedDataSet
private bool convertParsedDataColumnAndReturnWarningFlag(DataRepository dataRepository, KeyValuePair<ExtendedColumn, IList<SimulationPoint>> columnAndData, string fileName)
{
DataColumn dataColumn;
var unit = columnAndData.Value.FirstOrDefault(x => !string.IsNullOrEmpty(x.Unit)).Unit;
var unit = columnAndData.Value.FirstOrDefault(x => !string.IsNullOrEmpty(x.Unit))?.Unit ?? Constants.Dimension.DIMENSIONLESS;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dimensionless is a dimension not a unit
I meant to use NO_DIMENSION to match the code that you had before
NO_DIMENSION.DefaultUnit or sthg kike this

@abdelr abdelr requested a review from msevestre January 12, 2022 07:29
@msevestre msevestre merged commit eb53d54 into develop Jan 12, 2022
@msevestre msevestre deleted the 1425_error_on_geometric_error branch January 12, 2022 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Importer Observed data importer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Importer crashes with no unit on the error
2 participants