-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Primitives, enum and CIM_datatype #39
Primitives, enum and CIM_datatype #39
Conversation
26640c4
to
a0d0068
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine apart from the failing formatting check. Thanks!
@HUG0-D not necessarily linked to this PR, but it seems we have lot of annotations that may be redundant in attributes:
|
@m-mirz thank you for pointing that out! This was my first time using rebase, and I realize now that I might not have followed the correct process, which led to those extra “rebase branch” commits. I tried to handle some merge conflicts manually, and doing so, I think I mistakenly created those additional commits. |
21f2a5d
to
8759e25
Compare
@m-mirz During the rebase process, I encountered several issues that resulted in a messy commit history. To ensure the PR is clean and easy to review, I created a new branch from main and reapplied my changes with a clean commit structure. The functionality and content of the PR remain the same as before, but now the history is more streamlined. Please let me know if you have any questions or concerns. Thanks for your understanding! |
cimgen/languages/modernpython/templates/enum_class_template.mustache
Outdated
Show resolved
Hide resolved
Most of these annotations comes from my PR #36 to provide information about the disjoint attribute types. Now, including "datatype" there are 5 disjoint attribute types:
Maybe a single "attribute_type" (class, enum, ...) would be less noisy. But these booleans could easily used in chevron templates. |
Signed-off-by: HUG0-D <[email protected]>
…fined as dict Signed-off-by: HUG0-D <[email protected]>
Signed-off-by: HUG0-D <[email protected]>
Signed-off-by: HUG0-D <[email protected]>
Signed-off-by: HUG0-D <[email protected]>
Signed-off-by: HUG0-D <[email protected]>
Signed-off-by: HUG0-D <[email protected]>
Signed-off-by: HUG0-D <[email protected]>
Signed-off-by: HUG0-D <[email protected]>
… line-length ignore comment Signed-off-by: HUG0-D <[email protected]>
Signed-off-by: HUG0-D <[email protected]>
…e_class", "is_a_cim_datatype" --> "is_a_datatype_class", "is_cim_datatype" --> "is_datatype_attribute" Signed-off-by: HUG0-D <[email protected]>
…atatype and attribute class Signed-off-by: HUG0-D <[email protected]>
73ff2ac
to
2c3d74c
Compare
…ttribute class Signed-off-by: HUG0-D <[email protected]>
cimgen/languages/modernpython/templates/enum_class_template.mustache
Outdated
Show resolved
Hide resolved
cimgen/languages/modernpython/templates/cimpy_class_template.mustache
Outdated
Show resolved
Hide resolved
I know it's not caused by your changes, but I think this import in base.py is wrong: This should be: In the same way "pycgmes" should be removed from chevron_writer.py. And the comment in cimpy_cgmesProfile_template.mustache should be changed to: |
Signed-off-by: HUG0-D <[email protected]>
Signed-off-by: HUG0-D <[email protected]>
Signed-off-by: HUG0-D <[email protected]>
…y with chevron Signed-off-by: HUG0-D <[email protected]>
Signed-off-by: HUG0-D <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some python comments.
Remove need for os library Signed-off-by: HUG0-D <[email protected]>
Quality Gate passedIssues Measures |
Enum classes
Correctly defining classes with defined values, using Enum. (Issue: #38 )
Examples:
UnitSymbol
orUnitMultiplier
Primitives classes
The current model generates classes for primitives, which are then rarely used to define the other classes.
Instead of creating individual classes for each primitives, a generic
Primitive
class is created.Examples:
Float = Primitive(name="Float", type=float, profiles=[Profile.EQBD, Profile.OP, Profile.SSH, Profile.EQ, Profile.DY, Profile.DL, Profile.SV, Profile.SC, ])
Common CIMDatatype class
The current model generates datatypes that are then never used in the cim classes (example:
CurrentFlow
).Instead of creating multiple unused classes with the same attributes (multiplier, unit, value), this pr creates a generic
CIMDatatype
class. (Issue: #38 )Examples:
CurrentFlow = CIMDatatype(name="CurrentFlow", type=float, symbol=UnitSymbol.A, multiplier=UnitMultiplier.none, profiles=[Profile.SSH,Profile.EQ,Profile.SV,Profile.SC,])
Annotation of the data type
As said above, the newly created datatypes are added as annotation (
data_type
) when creating the other classes.