Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
padmwsverify
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
stw
wt
padmwsverify
Commits
e96b0657
Commit
e96b0657
authored
Apr 26, 2017
by
Tomas Pettersson
🏸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added more testcases
parent
b584e777
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
280 additions
and
10 deletions
+280
-10
input/bf_nemo_OO_P_B_H3_D0_P12.json
input/bf_nemo_OO_P_B_H3_D0_P12.json
+34
-0
input/bf_nemo_OO_P_F_H3_D+1_P12.json
input/bf_nemo_OO_P_F_H3_D+1_P12.json
+3
-1
input/helcom_nemo_OF_MP_W1_F_H0_D-2_P12.json
input/helcom_nemo_OF_MP_W1_F_H0_D-2_P12.json
+34
-0
input/helcom_nemo_OF_MP_W1_F_H0_D0_P3.json
input/helcom_nemo_OF_MP_W1_F_H0_D0_P3.json
+2
-0
input/helcom_nemo_OF_MP_W20_F_H0_D0_P12.json
input/helcom_nemo_OF_MP_W20_F_H0_D0_P12.json
+34
-0
input/helcom_nemo_OF_MP_W2_B_H0_D+2_P12.json
input/helcom_nemo_OF_MP_W2_B_H0_D+2_P12.json
+34
-0
input/helcom_nemo_OO_A_B_H3_D0_P12.json
input/helcom_nemo_OO_A_B_H3_D0_P12.json
+45
-0
input/helcom_nemo_OO_A_F_H0_D+1_P3.json
input/helcom_nemo_OO_A_F_H0_D+1_P3.json
+2
-0
input/helcom_nemo_OO_P_B_H0_D+1_P12.json
input/helcom_nemo_OO_P_B_H0_D+1_P12.json
+33
-0
input/vn_nemo_OO_P_B_H0_D0_P12.json
input/vn_nemo_OO_P_B_H0_D0_P12.json
+33
-0
input/vn_nemo_OO_P_F_H0_D0_P3.json
input/vn_nemo_OO_P_F_H0_D0_P3.json
+2
-0
runner/model.py
runner/model.py
+18
-8
runner/model.pyc
runner/model.pyc
+0
-0
validate.py
validate.py
+6
-1
No files found.
input/bf_nemo_OO_P_B_H3_D0_P12.json
0 → 100644
View file @
e96b0657
{
"setting"
:
{
"forecastMethod"
:
"NEMO"
,
"outletType"
:
"POINT"
,
"forwardCalculation"
:
"false"
,
"start"
:
"STARTDATE"
,
"end"
:
"ENDDATE"
,
"calculationType"
:
"Oil classes"
,
"substance"
:
"Medium oils (100-1000 cSt)"
,
"fresh"
:
"false"
,
"winddrag"
:
"0.00"
,
"outletPoints"
:
"1"
,
"depth"
:
"0"
,
"instantaneous"
:
"true"
,
"amount"
:
"100"
,
"amountUnit"
:
"m3"
,
"duration"
:
"24"
,
"durationUnit"
:
"hours"
,
"uncertainty"
:
"false"
,
"calculationMode"
:
"Normal"
},
"coordinate"
:
[
{
"latitude"
:
58.335270633241244
,
"longitude"
:
11.390247344970703
}
],
"starthour"
:
3
,
"startdaysadjustment"
:
0
,
"timeperiod"
:
12
,
"maxperiod"
:
47
,
"domain"
:
"BF_NEMO"
}
\ No newline at end of file
input/bf_nemo_
1
.json
→
input/bf_nemo_
OO_P_F_H3_D+1_P12
.json
View file @
e96b0657
...
...
@@ -25,7 +25,9 @@
"longitude"
:
11.390247344970703
}
],
"timeperiod"
:
3
,
"starthour"
:
3
,
"startdaysadjustment"
:
1
,
"timeperiod"
:
12
,
"maxperiod"
:
47
,
"domain"
:
"BF_NEMO"
...
...
input/helcom_nemo_OF_MP_W1_F_H0_D-2_P12.json
0 → 100644
View file @
e96b0657
{
"setting"
:
{
"start"
:
"STARTDATE"
,
"end"
:
"ENDDATE"
,
"calculationMode"
:
"Normal"
,
"outletType"
:
"MULTIPOINT"
,
"forecastMethod"
:
"NEMO"
,
"forwardCalculation"
:
"true"
,
"amount"
:
"100.0"
,
"amountUnit"
:
"m3"
,
"calculationType"
:
"Floating object
\/
Algae"
,
"substance"
:
"Floating object, file"
,
"fresh"
:
"false"
,
"instantaneous"
:
"true"
,
"outletPoints"
:
"1"
,
"uncertainty"
:
"false"
,
"winddrag"
:
"1"
,
"depth"
:
"0"
,
"duration"
:
""
,
"durationUnit"
:
""
},
"coordinate"
:
[
{
"latitude"
:
56.41390137600676
,
"longitude"
:
18.0615234375
}
],
"starthour"
:
0
,
"startdaysadjustment"
:
-2
,
"timeperiod"
:
12
,
"maxperiod"
:
200
,
"domain"
:
"HELCOM_NEMO"
}
\ No newline at end of file
input/helcom_nemo_
2
.json
→
input/helcom_nemo_
OF_MP_W1_F_H0_D0_P3
.json
View file @
e96b0657
...
...
@@ -25,6 +25,8 @@
"longitude"
:
18.0615234375
}
],
"starthour"
:
0
,
"startdaysadjustment"
:
0
,
"timeperiod"
:
3
,
"maxperiod"
:
200
,
"domain"
:
"HELCOM_NEMO"
...
...
input/helcom_nemo_OF_MP_W20_F_H0_D0_P12.json
0 → 100644
View file @
e96b0657
{
"setting"
:
{
"start"
:
"STARTDATE"
,
"end"
:
"ENDDATE"
,
"calculationMode"
:
"Normal"
,
"outletType"
:
"MULTIPOINT"
,
"forecastMethod"
:
"NEMO"
,
"forwardCalculation"
:
"true"
,
"amount"
:
"100.0"
,
"amountUnit"
:
"m3"
,
"calculationType"
:
"Floating object
\/
Algae"
,
"substance"
:
"Floating object, file"
,
"fresh"
:
"false"
,
"instantaneous"
:
"true"
,
"outletPoints"
:
"1"
,
"uncertainty"
:
"false"
,
"winddrag"
:
"20"
,
"depth"
:
"0"
,
"duration"
:
""
,
"durationUnit"
:
""
},
"coordinate"
:
[
{
"latitude"
:
55.09802
,
"longitude"
:
14.63379
}
],
"starthour"
:
0
,
"startdaysadjustment"
:
0
,
"timeperiod"
:
12
,
"maxperiod"
:
200
,
"domain"
:
"HELCOM_NEMO"
}
\ No newline at end of file
input/helcom_nemo_OF_MP_W2_B_H0_D+2_P12.json
0 → 100644
View file @
e96b0657
{
"setting"
:
{
"start"
:
"STARTDATE"
,
"end"
:
"ENDDATE"
,
"calculationMode"
:
"Normal"
,
"outletType"
:
"MULTIPOINT"
,
"forecastMethod"
:
"NEMO"
,
"forwardCalculation"
:
"false"
,
"amount"
:
"100.0"
,
"amountUnit"
:
"m3"
,
"calculationType"
:
"Floating object
\/
Algae"
,
"substance"
:
"Floating object, file"
,
"fresh"
:
"false"
,
"instantaneous"
:
"true"
,
"outletPoints"
:
"1"
,
"uncertainty"
:
"false"
,
"winddrag"
:
"2"
,
"depth"
:
"0"
,
"duration"
:
""
,
"durationUnit"
:
""
},
"coordinate"
:
[
{
"latitude"
:
56.41390137600676
,
"longitude"
:
18.0615234375
}
],
"starthour"
:
0
,
"startdaysadjustment"
:
2
,
"timeperiod"
:
12
,
"maxperiod"
:
200
,
"domain"
:
"HELCOM_NEMO"
}
\ No newline at end of file
input/helcom_nemo_OO_A_B_H3_D0_P12.json
0 → 100644
View file @
e96b0657
{
"setting"
:
{
"forecastMethod"
:
"NEMO"
,
"outletType"
:
"AREA"
,
"forwardCalculation"
:
"false"
,
"start"
:
"STARTDATE"
,
"end"
:
"ENDDATE"
,
"calculationType"
:
"Oil classes"
,
"substance"
:
"Medium oils (100-1000 cSt)"
,
"fresh"
:
"false"
,
"winddrag"
:
"0.00"
,
"outletPoints"
:
"3"
,
"depth"
:
"0"
,
"instantaneous"
:
"true"
,
"amount"
:
"100"
,
"amountUnit"
:
"m3"
,
"duration"
:
"24"
,
"durationUnit"
:
"hours"
,
"uncertainty"
:
"false"
,
"calculationMode"
:
"Normal"
},
"coordinate"
:
[
{
"latitude"
:
60.356127978060933
,
"longitude"
:
26.961650443838113
},
{
"latitude"
:
60.348048724559071
,
"longitude"
:
26.934164170849897
},
{
"latitude"
:
60.357731733846322
,
"longitude"
:
26.935840154054311
},
{
"latitude"
:
60.362457652517769
,
"longitude"
:
26.958385167216541
}
],
"starthour"
:
3
,
"startdaysadjustment"
:
0
,
"timeperiod"
:
12
,
"maxperiod"
:
200
,
"domain"
:
"HELCOM_NEMO"
}
\ No newline at end of file
input/helcom_nemo_
1
.json
→
input/helcom_nemo_
OO_A_F_H0_D+1_P3
.json
View file @
e96b0657
...
...
@@ -37,6 +37,8 @@
"longitude"
:
26.958385167216541
}
],
"starthour"
:
0
,
"startdaysadjustment"
:
1
,
"timeperiod"
:
3
,
"maxperiod"
:
200
,
"domain"
:
"HELCOM_NEMO"
...
...
input/helcom_nemo_OO_P_B_H0_D+1_P12.json
0 → 100644
View file @
e96b0657
{
"setting"
:
{
"forecastMethod"
:
"NEMO"
,
"outletType"
:
"POINT"
,
"forwardCalculation"
:
"false"
,
"start"
:
"STARTDATE"
,
"end"
:
"ENDDATE"
,
"calculationType"
:
"Oil classes"
,
"substance"
:
"Medium oils (100-1000 cSt)"
,
"fresh"
:
"false"
,
"winddrag"
:
"0.00"
,
"outletPoints"
:
"1"
,
"depth"
:
"0"
,
"instantaneous"
:
"true"
,
"amount"
:
"100"
,
"amountUnit"
:
"m3"
,
"duration"
:
"24"
,
"durationUnit"
:
"hours"
,
"uncertainty"
:
"false"
,
"calculationMode"
:
"Normal"
},
"coordinate"
:
[
{
"latitude"
:
55.09802
,
"longitude"
:
14.63379
}
],
"starthour"
:
0
,
"startdaysadjustment"
:
1
,
"timeperiod"
:
12
,
"maxperiod"
:
200
,
"domain"
:
"HELCOM_NEMO"
}
\ No newline at end of file
input/vn_nemo_OO_P_B_H0_D0_P12.json
0 → 100644
View file @
e96b0657
{
"setting"
:
{
"forecastMethod"
:
"NEMO"
,
"outletType"
:
"POINT"
,
"forwardCalculation"
:
"false"
,
"start"
:
"STARTDATE"
,
"end"
:
"ENDDATE"
,
"calculationType"
:
"Oil classes"
,
"substance"
:
"Medium oils (100-1000 cSt)"
,
"fresh"
:
"false"
,
"winddrag"
:
"0.00"
,
"outletPoints"
:
"1"
,
"depth"
:
"0"
,
"instantaneous"
:
"true"
,
"amount"
:
"100"
,
"amountUnit"
:
"m3"
,
"duration"
:
"24"
,
"durationUnit"
:
"hours"
,
"uncertainty"
:
"false"
,
"calculationMode"
:
"Normal"
},
"coordinate"
:
[
{
"latitude"
:
59.08009382655441
,
"longitude"
:
13.6724853515625
}
],
"starthour"
:
8
,
"startdaysadjustment"
:
0
,
"timeperiod"
:
12
,
"maxperiod"
:
59
,
"domain"
:
"VN_NEMO"
}
\ No newline at end of file
input/vn_nemo_
1
.json
→
input/vn_nemo_
OO_P_F_H0_D0_P3
.json
View file @
e96b0657
...
...
@@ -25,6 +25,8 @@
"longitude"
:
13.6724853515625
}
],
"starthour"
:
0
,
"startdaysadjustment"
:
0
,
"timeperiod"
:
3
,
"maxperiod"
:
59
,
"domain"
:
"VN_NEMO"
...
...
runner/model.py
View file @
e96b0657
...
...
@@ -34,16 +34,26 @@ class Runner(object):
rDomain
=
requests
.
post
(
'/'
.
join
([
self
.
url
,
"workarea"
,
"v2"
,
wid
,
"op"
,
"domain"
]),
data
=
None
,
json
=
{
"domain"
:
domain
},
auth
=
HTTPBasicAuth
(
self
.
usr
,
self
.
pwd
))
# setting
setting
=
jdata
[
'setting'
]
setting
[
'start'
]
=
datetime
.
utcnow
().
strftime
(
"%Y-%m-%d %H:%M"
)
+
':00'
end
=
datetime
.
utcnow
()
end
+=
timedelta
(
hours
=
jdata
[
'timeperiod'
])
if
(
output
==
'run'
):
start
=
datetime
.
utcnow
().
replace
(
minute
=
0
,
second
=
0
)
else
:
start
=
datetime
.
utcnow
().
replace
(
hour
=
0
,
minute
=
0
,
second
=
0
)
start
+=
timedelta
(
hours
=
jdata
[
'starthour'
])
+
timedelta
(
days
=
jdata
[
'startdaysadjustment'
])
end
=
start
if
(
timeperiod
):
if
(
timeperiod
>
jdata
[
'maxperiod'
]):
timeperiod
=
jdata
[
'maxperiod'
]
end
=
datetime
.
utcnow
()
end
+=
timedelta
(
hours
=
timeperiod
)
setting
[
'end'
]
=
end
.
strftime
(
"%Y-%m-%d %H:%M"
)
+
':00'
rSetting
=
requests
.
post
(
'/'
.
join
([
self
.
url
,
"workarea"
,
"v2"
,
wid
,
"op"
,
"setting"
]),
data
=
None
,
json
=
jdata
[
'setting'
],
auth
=
HTTPBasicAuth
(
self
.
usr
,
self
.
pwd
))
else
:
end
+=
timedelta
(
hours
=
jdata
[
'timeperiod'
])
if
(
setting
[
'forwardCalculation'
]
==
'true'
):
setting
[
'start'
]
=
start
.
strftime
(
"%Y-%m-%d %H:%M"
)
+
':00'
setting
[
'end'
]
=
end
.
strftime
(
"%Y-%m-%d %H:%M"
)
+
':00'
else
:
setting
[
'start'
]
=
end
.
strftime
(
"%Y-%m-%d %H:%M"
)
+
':00'
setting
[
'end'
]
=
start
.
strftime
(
"%Y-%m-%d %H:%M"
)
+
':00'
rSetting
=
requests
.
post
(
'/'
.
join
([
self
.
url
,
"workarea"
,
"v2"
,
wid
,
"op"
,
"setting"
]),
data
=
None
,
json
=
setting
,
auth
=
HTTPBasicAuth
(
self
.
usr
,
self
.
pwd
))
#print(rSetting.content)
# coordinates
rCoords
=
requests
.
post
(
'/'
.
join
([
self
.
url
,
"workarea"
,
"v2"
,
wid
,
"op"
,
"coordinates"
]),
data
=
None
,
json
=
{
"coordinate"
:
jdata
[
'coordinate'
]},
auth
=
HTTPBasicAuth
(
self
.
usr
,
self
.
pwd
))
# run
...
...
@@ -52,7 +62,7 @@ class Runner(object):
status
=
""
;
start
=
time
()
end
=
time
()
while
((
status
!=
'COMPLETE'
)
and
(
end
-
start
<
timeout
)):
while
((
status
!=
'COMPLETE'
)
and
(
status
!=
'ERROR'
)
and
(
end
-
start
<
timeout
)):
sleep
(
3
)
try
:
status
=
json
.
loads
(
requests
.
get
(
'/'
.
join
([
self
.
url
,
"runner"
,
"v2"
,
wid
,
"progress"
])).
content
)[
'status'
]
...
...
@@ -85,7 +95,7 @@ class Model(Runner):
self
.
name
,
suffix
=
inputfile
.
split
(
'.'
)
with
open
(
'input/'
+
inputfile
)
as
file
:
self
.
jdata
=
json
.
load
(
file
)
def
__call__
(
self
,
timeperiod
=
None
,
output
=
'run'
,
timeout
=
3
0
):
def
__call__
(
self
,
timeperiod
=
None
,
output
=
'run'
,
timeout
=
6
0
):
super
(
Model
,
self
).
__call__
(
self
.
jdata
,
self
.
name
,
timeperiod
,
output
,
timeout
)
def
clean
(
self
):
super
(
Model
,
self
).
clean
();
...
...
runner/model.pyc
View file @
e96b0657
No preview for this file type
validate.py
View file @
e96b0657
...
...
@@ -11,12 +11,15 @@ def main(method):
mlist
=
Models
()()
if
method
==
'all'
:
for
m
in
mlist
:
m
(
24
,
'validate'
,
300
);
m
(
None
,
'validate'
,
300
);
sleep
(
3
)
elif
method
==
'long'
:
for
m
in
mlist
:
m
(
200
,
'validate'
,
300
);
sleep
(
3
)
elif
method
==
'one'
:
mlist
[
selected
](
None
,
'validate'
,
300
);
sleep
(
3
)
else
:
raise
ValueError
(
'Validation method is not defined. Try using python validate.py all'
)
sys
.
exit
(
0
)
...
...
@@ -30,5 +33,7 @@ if __name__ == "__main__":
method
=
''
if
(
len
(
sys
.
argv
)
>
1
):
method
=
sys
.
argv
[
1
]
if
(
len
(
sys
.
argv
)
>
2
):
selected
=
int
(
sys
.
argv
[
2
])
main
(
method
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment