[Paraview] dynamic variable names in pvython

Pat Marion pat.marion at kitware.com
Sun May 5 05:35:39 EDT 2013


Hi Tim,

Variable names in trace are generated by this function defined in
smtrace.py:


def pyvariable_from_proxy_name(proxy_name):
  return servermanager._make_name_valid(proxy_name.replace(".", "_"))


That function will generate a suitable variable name from a proxy name.  A
proxy is registered with a name in a proxy group.  smtrace.py also defines
some functions to lookup the proxy name given a proxy and a proxy group.
For example:


>>> from paraview import smtrace
>>> s = Sphere()
>>> smtrace.get_source_proxy_registration_name(s)
'Sphere1'

>>> smtrace.pyvariable_from_proxy_name('Sphere1')
'Sphere1'

>>> help(smtrace.get_source_proxy_registration_name)
Help on function get_source_proxy_registration_name in module
paraview.smtrace:

get_source_proxy_registration_name(proxy)
Assuming the given proxy is registered in the group 'sources',
lookup the proxy's registration name with the servermanager


>>> help(smtrace.get_view_proxy_registration_name)
Help on function get_view_proxy_registration_name in module
paraview.smtrace:

get_view_proxy_registration_name(proxy)
Assuming the given proxy is registered in the group 'views',
lookup the proxy's registration name with the servermanager


Pat


On Sun, May 5, 2013 at 3:01 AM, Timothy Cale <drtsc.para at gmail.com> wrote:

> I use paraview to visualize the results of simulations.
>
> I use Trace in the paraview gui, in order to use the generated scripts to
> help guide
> the development of the pypython script I use to visualize my simulation
> results.
>
> I would like to use dynamic variable names, and note that the scripts
> generated
> by Trace seem to use dynamic variable names.
>
> Aside: The driver for this is that the number of meshes I want to display
> differs
> with each simulation.
>
> I have looked over python posts on dynamic variable names . . .
>
> Question: How are the (seemingly) dynamic variable names created
> in/by/during
> Trace?
>
> Regards,
> Tim
>
> PS: Linux
>
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130505/731b749f/attachment.htm>


More information about the ParaView mailing list