SCIRun User Mailing List

Text archives Help


[SCIRUN-USERS] Help with "InterfaceWithPython"


Chronological Thread 
  • From: Douglas Todd <toddd@email.arizona.edu>
  • To: scirun-users@sci.utah.edu
  • Subject: [SCIRUN-USERS] Help with "InterfaceWithPython"
  • Date: Thu, 26 Mar 2020 14:22:09 -0700
  • Autocrypt: addr=toddd@email.arizona.edu; prefer-encrypt=mutual; keydata= xsFNBFgBOUABEADC4+pXHXyCHEyaea8ou/OLn7ZDR+Q9qT0vCbWCPbVk8Qbx0K7OZEo2XnWu 41qgdxKaSJLL0M5KTFJ8Nq20IjroDZeqmHwziYRBvd6tCZ2mgCOaqRhWoAWkH+w40c39yDXo frK9ucvJRLLbRiUTf4QViDzoCuzXRcXu3G9eLq+wEB3TUpg7prZWgcROkwI7877f9mYNekfc rBmoRL9d72c2RpKrnhaZa0MjZUqfc2I1fJke3iWyNs3PIlwvmL3wAILaO/t7ONzYeU/wirlf xIc9oZB7D/Aj9guWePHZq34KneQ+qm8w68sc0CUqA9mpdA68+PU0XYXXdGKXQ9w7hdmZun3o 89aoergFXGYhop0tN1lqaA3ibPSSzXeGXyGmIxgDrtsKmh+eGBXwWpYXTQnbKNIB4s2oh7CT moYhH6rbaEHtYlXrmDp36M/Glcs6xBUARArFOAPoRxgusSxZTdtGCMww0RdmGQDqjLfXgGnT D3syVQ5LkJA83Ob5E4NfnpfjdjlH6ZJmtGy0kzVMXdcCuxbRlGBeR5EBNP9c0VN+x8YROKEG dW0K6IfijgmNCoTWbdJrqilUeYIWn3Z8vaIH8FoieSUxCr5APqw1HtTfSrpgwZQ1h9S3EN5+ dHgZQM12HRgqPmwiXaTUkjFOcYzINZfBN0nC3u9l6O3CcjCggQARAQABzR9Eb3VnbGFzIFRv ZGQgPGtlN2d5cUBnbWFpbC5jb20+wsF9BBMBCAAnBQJYATlAAhsjBQkJZgGABQsJCAcCBhUI CQoLAgQWAgMBAh4BAheAAAoJEEy0WERVW3YQUssQAI6ciTeDi4YvWP5c9ZGewGtS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ficulty with "InterfaceWithPython". I have used the example given under the "Help" menu under "Python Wizard". Below is the error messages. Attached is a picture of the python errors. It appears that the error is on line 20 of the script, where the "Field" variable is being assigned to fieldOutput. The python shown is from the "Python Wizard" Additionally, Could you point me to the documentation for this interface? It appears that "Field" is a dictionary. What are the entries? Is a description available?

As always, thank you for your help.

Douglas Todd

InterfaceWithPython

This module allows you to take an input (String, Matrix, or Field) and perform Python-based algorithms on the input code. The module UI allows you to name each of the inputs and outputs which can then be referenced in the pasted code block.

Detailed Description

A detailed description of this module is not available at this time. For assistance please contact scirun-users@sci.utah.edu.

The code as it appears in the "InterfaceWithPython" dialog box:

Nodes = Field["node"]

new_nodes = []

for n in Nodes:

nn = [[]]*3

if n[0]>0:

nn[0] = n[0]

else:

nn[0] = n[0]/2

nn[1] = n[1]

nn[2] = n[2]

new_nodes.append(nn)

Field["node"] = new_nodes

fieldOutput1 = Field

Error messages from the screen.

[PYTHON ERROR]   File "/opt/SciRun/SCIRun-5.0-beta.X/bin/SCIRun/lib/python3.5/codeop.py", line 168, in __call__ [PYTHON ERROR]     [PYTHON ERROR] return _maybe_compile(self.compiler, source, filename, symbol) [PYTHON ERROR] [PYTHON ERROR]   File "/opt/SciRun/SCIRun-5.0-beta.X/bin/SCIRun/lib/python3.5/codeop.py", line 99, in _maybe_compile [PYTHON ERROR]     [PYTHON ERROR] raise err1 [PYTHON ERROR] [PYTHON ERROR]   File "/opt/SciRun/SCIRun-5.0-beta.X/bin/SCIRun/lib/python3.5/codeop.py", line 87, in _maybe_compile [PYTHON ERROR]     [PYTHON ERROR] code1 = compiler(source + "\n", filename, symbol) [PYTHON ERROR] [PYTHON ERROR]   File "/opt/SciRun/SCIRun-5.0-beta.X/bin/SCIRun/lib/python3.5/codeop.py", line 133, in __call__ [PYTHON ERROR]     [PYTHON ERROR] codeob = compile(source, filename, symbol, self.flags, 1) [PYTHON ERROR] [PYTHON ERROR]   File "<script>", line 20 [PYTHON ERROR]     [PYTHON ERROR] scirun_set_module_transient_state("InterfaceWithPython:0","scirun_get_module_input_value("InterfaceWithPython:0", "InputField:0")Output1",Field)

...

[PYTHON ERROR]  [PYTHON ERROR]  [PYTHON ERROR]  [PYTHON ERROR] ^ [PYTHON ERROR] SyntaxError [PYTHON ERROR] : [PYTHON ERROR] invalid syntax [PYTHON ERROR] [2020-03-26 14:01:31.423] [module] [error] [ExtractIsosurface:0] Input data required on port InputField QObject::connect: Cannot queue arguments of type 'QTextCursor' (Make sure 'QTextCursor' is registered using qRegisterMetaType().) [2020-03-26 14:01:31.424] [module] [error] [ShowField:0] Input data required on port Field

Attachment: Foo.png
Description: PNG image



  • [SCIRUN-USERS] Help with "InterfaceWithPython", Douglas Todd, 03/26/2020

Archive powered by MHonArc 2.6.18.

Top of page