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
22131eef
Commit
22131eef
authored
Feb 21, 2018
by
Bichen Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial commit with neplan read in
parent
26ea09db
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
2 deletions
+54
-2
.gitignore
.gitignore
+1
-0
dataprocessing/readtools.py
dataprocessing/readtools.py
+2
-2
examples/NEPLAN/read_NEPLAN.py
examples/NEPLAN/read_NEPLAN.py
+36
-0
examples/NEPLAN/read_NEPLAN_example.py
examples/NEPLAN/read_NEPLAN_example.py
+15
-0
No files found.
.gitignore
View file @
22131eef
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
# ignore symbolic links
# ignore symbolic links
*.egg-info
*.egg-info
*.eggs
# ignore compiled python files
# ignore compiled python files
*.pyc
*.pyc
...
...
dataprocessing/readtools.py
View file @
22131eef
...
@@ -3,7 +3,6 @@ import pandas as pd
...
@@ -3,7 +3,6 @@ import pandas as pd
from
.timeseries
import
*
from
.timeseries
import
*
import
re
import
re
def
read_timeseries_Modelica
(
filename
,
timeseries_names
=
None
,
is_regex
=
False
):
def
read_timeseries_Modelica
(
filename
,
timeseries_names
=
None
,
is_regex
=
False
):
from
modelicares
import
SimRes
from
modelicares
import
SimRes
sim
=
SimRes
(
filename
)
sim
=
SimRes
(
filename
)
...
@@ -12,6 +11,7 @@ def read_timeseries_Modelica(filename, timeseries_names=None, is_regex=False):
...
@@ -12,6 +11,7 @@ def read_timeseries_Modelica(filename, timeseries_names=None, is_regex=False):
timeseries
=
[]
timeseries
=
[]
for
name
in
sim
.
names
():
for
name
in
sim
.
names
():
timeseries
.
append
(
TimeSeries
(
name
,
sim
(
name
).
times
(),
sim
(
name
).
values
()))
timeseries
.
append
(
TimeSeries
(
name
,
sim
(
name
).
times
(),
sim
(
name
).
values
()))
timeseries_names
=
sim
.
names
()
elif
is_regex
is
True
:
elif
is_regex
is
True
:
# Read in variables which match with regex
# Read in variables which match with regex
timeseries
=
[]
timeseries
=
[]
...
@@ -30,7 +30,7 @@ def read_timeseries_Modelica(filename, timeseries_names=None, is_regex=False):
...
@@ -30,7 +30,7 @@ def read_timeseries_Modelica(filename, timeseries_names=None, is_regex=False):
timeseries
.
append
(
TimeSeries
(
name
,
sim
(
name
).
times
(),
sim
(
name
).
values
()))
timeseries
.
append
(
TimeSeries
(
name
,
sim
(
name
).
times
(),
sim
(
name
).
values
()))
print
(
'Modelica results column names: '
+
str
(
timeseries_names
))
print
(
'Modelica results column names: '
+
str
(
timeseries_names
))
print
(
'Modelica results number: '
+
str
(
len
(
timeseries_
list
)))
print
(
'Modelica results number: '
+
str
(
len
(
timeseries_
names
)))
return
timeseries
return
timeseries
...
...
examples/NEPLAN/read_NEPLAN.py
0 → 100644
View file @
22131eef
import
re
def
readsim
(
file_name
,
timeseries_names
=
None
,
is_regex
=
False
):
str_tmp
=
open
(
file_name
,
"r"
)
low
=
0
high
=
0
flag
=
True
dic
=
{}
seq
=
[]
value
=
[]
i
=
0
isfloat
=
re
.
compile
(
r
'^[-+]?[0-9]+\.[0-9]+$'
)
for
line
in
str_tmp
.
readlines
():
line
=
line
.
replace
(
","
,
"."
)
high
-=
high
low
-=
low
del
value
[:]
for
letter
in
line
:
if
letter
==
" "
or
letter
==
"
\n
"
:
# different data or end
if
low
is
not
high
:
# not NONE
if
flag
:
# seq
seq
.
append
(
line
[
low
:
high
])
else
:
# value
if
isfloat
.
match
(
line
[
low
:
high
]):
value
.
append
(
float
(
line
[
low
:
high
]))
else
:
value
.
append
(
line
[
low
:
high
])
else
:
# NONE
value
.
append
(
r
'#'
)
low
=
high
+
1
high
+=
1
flag
=
False
dic
[
i
]
=
dict
(
zip
(
seq
,
value
))
i
+=
1
str_tmp
.
close
()
return
dic
\ No newline at end of file
examples/NEPLAN/read_NEPLAN_example.py
0 → 100644
View file @
22131eef
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import
read_NEPLAN
import
re
file
=
r
"C:\Users\jdi-bli\Desktop\Test\Slack_Rxline_PQLoad.rlf"
# Example 1: Read in all variable
result
=
read_NEPLAN
.
readsim
(
file
)
for
i
in
range
(
6
):
print
(
result
[
i
])
# result as list of TimeSeries
# Example 2: Read in specific variable
# all_bus_voltages = readsim_Neplan.readsim(file, )
# all_comp_currents = ...
\ 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