[Paraview-developers] Proxy Property names & labels

Dan Lipsa dan.lipsa at kitware.com
Tue Nov 1 10:04:20 EDT 2016


What works nicely to avoid confusion in the future is to only use "name".
Paraview will use that in the interface if the "label" is not present.

See a recent change I made
https://gitlab.kitware.com/paraview/paraview/merge_requests/1152/diffs#note_
188653

and how it looks in ParaView
https://blog.kitware.com/enhancements-to-the-community-
atmospheric-model-cam-netcdf-reader/

I just tried accessing this from python and it works fine.

Dan


On Mon, Oct 31, 2016 at 5: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/a7f63c6c/attachment.html>


More information about the Paraview-developers mailing list