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

fix in _create_custom_type #722

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AndreasHeine
Copy link
Member

-fix prop name because of dataclass prop names
-add modelingrule (otherwise the props will not be instantiated)

-fix prop name because of dataclass prop names
-add modelingrule (otherwise the props will not be instantiated)
@AndreasHeine
Copy link
Member Author

i guess we should add typing!?

@AndreasHeine
Copy link
Member Author

@oroulet

would like to change the tests aswell (API-Change)!

it makes more sence to let a variant decide the initial value and have the option to predefine a default value by the user!?

"""
properties: [iterable(<name>, <ua.Variant>, <datatype>), ...]
variables: [iterable(<name>, <ua.Variant>, <datatype>), ...]
"""
Copy link
Member

@oroulet oroulet Nov 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not even knew these arguments existed. Why can't we add variable and properties in a new call by adding children to the created type node? That is much more flexible and does not take much longer to type

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont know! stumbled over it and realised that it does not work that well ^^

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe better flag is as depcrecated then

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the delay!
flagging it as depricated will not solve the issue... if you use it you can create a type but it has no modelling rules so our instantiate method will just instantiate the objectnode!
the only thing i added is that i like to pass a list of iterable(name, Variant, Datatype) so the default value for that type can be added via the Variant!
in my opinion a nice feature and i would like to keep it ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but add a small test to make sure it works. Add something in test_common..py

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure! need to make some changes on the existing tests aswell as some for that specific case!

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

Successfully merging this pull request may close these issues.

2 participants