Re: [Paraview] Paraview Python best practise?

2017-06-23 Thread David E DeMarle
On Fri, Jun 23, 2017 at 12:44 PM, Shuhao Wu  wrote:

> Hello,
>
> I was wondering if there are any sort of general best practise when
> writing Python based Paraview scripts for visualizations. From the
> materials I've gathered, everything feels very much like mutating a global
> state machine, which might not be the best if you want to turn certain
> actions into a library/general utility executable. What are the best
> practises in this regard?
>
>
Others can provide better advice than I on this point.


> Furthermore, is there a way to specify ProgrammableFilter not as strings
> but in a file that you import and invoke? Judging from the source code it
> doesn't appear this is an ability that comes out of the box as it just
> spins up a python interpreter with that string. I've tried to create a
> function and them execute it, but this only works under pvpython, not with
> the python shell in the Paraview GUI. What are the best practises for this,
> as well?
>
>
I find Programmable Filter script string(s) that simply execfile(...) or
import ... are convenient for this.


> Thanks,
> Shuhao
> ___
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensou
> rce/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


[Paraview] Paraview Python best practise?

2017-06-23 Thread Shuhao Wu

Hello,

I was wondering if there are any sort of general best practise when 
writing Python based Paraview scripts for visualizations. From the 
materials I've gathered, everything feels very much like mutating a 
global state machine, which might not be the best if you want to turn 
certain actions into a library/general utility executable. What are the 
best practises in this regard?


Furthermore, is there a way to specify ProgrammableFilter not as strings 
but in a file that you import and invoke? Judging from the source code 
it doesn't appear this is an ability that comes out of the box as it 
just spins up a python interpreter with that string. I've tried to 
create a function and them execute it, but this only works under 
pvpython, not with the python shell in the Paraview GUI. What are the 
best practises for this, as well?


Thanks,
Shuhao
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview