# Child step with input - Python

**URL:** <https://forum.opentap.io/t/child-step-with-input-python/1175>\
**Category:** General\
**Created:** [July 18, 2023, 5:54pm UTC](https://forum.opentap.io/t/child-step-with-input-python/1175 "2023-07-18T17:54:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davihous](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@davihous](https://forum.opentap.io/u/davihous)\
**Post date:** [July 18, 2023, 5:54pm UTC](https://forum.opentap.io/t/child-step-with-input-python/1175/1 "2023-07-18T17:54:49Z")

</div>

Hello,

I posted a comment [here](https://forum.opentap.io/t/deadlock-when-childstep-has-input-property/654/2) 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)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/opentap/original/1X/599650ed7ee0b35fba04d6825ef6939bf532d242.png)

Setting with input type OpenTap.Input[Double]

 ![image](https://us1.discourse-cdn.com/flex020/uploads/opentap/original/1X/b2df21a1f5725ffc7ade115d0201dc25fb33b8f1.png)

Setting with input type System.Double

 ![image](https://us1.discourse-cdn.com/flex020/uploads/opentap/original/1X/414bb5683356a7eb0ce6ee8ae567239cbeecdfc1.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/opentap/original/1X/2f394ab9e725534227063819e2e87be3ebbf914c.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/opentap/original/1X/ca9fd43094ea6a70a93fc0cf19f6889a1d7fbb44.png)

Syntax #2:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/opentap/original/1X/a1e5c0bf072b960988578b5585071bf49848429a.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/opentap/original/1X/444a56f9a7a74fc00841a74125fae6e903ccb8bc.png)

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](https://us1.discourse-cdn.com/flex020/uploads/opentap/original/1X/ab020d27cc84c5a599590afa2386724261a4b48a.png)

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

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![rolf\_madsen](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rolf\_madsen](https://forum.opentap.io/u/rolf_madsen)\
**Post date:** [July 20, 2023, 8:49am UTC](https://forum.opentap.io/t/child-step-with-input-python/1175/2 "2023-07-20T08:49:03Z")

</div>

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](http://github.com/opentap/opentap.python) 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.

---

<div class="post-metadata">

**Author:** ![davihous](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@davihous](https://forum.opentap.io/u/davihous)\
**Post date:** [July 20, 2023, 4:11pm UTC](https://forum.opentap.io/t/child-step-with-input-python/1175/3 "2023-07-20T16:11:12Z")

</div>

@rolf_madsen  
I have tested on both 3.0.0 and 3.0.2

> <https://github.com/opentap/OpenTap.Python/issues/123>
>
> https://forum.opentap.io/t/child-step-with-input-python/1175
> 
> \*\*Environment\*\*
> …
> Python package 3.0.0 (also tested on 3.0.2)
> OpenTAP 9.19.4
> 
> \*\*Details\*\*
> 
> See attached files to recreate. I am trying to create a parent step with an output property connect to its own child step with an input property. When either parent step is run, a deadlock error is generated. 
> 
> There are two versions, with input type Double and input type OpenTap.Input\[Double\].
> 
> \[testPy.zip\](https://github.com/opentap/OpenTap.Python/files/12111655/testPy.zip)

---

<div class="post-metadata">

**Author:** ![rolf\_madsen](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rolf\_madsen](https://forum.opentap.io/u/rolf_madsen)\
**Post date:** [July 21, 2023, 8:33am UTC](https://forum.opentap.io/t/child-step-with-input-python/1175/4 "2023-07-21T08:33:57Z")

</div>

@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))`
