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

Unable to set Availability of Output attribute #123

Open
tom-mun opened this issue Jul 20, 2023 · 2 comments
Open

Unable to set Availability of Output attribute #123

tom-mun opened this issue Jul 20, 2023 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@tom-mun
Copy link

tom-mun commented Jul 20, 2023

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

@rmadsen-ks
Copy link
Contributor

Ok, after checking it out.

The problem is that output availability needs to be used as a named argument and not as a positional one.

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

A minor change is also that ChildTest needs to use f"{self.inputProp}" and not f"{self.inputProp.Value}" in this case.

So the 'workaround' is to use a named argument.

This needs to be fixed inside PythonNet, since it does not handle named/positional arguments correctly in this case. It should accept either version of the code if possible.

@rmadsen-ks rmadsen-ks added the bug Something isn't working label Jul 21, 2023
@tom-mun
Copy link
Author

tom-mun commented Jul 21, 2023

That works, thanks for the workaround

@rmadsen-ks rmadsen-ks added this to the 3.2 milestone Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants