opcua-asyncio icon indicating copy to clipboard operation
opcua-asyncio copied to clipboard

Call get_python_classes while there are codes failing

Open jcbastosportela opened this issue 3 years ago • 7 comments

Call get_python_classes while there are codes failing (most likely due to dependency order)

jcbastosportela avatar Mar 28 '21 21:03 jcbastosportela

please stop adding all these merge commit. It is much cleaner to rebase your changes on top of master git pull -r origin masterfor example

oroulet avatar Jul 07 '21 10:07 oroulet

Is there any ambition to get this PR merged? As far as I can see the current master still have the same issue while loading data type definitions. If there are plans to get this fix merged I will pull from master once again.

jcbastosportela avatar Jul 29 '21 07:07 jcbastosportela

Also generally, this send to be a quote ugly hack. Exceptions should only be raised and catched in case of errors. Here you are using exceptions to avoid sorting the XML objects

oroulet avatar Jul 30 '21 20:07 oroulet

Also generally, this send to be a quote ugly hack. Exceptions should only be raised and catched in case of errors. Here you are using exceptions to avoid sorting the XML objects

Well, I agree with you. But I feel that sorting the DataType nodes so all dependencies are resolved may be a much bigger change. It is necessary to consider that a Custom Structured DataType may have members that are other DataTypes defined on that namespace; so this would always require to make some parsing to the XML objects of the DataTypes looking to its members types and determining dependencies and check if all of them are already met, and based on that calculate its position on a list.

Obviously it is a solvable problem, I can try to approach the problem in that way. @oroulet do you suggest to reject this approach (even as an intermediary fix) and wait for a solution where the XML objects are sorted? I personally would like to have the feature working ASAP and tackle "a nicer implementation" afterwards, but I totally understand if you don't want this code on the project.

jcbastosportela avatar Aug 02 '21 10:08 jcbastosportela

We can leave that PR open, but I would rather not merge that. It make understanding code even more complicated. Also I am surprised I never got that issue. I suppose the xml usually come ordered. you must have encountered some special case to have that issue, maybe even a buggy xml

oroulet avatar Aug 02 '21 11:08 oroulet

also this is fixingan older version of protocl, newer versions do not use these xml nodes, they use the DataTypeDefiniont attributes

oroulet avatar Aug 02 '21 11:08 oroulet

We can leave that PR open, but I would rather not merge that. It make understanding code even more complicated. Also I am surprised I never got that issue. I suppose the xml usually come ordered. you must have encountered some special case to have that issue, maybe even a buggy xml

I use UAModeler to create the models I use. I think it really is a matter of alphabetic order. When I look on the generated .xml file from UAModeler the DataTypes are somewhat sorted alphabetically.

also this is fixingan older version of protocl, newer versions do not use these xml nodes, they use the DataTypeDefiniont attributes

Yeah, fair enough. I think the load_data_type_definitions is currently working correctly.

jcbastosportela avatar Aug 02 '21 11:08 jcbastosportela