Skip to content
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

References are using string literal list as default value #30

Open
stv0g opened this issue Jun 20, 2024 · 1 comment
Open

References are using string literal list as default value #30

stv0g opened this issue Jun 20, 2024 · 1 comment

Comments

@stv0g
Copy link
Collaborator

stv0g commented Jun 20, 2024

I dont exactly know if this is a bug or just something I have not fully understood:

There are a lot of instances where the CGMES classes are using "list" as a default value for attributes which usually point to other classes?

Why dont we use None here? Is this done to indicate that this is a 1-to-n relation ship and the attribute may contain a list of references?

I find it pretty odd to use a string literal in this case. Why not initialize them with an empty list [] in this case?

@sogno-platform/cim-maintainers

@stv0g
Copy link
Collaborator Author

stv0g commented Jun 20, 2024

As suspected the string literal "list" is used for non 1-to-1 relationships.

Here is the relevant piece of code in CIMgen:

return '"list"'

Hence, this requires a change in CIMgen. Moving the issue over to this repo.

@stv0g stv0g transferred this issue from sogno-platform/cimpy Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant