Should we split the Input class?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Should we split the Input class?

Luí­s Moreira de Sousa
We have a bit of a mess with the Input class concept. It is firstly instantiated in the Process implementation (by the user). Then it is deep copied to support the actual inputs at run time.

It seems we are bundling two concepts together:
. InputDeclaration - that describes the input name, type, abstract, etc.
. PhysicalInput - that holds the actual data (or path to data) after an Execute request is parsed

By associating the InputDeclaration class to the Process class and PhysicalInput to the Request class we can avoid the deep copy. And make the code more clear.

Please discuss. Cheers.

P.S.: this is also true for outputs, but there it is not as critical.

--
Luís Moreira de Sousa
Im Grund 6
CH-8600 Dübendorf
Switzerland

Phone: +41 (0)79 812 62 65



_______________________________________________
pywps-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pywps-dev
Reply | Threaded
Open this post in threaded view
|

Re: Should we split the Input class?

Jorge Mendes de Jesus
Hi to all

I never took a deep look at the code but what you say makes total sense to me.



On 22 Jul 2017 17:26, "Luí­s Moreira de Sousa" <[hidden email]> wrote:
We have a bit of a mess with the Input class concept. It is firstly instantiated in the Process implementation (by the user). Then it is deep copied to support the actual inputs at run time.

It seems we are bundling two concepts together:
. InputDeclaration - that describes the input name, type, abstract, etc.
. PhysicalInput - that holds the actual data (or path to data) after an Execute request is parsed

By associating the InputDeclaration class to the Process class and PhysicalInput to the Request class we can avoid the deep copy. And make the code more clear.

Please discuss. Cheers.

P.S.: this is also true for outputs, but there it is not as critical.

--
Luís Moreira de Sousa
Im Grund 6
CH-8600 Dübendorf
Switzerland

Phone: <a href="tel:+41%2079%20812%2062%2065" value="+41798126265" target="_blank">+41 (0)79 812 62 65



_______________________________________________
pywps-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pywps-dev


_______________________________________________
pywps-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pywps-dev
Reply | Threaded
Open this post in threaded view
|

Re: Should we split the Input class?

Jachym Cepicky
Hi,

just noting: this is, where the processes is deep-copied https://github.com/geopython/pywps/blob/develop/pywps/app/Service.py#L290

This is example of how process inputs are "cloned", when created instances while parsing


What we need to achieve:

1 - input/output declaration
2 - describe process, capabilities
3 -  execute:
3a - request parsing, 
3b - creating inputs/outputs for job to-be-executed, 
3c - output xml-encoding,
3d - execute xml ecoding with lineage=true,
3e - process queuing  

today's implementation uses result of the declaration for 2 and deepcopy for 3, with methods being used for 3a-3e

no strong opinion about this - it might be confusing, but everything is on place now

there is surely some  more engineering way, how to achieve this. 

I have no idea, how it would be made easier for the user - now, only one class is used. Would you have some code example please?

J

so 22. 7. 2017 v 18:36 odesílatel Jorge Mendes de Jesus <[hidden email]> napsal:
Hi to all

I never took a deep look at the code but what you say makes total sense to me.



On 22 Jul 2017 17:26, "Luí­s Moreira de Sousa" <[hidden email]> wrote:
We have a bit of a mess with the Input class concept. It is firstly instantiated in the Process implementation (by the user). Then it is deep copied to support the actual inputs at run time.

It seems we are bundling two concepts together:
. InputDeclaration - that describes the input name, type, abstract, etc.
. PhysicalInput - that holds the actual data (or path to data) after an Execute request is parsed

By associating the InputDeclaration class to the Process class and PhysicalInput to the Request class we can avoid the deep copy. And make the code more clear.

Please discuss. Cheers.

P.S.: this is also true for outputs, but there it is not as critical.

--
Luís Moreira de Sousa
Im Grund 6
CH-8600 Dübendorf
Switzerland

Phone: <a href="tel:+41%2079%20812%2062%2065" value="+41798126265" target="_blank">+41 (0)79 812 62 65



_______________________________________________
pywps-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pywps-dev

_______________________________________________
pywps-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pywps-dev

_______________________________________________
pywps-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pywps-dev