Skip to content

Commit 24bad05

Browse files
committed
Update docker and runExample script
1 parent 4ac8f31 commit 24bad05

4 files changed

Lines changed: 15 additions & 25 deletions

File tree

Docker/Dockerfile-ORESWIG

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,4 @@ RUN mv /swig/OREAnalytics-SWIG/Python/build.release/ORE.py oreswig \
4141

4242
ENV PYTHONPATH=/oreswig
4343

44-
WORKDIR /swig/OREAnalytics-SWIG/Python/Examples
45-
RUN ./runExamples.sh
44+
WORKDIR /swig/OREAnalytics-SWIG/Python/Examples

Docker/Dockerfile-ORESWIG-App

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ FROM env_ore:${ore_version} as env_ore
88
FROM debian:${debian_tag}
99

1010
RUN apt-get update \
11-
&& DEBIAN_FRONTEND=noninteractive apt-get install -y dos2unix python3 python3-pip \
11+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y dos2unix python3 python3-pip vim \
1212
&& apt-get clean \
1313
&& rm -rf /var/lib/apt/lists/*
1414

OREAnalytics-SWIG/Python/Examples/ore.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@
3939
for name in analyticTypes:
4040
print("analytc:", name)
4141

42-
print("\npress <enter> ...")
43-
sys.stdin.readline()
44-
4542
#####################################
4643
# List all results, reports and cubes
4744

@@ -55,9 +52,6 @@
5552
for name in cubeNames:
5653
print("cube:", name)
5754

58-
print("\npress <enter> ...")
59-
sys.stdin.readline()
60-
6155
#######################
6256
# Access report details
6357

@@ -78,19 +72,13 @@
7872
for i in range(0, report.columns()):
7973
print("colum", i, "header", report.header(i), "type", report.columnType(i), columnTypes[report.columnType(i)])
8074

81-
print("\npress <enter> ...")
82-
sys.stdin.readline()
83-
8475
time = report.dataAsReal(2);
8576
epe = report.dataAsReal(3);
8677
ene = report.dataAsReal(4);
8778
print ("#Time", "EPE")
8879
for i in range(0, report.rows()):
8980
print("%5.2f %12.2f %12.2f" % (time[i], epe[i], ene[i]))
9081

91-
print("\npress <enter> ...")
92-
sys.stdin.readline()
93-
9482
#####################
9583
# Access cube details
9684

@@ -102,9 +90,6 @@
10290
print ("cube dates:", cube.numDates())
10391
print ("cube depth:", cube.depth())
10492

105-
print("\npress <enter> ...")
106-
sys.stdin.readline()
107-
10893
cubeIds = cube.ids()
10994
cubeDates = cube.dates()
11095

@@ -118,9 +103,6 @@
118103
###########################################################
119104
# Access one analytic e.g. to query the market or portfolio
120105

121-
print("\npress <enter> ...")
122-
sys.stdin.readline()
123-
124106
print("Inspect NPV analytic ...")
125107
analytic = ore.getAnalytic("NPV")
126108
market = analytic.getMarket()

OREAnalytics-SWIG/Python/Examples/runExamples.sh

100644100755
Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
#!/bin/sh
2-
echo RUN commodityforward.py
3-
python3 commodityforward.py
4-
python3 conventions.py
1+
#!/bin/sh
2+
status = 0
3+
for file in *.py; do
4+
if [ -f "$file" ]; then
5+
echo RUN $file
6+
python3 "$file" || status = 1
7+
return_code = $?
8+
if [$return_code -gt $status]; then
9+
status = $return_code
10+
fi
11+
fi
12+
done
13+
exit $status

0 commit comments

Comments
 (0)