[Paraview-developers] Proxy Property names & labels

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Mon Oct 31 17:16:11 EDT 2016


When we started, we indeed used the property's XMLName as the name for
the parameter in the Python script. However, it was noted that the
parameter name in Python would not match what the user saw in the UI
and hence he had no clue how to look for it. Hence, we changed it such
that the Python parameter name uses label instead.

This would not have been an issue if a property's (or proxy's) name
and label are the same, however this didn't happen for historical
reasons.

Now changing property names after the fact is harder since we need to
ensure backwards compability for pvsm and py files.

Utkarsh

On Mon, Oct 31, 2016 at 2:06 PM, Joachim Pouderoux
<joachim.pouderoux at kitware.com> wrote:
> Hi,
>
> Writing a python script for PV5.2, I needed to save a temporal ptvtu file
> and faced this problem again: looking at the proxy's XML definition, the
> writer has the name=WriteAllTimeSteps property.
>
>       <IntVectorProperty command="SetWriteAllTimeSteps"
>                          default_values="0"
>                          label="Write all timesteps as file-series"
>                          name="WriteAllTimeSteps"
>                          number_of_elements="1">
>
> So I tried something like this:
>
>   SaveData("test.pvtu", WriteAllTimeSteps=1)
>
> But it failed claiming that the writer has no WriteAllTimeSteps property!
> Well, looking at the help() on the writer instance it looked like indeed,
> the exposed python property is not call WriteAllTimeSteps but
> Writealltimestepsasfileseries:
>  |  Writealltimestepsasfileseries
>  |      When WriteAllTimeSteps is turned ON, the writer is
>  |      executed once for each timestep available from the
>  |      reader.
>
> Isn't it ugly?
> So is the choice of exposing the property using its concatenated label a
> deliberate choice or a bug?
> It seems to me very unnatural, the label should be reserved for better human
> readable UI printing.
>
> What do you think?
>
> Best,
>
> Joachim Pouderoux, PhD
>
> Technical Expert - Scientific Computing Team
> Kitware SAS
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at:
> http://markmail.org/search/?q=Paraview-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview-developers
>


More information about the Paraview-developers mailing list