Commit ff20242f authored by Jonathan Klimt's avatar 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
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]]
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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment