#!/usr/bin/env python # coding: utf-8 # In[ ]: from pywps import ComplexInput, ComplexOutput, FORMATS, Format class Profile(object): def __init__(self, *args, **kwargs): super(Profile, self).__init__(*args, **kwargs) @property def inputs(self): return self._inputs @inputs.setter def inputs(self, values): if isinstance(values, list): self._inputs.extend(values) class ESGFAPI(Profile): def __init__(self, *args, **kwargs): self._inputs = [ ComplexInput( 'test', 'Test', supported_formats=[FORMATS.JSON], ), ] super(ESGFAPI, self).__init__(*args, **kwargs) # In[ ]: from pywps import Process class EmuSubset(ESGFAPI, Process): def __init__(self): inputs = [ ComplexInput( 'domain', 'domain', abstract="", supported_formats=[FORMATS.JSON], min_occurs=0, max_occurs=1, ), ] outputs = [ ComplexOutput( 'output', 'Output', as_reference=True, supported_formats=[FORMATS.NETCDF], ), ] super(EmuSubset, self).__init__( self._handler, identifier='Emu.subset', title='xarray.subset', abstract="subset netcdf files", version='1', inputs=inputs, outputs=outputs, store_supported=True, status_supported=True) def _handler(self, request, response): pass # In[ ]: p = EmuSubset() for inpt in p.inputs: print(inpt.identifier) # In[ ]: t = EmuSubset() len(t.inputs)