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

calling python functions from tdi does not support _variables #78

Closed
zack-vii opened this issue Sep 11, 2015 · 2 comments
Closed

calling python functions from tdi does not support _variables #78

zack-vii opened this issue Sep 11, 2015 · 2 comments

Comments

@zack-vii
Copy link
Contributor

This is probably one for Tom.
The variable type "Ident" should not be passes as object of itself but its content.
Or in short: Variables should be evaluated (one layer) before sending to python.

_a=1
pytest(_a)

returns

"\<class \'MDSplus.ident.Ident'\>"

instead of

"<class 'MDSplus.mdsscalar.Int32'>"

Since the variable does not exist inside the python environment getting its value will fail.
The same holds for MDSplus.tdibuiltins.builtins_other.*, such as IF_ERROR. However, these could be buffered using:

_b=IF_ERROR(_a,*);pytest(_b)

pytest.py:

def pytest ( arg ):
    return str(type(arg))
@tfredian
Copy link
Contributor

I can't reproduce this problem either.

==== pytest.py ====
def pytest(arg):
print(type(arg))

return arg.data()

[twf@fc22-vm tdi]$ tditest
_a=42
_a=42
42
pytest(_a)
pytest(_a)
<class 'MDSplus.ident.Ident'>
42

-tom

On 9/11/2015 9:02 AM, zack-vii wrote:

This is probably one for Tom.
The variable type "Ident" should not be passes as object of itself but
its content.
Or in short: Variables should be evaluated (one layer) before sending
to python.

_a=1
pytest(_a)

returns

""

instead of

""

since the variable does not exist inside the python environment
getting its value will fail


Reply to this email directly or view it on GitHub
#78.

@zack-vii
Copy link
Contributor Author

Hmm, after some resetting, it works now on my machine, too.
Thanks for testing and verifying that it should work.

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

No branches or pull requests

2 participants