cpstate Module

This module is used to by the CoProcessingScriptGenerator plugin to aid in capturing ParaView state as CoProcessing python script.

This can capture the ParaView state in a Pipeline object that can then be used in CoProcessing scripts. The entry point into this module is the function DumpPipeline() which returns the Python trace script. Most of the other functions can be considered internal.

class paraview.cpstate.ArrayAccessor(varname, proxy)[source]

Bases: paraview.smtrace.RealProxyAccessor

Augments traces of filters by defining names of arrays to be explored.

trace_ctor(ctor, filter, ctor_args=None, skip_assignment=False)[source]
class paraview.cpstate.ClipAccessor(varname, proxy)[source]

Bases: paraview.smtrace.RealProxyAccessor

augments traces of clip filters with information to explore the parameter space for cinema playback (if enabled)

trace_ctor(ctor, filter, ctor_args=None, skip_assignment=False)[source]
class paraview.cpstate.ContourAccessor(varname, proxy)[source]

Bases: paraview.smtrace.RealProxyAccessor

augments traces of contour filters with information to explore the parameter space for cinema playback (if enabled)

trace_ctor(ctor, filter, ctor_args=None, skip_assignment=False)[source]
paraview.cpstate.DumpPipeline(export_rendering, simulation_input_map, screenshot_info, cinema_tracks, cinema_arrays, enable_live_viz, live_viz_frequency)[source]

Method that will dump the current pipeline and return it as a string trace.

export_rendering

boolean telling if we want to export rendering

simulation_input_map

string->string map with key being the proxyname while value being the simulation input name.

screenshot_info

map with information about screenshots

  • key -> view proxy name

  • value -> [filename, writefreq, fitToScreen, magnification, width, height, cinemacamera options, compressionlevel]

cinema_tracks

map with information about cinema tracks to record

  • key -> proxy name

  • value -> argument ranges

cinema_arrays

map with information about value arrays to be exported

  • key -> proxy name

  • value -> list of array names

enable_live_viz

boolean telling if we want to enable Catalyst Live connection

live_viz_frequency

integer telling how often to update Live connection. only used if enable_live_viz is True

class paraview.cpstate.NewStyleWriters(make_temporal_script=False)[source]

Bases: object

Helper to dump configured writer proxies, which are not in the pipeline, into the script.

make_trace()[source]

gather trace for the writer proxies that are not in the trace pipeline but rather in the new export state.

class paraview.cpstate.ProducerAccessor(varname, proxy, simname)[source]

Bases: paraview.smtrace.RealProxyAccessor

This accessor is created instead of the standard one for proxies that have been marked as simulation inputs. This accessor override the trace_ctor() method to trace the constructor as the CreateProducer() call, since the proxy is a dummy, in this case.

trace_ctor(ctor, filter, ctor_args=None, skip_assignment=False)[source]
class paraview.cpstate.SliceAccessor(varname, proxy)[source]

Bases: paraview.smtrace.RealProxyAccessor

augments traces of slice filters with information to explore the parameter space for cinema playback (if enabled)

trace_ctor(ctor, filter, ctor_args=None, skip_assignment=False)[source]
class paraview.cpstate.ViewAccessor(varname, proxy, proxyname)[source]

Bases: paraview.smtrace.RealProxyAccessor

Accessor for views. Overrides trace_ctor() to trace registering of the view with the coprocessor. (I wonder if this registering should be moved to the end of the state for better readability of the generated state files.

trace_ctor(ctor, filter, ctor_args=None, skip_assignment=False)[source]
class paraview.cpstate.WriterAccessor(varname, proxy)[source]

Bases: paraview.smtrace.RealProxyAccessor

Accessor for writers. Overrides trace_ctor() to use the actual writer proxy name instead of the dummy-writer proxy’s name. Also updates the write_frequencies maintained in cpstate_globals with the write frequencies for the writer.

get_proxy_label(xmlgroup, xmlname)[source]
trace_ctor(ctor, filter, ctor_args=None, skip_assignment=False)[source]
class paraview.cpstate.WriterFilter(trace_all_in_ctor=False)[source]

Bases: paraview.smtrace.PipelineProxyFilter

should_never_trace(prop)[source]

overridden to never trace ‘WriteFrequency’, ‘FileName’ and ‘PaddingAmount’ properties on writers.

paraview.cpstate.cp_hook(varname, proxy)[source]

callback to create our special accessors instead of the standard ones.

class paraview.cpstate.cpstate_filter_proxies_to_serialize[source]

Bases: object

filter used to skip views and representations a when export_rendering is disabled.

paraview.cpstate.get_globals()[source]
paraview.cpstate.initialize_globals()[source]
paraview.cpstate.locate_simulation_inputs(proxy)[source]

Given any sink/filter proxy, returns a list of upstream proxies that have been flagged as ‘simulation input’ in the state exporting wizard.

paraview.cpstate.locate_simulation_inputs_for_view(view_proxy)[source]

Given a view proxy, returns a list of source proxies that have been flagged as the ‘simulation input’ in the state exporting wizard.

paraview.cpstate.reset_globals()[source]
paraview.cpstate.run(filename=None)[source]

Create a dummy pipeline and save the coprocessing state in the filename specified, if any, else dumps it out on stdout.