Merge pull request #1398 from joakim-hove/py-refactor

Use 'PYEND' instead of '<<<' to terminate PYACTION and PYINPUT
This commit is contained in:
Bård Skaflestad 2020-01-09 17:01:51 +01:00 committed by GitHub
commit 8cb1d62f29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -1 +1 @@
{"name" : "PYACTION", "sections" : ["SCHEDULE"], "code" : {"end" : "<<<"}}
{"name" : "PYACTION", "sections" : ["SCHEDULE"], "code" : {"end" : "PYEND"}}

View File

@ -1,3 +1,3 @@
{"name" : "PYINPUT",
"sections" : ["RUNSPEC", "GRID", "EDIT", "PROPS", "REGIONS", "SOLUTION", "SUMMARY", "SCHEDULE"],
"code" : {"end" : "<<<"}}
"code" : {"end" : "PYEND"}}

View File

@ -68,17 +68,17 @@ BOOST_AUTO_TEST_CASE(PYINPUT_BASIC) {
PYINPUT
kw = context.DeckKeyword( context.parser['FIELD'] )
context.deck.add(kw)
<<<
PYEND
DIMENS
2 2 1 /
PYINPUT
import numpy as np
dx = np.array([0.25, 0.25, 0.25, 0.25])
active_unit_system = context.deck.active_unit_system()
default_unit_system = context.deck.default_unit_system()
default_unit_system = context.deck.default_unit_system()
kw = context.DeckKeyword( context.parser['DX'], dx, active_unit_system, default_unit_system )
context.deck.add(kw)
<<<
PYEND
DY
4*0.25 /
)";

View File

@ -44,7 +44,7 @@ C = B * 20
SCHEDULE
PYACTION Her comes an ignored comment
)" + input_code + "<<<";
)" + input_code + "PYEND";
const std::string deck_string2 = R"(
SCHEDULE
@ -57,7 +57,7 @@ PYACTION
SCHEDULE
PYACTION -- Comment
)" + input_code + "<<<" + "\nGRID";
)" + input_code + "PYEND" + "\nGRID";
Parser parser;