mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Python: Rename example directory to PythonExamples
* This is so that when we add the folder to the Script Path it will look more sensible to the user.
This commit is contained in:
parent
4d8ce1e399
commit
824ec5cef6
@ -169,24 +169,24 @@ if (RESINSIGHT_GRPC_PYTHON_EXECUTABLE)
|
|||||||
"rips/Instance.py"
|
"rips/Instance.py"
|
||||||
"rips/PdmObject.py"
|
"rips/PdmObject.py"
|
||||||
"rips/View.py"
|
"rips/View.py"
|
||||||
"rips/examples/InstanceExample.py"
|
"rips/PythonExamples/InstanceExample.py"
|
||||||
"rips/examples/CommandExample.py"
|
"rips/PythonExamples/CommandExample.py"
|
||||||
"rips/examples/CaseGridGroup.py"
|
"rips/PythonExamples/CaseGridGroup.py"
|
||||||
"rips/examples/CaseInfoStreamingExample.py"
|
"rips/PythonExamples/CaseInfoStreamingExample.py"
|
||||||
"rips/examples/ErrorHandling.py"
|
"rips/PythonExamples/ErrorHandling.py"
|
||||||
"rips/examples/SoilPorvAsync.py"
|
"rips/PythonExamples/SoilPorvAsync.py"
|
||||||
"rips/examples/SoilPorvSync.py"
|
"rips/PythonExamples/SoilPorvSync.py"
|
||||||
"rips/examples/SelectedCases.py"
|
"rips/PythonExamples/SelectedCases.py"
|
||||||
"rips/examples/AllCases.py"
|
"rips/PythonExamples/AllCases.py"
|
||||||
"rips/examples/SetGridProperties.py"
|
"rips/PythonExamples/SetGridProperties.py"
|
||||||
"rips/examples/SetCellResult.py"
|
"rips/PythonExamples/SetCellResult.py"
|
||||||
"rips/examples/SetFlowDiagnosticsResult.py"
|
"rips/PythonExamples/SetFlowDiagnosticsResult.py"
|
||||||
"rips/examples/GridInformation.py"
|
"rips/PythonExamples/GridInformation.py"
|
||||||
"rips/examples/InputPropTestSync.py"
|
"rips/PythonExamples/InputPropTestSync.py"
|
||||||
"rips/examples/InputPropTestAsync.py"
|
"rips/PythonExamples/InputPropTestAsync.py"
|
||||||
"rips/examples/SoilAverageAsync.py"
|
"rips/PythonExamples/SoilAverageAsync.py"
|
||||||
"rips/examples/SoilAverageSync.py"
|
"rips/PythonExamples/SoilAverageSync.py"
|
||||||
"rips/examples/SoilAverageNoComm.py"
|
"rips/PythonExamples/SoilAverageNoComm.py"
|
||||||
"rips/tests/test_cases.py"
|
"rips/tests/test_cases.py"
|
||||||
"rips/tests/test_commands.py"
|
"rips/tests/test_commands.py"
|
||||||
"rips/tests/test_grids.py"
|
"rips/tests/test_grids.py"
|
||||||
|
@ -1,17 +1,18 @@
|
|||||||
import rips
|
import rips
|
||||||
|
import time
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
def createResult(soilChunks, porvChunks):
|
def createResult(soilChunks, porvChunks):
|
||||||
for (soilChunk, porvChunk) in zip(soilChunks, porvChunks):
|
for (soilChunk, porvChunk) in zip(soilChunks, porvChunks):
|
||||||
resultChunk = []
|
resultChunk = []
|
||||||
number = 0
|
number = 0
|
||||||
for (soil, porv) in zip(soilChunk.values, porvChunk.values):
|
npSoilChunk = np.array(soilChunk.values)
|
||||||
resultChunk.append(soil * porv)
|
npPorvChunk = np.array(porvChunk.values)
|
||||||
number += 1
|
yield npSoilChunk + npPorvChunk
|
||||||
yield resultChunk
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
resInsight = rips.Instance.find()
|
resInsight = rips.Instance.find()
|
||||||
|
start = time.time()
|
||||||
case = resInsight.project.case(id=0)
|
case = resInsight.project.case(id=0)
|
||||||
timeStepInfo = case.timeSteps()
|
timeStepInfo = case.timeSteps()
|
||||||
|
|
||||||
@ -25,4 +26,7 @@ for i in range (0, len(timeStepInfo)):
|
|||||||
input_iterator = createResult(soilChunks, iter(porvArray))
|
input_iterator = createResult(soilChunks, iter(porvArray))
|
||||||
case.properties.setActiveCellPropertyAsync(input_iterator, 'GENERATED', 'SOILPORVAsync', i)
|
case.properties.setActiveCellPropertyAsync(input_iterator, 'GENERATED', 'SOILPORVAsync', i)
|
||||||
|
|
||||||
|
end = time.time()
|
||||||
|
print("Time elapsed: ", end - start)
|
||||||
|
|
||||||
print("Transferred all results back")
|
print("Transferred all results back")
|
@ -1,6 +1,8 @@
|
|||||||
import rips
|
import rips
|
||||||
|
import time
|
||||||
|
|
||||||
resInsight = rips.Instance.find()
|
resInsight = rips.Instance.find()
|
||||||
|
start = time.time()
|
||||||
case = resInsight.project.case(id=0)
|
case = resInsight.project.case(id=0)
|
||||||
|
|
||||||
porvResults = case.properties.activeCellProperty('STATIC_NATIVE', 'PORV', 0)
|
porvResults = case.properties.activeCellProperty('STATIC_NATIVE', 'PORV', 0)
|
||||||
@ -13,4 +15,8 @@ for i in range (0, len(timeStepInfo)):
|
|||||||
results.append(soil * porv)
|
results.append(soil * porv)
|
||||||
|
|
||||||
case.properties.setActiveCellProperty(results, 'GENERATED', 'SOILPORVSync', i)
|
case.properties.setActiveCellProperty(results, 'GENERATED', 'SOILPORVSync', i)
|
||||||
|
|
||||||
|
end = time.time()
|
||||||
|
print("Time elapsed: ", end - start)
|
||||||
|
|
||||||
print("Transferred all results back")
|
print("Transferred all results back")
|
Loading…
Reference in New Issue
Block a user