Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
CIM
CIMpy
Commits
ff20242f
Commit
ff20242f
authored
Sep 17, 2020
by
Jonathan Klimt
Browse files
Use profile from cgmes package instead of own one
parent
74e39cc0
Pipeline
#335091
passed with stages
in 1 minute and 32 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
cimpy/cgmes.py
deleted
100644 → 0
View file @
74e39cc0
from
enum
import
Enum
#TODO: this is duplicate to cgmes_v2_4_15.Base but this one is nicer
# Mapping between the profiles and their short names
short_profile_name
=
{
"DiagramLayout"
:
'DI'
,
"Dynamics"
:
"DY"
,
"Equipment"
:
"EQ"
,
"GeographicalLocation"
:
"GL"
,
"StateVariables"
:
"SV"
,
"SteadyStateHypothesis"
:
"SSH"
,
"Topology"
:
"TP"
}
long_profile_name
=
{
'DI'
:
"DiagramLayout"
,
"DY"
:
"Dynamics"
,
"EQ"
:
"Equipment"
,
"GL"
:
"GeographicalLocation"
,
"SV"
:
"StateVariables"
,
"SSH"
:
"SteadyStateHypothesis"
,
"TP"
:
"Topology"
,
}
class
Profile
(
Enum
):
""" Enum containing all CGMES profiles and their export priority
"""
EQ
=
0
SSH
=
1
TP
=
2
SV
=
3
DY
=
4
GL
=
5
DI
=
6
def
long_name
(
self
):
return
long_profile_name
[
self
.
name
]
@
classmethod
def
from_long_name
(
cls
,
long_name
):
return
cls
[
short_profile_name
[
long_name
]]
cimpy/cgmes_v2_4_15/Base.py
View file @
ff20242f
from
enum
import
Enum
# Mapping between the profiles and their short names
short_profile_name
=
{
"DiagramLayout"
:
'DI'
,
"Dynamics"
:
"DY"
,
"Equipment"
:
"EQ"
,
"GeographicalLocation"
:
"GL"
,
"StateVariables"
:
"SV"
,
"SteadyStateHypothesis"
:
"SSH"
,
"Topology"
:
"TP"
}
long_profile_name
=
{
'DI'
:
"DiagramLayout"
,
"DY"
:
"Dynamics"
,
"EQ"
:
"Equipment"
,
"GL"
:
"GeographicalLocation"
,
"SV"
:
"StateVariables"
,
"SSH"
:
"SteadyStateHypothesis"
,
"TP"
:
"Topology"
,
}
class
Profile
(
Enum
):
""" Enum containing all CGMES profiles and their export priority.
"""
EQ
=
0
SSH
=
1
TP
=
2
SV
=
3
DY
=
4
GL
=
5
DI
=
6
def
long_name
(
self
):
"""Testdocumentation
"""
return
long_profile_name
[
self
.
name
]
@
classmethod
def
from_long_name
(
cls
,
long_name
):
return
cls
[
short_profile_name
[
long_name
]]
class
Base
():
"""
Base Class for CIM
"""
cgmesProfile
=
Enum
(
"cgmesProfile"
,
{
"EQ"
:
0
,
"SSH"
:
1
,
"TP"
:
2
,
"SV"
:
3
,
"DY"
:
4
,
"GL"
:
5
,
"DI"
:
6
})
cgmesProfile
=
Profile
def
__init__
(
self
,
*
args
,
**
kw_args
):
pass
...
...
cimpy/cimexport.py
View file @
ff20242f
...
...
@@ -3,7 +3,7 @@ import importlib
import
chevron
from
datetime
import
datetime
from
time
import
time
from
cimpy.cgmes
import
Profile
from
cimpy.cgmes
_v2_4_15.Base
import
Profile
import
logging
import
sys
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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