[Paraview-developers] Proxy Property names & labels

Bastien Jacquet bastien.jacquet at kitware.com
Tue Nov 1 07:48:15 EDT 2016


Hello Utkarsh,

I also spent a few hours the other day, just to discover that my problem
was this mismatch between proxy's name and label, through python access.
Maybe we should throw the developers a warning at compile time when the two
mismatch, to avoid confusion.
The other "solution" I can think of is to allow property access through
both name and label. But this looks like a hack, and might have side-effect
I'm not aware of.

Best,
Bastien
On Mon, Oct 31, 2016 at 10:16 PM, Utkarsh Ayachit <
utkarsh.ayachit at kitware.com> wrote:

> 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
> >
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20161101/10960317/attachment-0001.html>


More information about the Paraview-developers mailing list