Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
Data Processing
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ACS
P
Public
VILLASframework
Data Processing
Commits
224a02d7
Commit
224a02d7
authored
Aug 06, 2018
by
Bichen Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Add description to the validation tools
parent
36ee4ca5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
dataprocessing/validationtools.py
dataprocessing/validationtools.py
+9
-6
examples/assertresults/assertresults.py
examples/assertresults/assertresults.py
+1
-1
No files found.
dataprocessing/validationtools.py
View file @
224a02d7
...
...
@@ -7,16 +7,18 @@ from readtools import *
"""
The validationtools are used to validate the simulate results from the model.
A typical process
of
validate a model contains four parts
A typical process
to
validate a model contains four parts
- Building & Running the module to get results
- Reading in the results
- Mapping the results with the reference results
- Asserting the module
The first step is done by Py4Mod package, the second by readtool.
The validationtool focuses on the last two steps. the conversion function converts the reference results
timeseries into the modelica timeseries (changing the names and units), the compare function compares two
timeseries, and the assert function gives an assertion of the compare result. At last, a top level validation
function is introduced to organize the whole job.
The validationtool focuses on the last two steps: the conversion function converts the reference-results
timeseries into the modelica timeseries (mapping the names and units), the comparision function compares two
timeseries, and the assert function gives an assertion to the result comparison.
At last, a top level validation function is introduced to organize the whole job.
"""
def
convert_neplan_to_modelica_timeseries
(
neplan_timeseries
):
...
...
@@ -30,7 +32,7 @@ def convert_neplan_to_modelica_timeseries(neplan_timeseries):
line_del
=
[]
# remove all the line current
# Find current of the same component, which means the current
needn't
to be validated
# Find current of the same component, which means the current
don't need
to be validated
for
check
in
range
(
len
(
neplan_timeseries
)):
if
neplan_timeseries
[
check
].
values
[
0
]
==
'#'
:
line_del
.
append
(
check
)
...
...
@@ -154,6 +156,7 @@ def validate_modelica_res(net_name, modelica_res_path, reference_res_path, thres
Top level function for the validation of modelica, calls all the function needed to execute the validation.
:param modelica_res_path: the path of the modelica result file, whose suffix should be .mat
:param reference_res_path: the path of the reference result file, whose suffix should be .rep(simulink)/.rlf(neplan)
:param threshold: the threshold of the assertion, a default value of 0.5 is introduced.
:return: outputs to command line which are the results of the validation.
"""
res_mod
=
read_timeseries_Modelica
(
modelica_res_path
)
...
...
examples/assertresults/assertresults.py
View file @
224a02d7
import
re
import
os
import
sys
print
(
os
.
path
.
normpath
(
os
.
getcwd
()
+
"/data-processing/dataprocessing"
))
sys
.
path
.
append
(
os
.
path
.
normpath
(
os
.
getcwd
()
+
"/data-processing/dataprocessing"
))
...
...
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