mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6962 Python: case.replace use simulationName
In Python, the folder name is added to simulation name to a combined name like 'folderName--simulationName' for the imported Grid Model. Only the simulationName should be used.
This commit is contained in:
parent
a0bc915b18
commit
1f2b1f208c
@ -279,14 +279,9 @@ QString RiaProjectModifier::makeFilePathAbsolute( const QString& relOrAbsolutePa
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaProjectModifier::caseNameFromGridFileName( const QString& fullGridFilePathName )
|
||||
{
|
||||
QString fn = QDir::fromNativeSeparators( fullGridFilePathName );
|
||||
QFileInfo fi( fullGridFilePathName );
|
||||
|
||||
// Extract file name plus the 'deepest' directory
|
||||
QString deepestDirPlusFileName = fn.section( '/', -2, -1 );
|
||||
|
||||
deepestDirPlusFileName.replace( "/", "--" );
|
||||
|
||||
return deepestDirPlusFileName;
|
||||
return fi.baseName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -163,14 +163,14 @@ def test_replaceCase(rips_instance, initialize_test):
|
||||
|
||||
case.replace(new_grid_file=case_path)
|
||||
# Check that the case object has been changed
|
||||
assert(case.name == "Real0--BRUGGE_0000.EGRID")
|
||||
assert(case.name == "BRUGGE_0000")
|
||||
assert(case.id == 0)
|
||||
|
||||
cases = rips_instance.project.cases()
|
||||
assert(len(cases) is 1)
|
||||
# Check that retrieving the case object again will yield the changed object
|
||||
case = project.case(case_id=0)
|
||||
assert(case.name == "Real0--BRUGGE_0000.EGRID")
|
||||
assert(case.name == "BRUGGE_0000")
|
||||
assert(case.id == 0)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user