Skip to content

Commit

Permalink
Fix imports and fix issues with string primitive by ignoring this dat…
Browse files Browse the repository at this point in the history
…atype

Signed-off-by: HUG0-D <[email protected]>
  • Loading branch information
HUG0-D committed Oct 28, 2024
1 parent 76ef91f commit 16d5f67
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 0 additions & 2 deletions cimgen/languages/modernpython/lang_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ def _set_cim_data_type(text, render) -> str:
attribute = eval(render(text))
if is_primitive_class(attribute["class_name"]):
return "data_type = " + attribute["class_name"] + ","
elif is_primitive_class(attribute["class_name"]) or attribute["class_name"] == "String":
return "data_type = String,"
elif is_cim_data_type_class(attribute["class_name"]):
return "data_type = " + attribute["class_name"] + ","
return ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Generated from the CGMES 3 files via cimgen: https://github.com/sogno-platform/c

from ..utils.datatypes import CIMDatatype
from ..utils.profile import Profile
from UnitMultiplier import UnitMultiplier
from UnitSymbol import UnitSymbol
from .UnitMultiplier import UnitMultiplier
from .UnitSymbol import UnitSymbol

{{class_name}} = CIMDatatype(name="{{class_name}}", type={{data_type}}, symbol={{unit}}, multiplier={{multiplier}}, profiles=[{{#class_origin}}Profile.{{origin}},{{/class_origin}}])

Expand Down
5 changes: 2 additions & 3 deletions cimgen/languages/modernpython/utils/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

from .dataclassconfig import DataclassConfig
from .profile import BaseProfile
from resources.UnitMultiplier import UnitMultiplier
from resources.UnitSymbol import UnitSymbol

from ..resources.UnitMultiplier import UnitMultiplier
from ..resources.UnitSymbol import UnitSymbol
@dataclass(config=DataclassConfig)
class Primitive:

Expand Down

0 comments on commit 16d5f67

Please sign in to comment.