Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
CIM
CIMpy
Commits
e0944692
Commit
e0944692
authored
Dec 17, 2019
by
Martin Alonso Moraga
Browse files
fixed some errors
parent
e88638e3
Pipeline
#220290
passed with stages
in 21 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
cimpy/cimimport.py
View file @
e0944692
...
...
@@ -294,16 +294,6 @@ def _set_attributes(res, xml_files, namespace_rdf, base, logger_errors_grouped):
val
=
uuid2
.
rsplit
(
"."
,
1
)[
1
]
setattr
(
obj
,
attr
,
val
)
if
package
is
not
''
:
obj
.
serializationProfile
[
attr
]
=
short_package_name
[
package
]
else
:
error_msg
=
'Package information not found for class {}, attribute {}'
.
format
(
obj
.
__class__
.
__name__
,
attr
)
try
:
logger_errors_grouped
[
error_msg
]
+=
1
except
KeyError
:
logger_errors_grouped
[
error_msg
]
=
1
else
:
# if elem.get("{%s}ID" % nd_rdf is not None:
# Finished setting object attributes.
break
...
...
cimpy/utils.py
View file @
e0944692
...
...
@@ -129,8 +129,9 @@ def add_external_network_injection(res, version, mRID, voltage_set_point):
reg_name
=
'Regulating Control '
+
str
(
i
)
terminal_name
=
'Terminal Injection '
+
str
(
i
)
module_name
=
"cimpy."
+
version
+
".Equipment."
#module_name = "cimpy." + version + ".Equipment."
module_name
=
"cimpy."
+
version
+
"."
terminal_module
=
importlib
.
import_module
((
module_name
+
'Terminal'
))
terminal_class
=
getattr
(
terminal_module
,
'Terminal'
)
res
[
terminal_name
]
=
terminal_class
(
mRID
=
terminal_name
,
...
...
@@ -141,7 +142,6 @@ def add_external_network_injection(res, version, mRID, voltage_set_point):
regulating_control_class
=
getattr
(
regulating_control_module
,
'RegulatingControl'
)
res
[
reg_name
]
=
regulating_control_class
(
mRID
=
reg_name
,
name
=
reg_name
,
RegulatingCondEq
=
res
[
inj_name
],
targetValue
=
voltage_set_point
,
Terminal
=
res
[
terminal_name
])
...
...
Write
Preview
Supports
Markdown
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