Child step with input - Python

Hello,

I posted a comment here about this issue but wanted to make a separate post for better visibility.

I am trying to have a parent step with an output property connect to its own child step with an input property. My understanding based on the post mentioned above is that this should be possible, however I am not aware of how to do it using python.

I am either running into deadlock or other errors depending on the syntax of setting the output property’s OutputAttribute.

Syntax #1: loads, but I run into deadlock. Tried when input property is of type System.Double, and OpenTap.Input[Double] (screenshots from init of parent step shown below)

Setting with input type OpenTap.Input[Double]

Setting with input type System.Double



Syntax #2:


Based on how PythonExamples → BasicFunctionality.py is setting the DisplayAttribute, it would seem syntax #1 is the correct way to set the attribute, but based on the error it would seem it is not getting set. The reason I include syntax #2 is because I have been able to set UnsweepableAttribute in the same way:
image

This is in Python plugin version 3.0.0, TAP version 9.19.4, Python 3.9.10

Any help would be appreciated.

Hi @davihous,

If you want to share code you can do that as text instead of screenshots. This way I can try copy pasting it and test it myself.

I suggest that you open an issue on GitHub - opentap/OpenTap.Python: Python integration for OpenTAP and upload a .py file containing enough code to demonstrate your problem.

Also, you should probably use the plugin version 3.0.2. It contains bug fixes compared to 3.0.0, so it might be that the problem you are seeing has already been solved.

@rolf_madsen
I have tested on both 3.0.0 and 3.0.2

1 Like

@davihous, thanks for uploading the code. It really helped narrowing down the issue.

I replied in the issue, but in short:

There is a bug in the way we handle positional vs named arguments.

As a workaround, instead of this:
outputProp = property(Double, 0.0).add_attribute(OpenTap.Output(OpenTap.OutputAvailability.BeforeRun))

do this:

outputProp = property(Double, 0.0).add_attribute(OpenTap.Output(availability = OpenTap.OutputAvailability.BeforeRun))