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:
Gaute Lindkvist
2019-08-15 08:07:43 +02:00
parent 4d8ce1e399
commit 824ec5cef6
20 changed files with 33 additions and 23 deletions

View File

@@ -1,17 +1,18 @@
import rips
import time
import numpy as np
def createResult(soilChunks, porvChunks):
for (soilChunk, porvChunk) in zip(soilChunks, porvChunks):
resultChunk = []
number = 0
for (soil, porv) in zip(soilChunk.values, porvChunk.values):
resultChunk.append(soil * porv)
number += 1
yield resultChunk
npSoilChunk = np.array(soilChunk.values)
npPorvChunk = np.array(porvChunk.values)
yield npSoilChunk + npPorvChunk
resInsight = rips.Instance.find()
start = time.time()
case = resInsight.project.case(id=0)
timeStepInfo = case.timeSteps()
@@ -25,4 +26,7 @@ for i in range (0, len(timeStepInfo)):
input_iterator = createResult(soilChunks, iter(porvArray))
case.properties.setActiveCellPropertyAsync(input_iterator, 'GENERATED', 'SOILPORVAsync', i)
end = time.time()
print("Time elapsed: ", end - start)
print("Transferred all results back")

View File

@@ -1,6 +1,8 @@
import rips
import time
resInsight = rips.Instance.find()
start = time.time()
case = resInsight.project.case(id=0)
porvResults = case.properties.activeCellProperty('STATIC_NATIVE', 'PORV', 0)
@@ -13,4 +15,8 @@ for i in range (0, len(timeStepInfo)):
results.append(soil * porv)
case.properties.setActiveCellProperty(results, 'GENERATED', 'SOILPORVSync', i)
end = time.time()
print("Time elapsed: ", end - start)
print("Transferred all results back")