[Pywps-dev] Subclassing processes

Luí­s Moreira de Sousa luis.de.sousa at protonmail.ch
Sat Apr 14 11:17:54 PDT 2018


Hi David,

I have done this in the past, pretty much as you say, by promoting the inputs and outputs objects to class properties. Other elements like title, abstract, etc, can be treated in the same way. This would all go into an "abstract" class from which actual process inherited. Perhaps there might be more elegant solutions, but to me this setting served well (I am a man of simple tastes).

All that said, it could make sense defining inputs, outputs, etc as class properties in the Process class itself. Something to think about.

Happy coding. Cheers.

--
Luís Moreira de Sousa
Bowlespark 8
6701 DN Wageningen
The Netherlands
Phone: +31 628 544 755
Email: luis.de.sousa at protonmail.ch
RingID: ring:7ca91d83f4f9dec82fec9f1144b8e5c1ef2a110c
URL: https://ldesousa.github.io

Sent with [ProtonMail](https://protonmail.com) Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On April 11, 2018 11:51 PM, David Huard <huard.david at ouranos.ca> wrote:

> Hi all,
>
> I often find myself in situations where it would be useful to subclass a Process and avoid copy-pasting shared inputs and outputs. The way most processes are written does not lend itself well to this, inputs being instance objects rather than class objects. I was wondering if any of you had experience with an elegant way to subclass pywps processes that is readable and does not pollute the class namespace too much.
>
> Thanks,
>
> david
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pywps-dev/attachments/20180414/3bad767b/attachment.html>


More information about the pywps-dev mailing list