Trim spaces and avoid spaces in generated address text

* Trim spaces and avoid spaces in generated address text
* Fix unit test
This commit is contained in:
Magne Sjaastad 2023-01-24 11:26:34 +01:00 committed by GitHub
parent 95f3490acd
commit c8dbf3d125
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 6 deletions

View File

@ -232,7 +232,12 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
} }
else else
{ {
allCurveAddressFilters.push_back( arguments[optionIdx] ); // Remove space from address string https://github.com/OPM/ResInsight/issues/9707
QString stringWithoutSpaces = arguments[optionIdx];
stringWithoutSpaces.remove( " " );
allCurveAddressFilters.push_back( stringWithoutSpaces );
} }
} }
} }

View File

@ -923,8 +923,9 @@ std::string RifEclipseSummaryAddress::baseVectorName( const std::string& vectorN
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::string RifEclipseSummaryAddress::blockAsString() const std::string RifEclipseSummaryAddress::blockAsString() const
{ {
return std::to_string( this->cellI() ) + ", " + std::to_string( this->cellJ() ) + ", " + // Avoid space in address text https://github.com/OPM/ResInsight/issues/9707
std::to_string( this->cellK() );
return std::to_string( this->cellI() ) + "," + std::to_string( this->cellJ() ) + "," + std::to_string( this->cellK() );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -39,7 +39,7 @@ def test_summary_data(rips_instance, initialize_test):
addresses = summary_case.available_addresses() addresses = summary_case.available_addresses()
# Summary reader type is controlled from Preferences. libecl reports 343 vectors, opm_common (ESMRY) reports 339. # Summary reader type is controlled from Preferences. libecl reports 343 vectors, opm_common (ESMRY) reports 339.
# As this configuration can be different, allow both variants # As this configuration can be different, allow both variants
assert len(addresses.values) == 343 or len(addresses.values) == 339 assert len(addresses.values) == 335 or len(addresses.values) == 339
summary_data = summary_case.summary_vector_values("FOPT") summary_data = summary_case.summary_vector_values("FOPT")
assert len(summary_data.values) == 60 assert len(summary_data.values) == 60