def configure(self, inputs, outputs):
        """Configure activity input and output.

        You need to provide a list of input and output :class:`Property`. Does not work with lists of propery id's.

        :param inputs: iterable of input property models
        :type inputs: list(:class:`Property`)
        :param outputs: iterable of output property models
        :type outputs: list(:class:`Property`)
        :raises APIError: when unable to configure the activity
        """
        def _get_propertyset(proplist):
            """Make it into a unique list of properties to configure for either inputs or outputs."""
            from pykechain.models import Property
            propertyset = []
            for property in proplist:
                if isinstance(property, Property):
                    propertyset.append(property.id)
                elif is_uuid(property):
                    propertyset.append(property)
            return list(set(propertyset))

        url = self._client._build_url('activity', activity_id='{}/update_associations'.format(self.id))

        if not all([p._json_data.get('category') == Category.MODEL for p in inputs]) and \
                not all([p._json_data.get('category') == Category.MODEL for p in outputs]):
            raise IllegalArgumentError('All Properties need to be of category MODEL to configure a task')

        r = self._client._request('PUT', url, json={
            'inputs': _get_propertyset(inputs),
            'outputs': _get_propertyset(outputs)
        })

        if r.status_code != requests.codes.ok:  # pragma: no cover
            raise APIError("Could not configure activity")
def configure ( self , inputs , outputs ) : def _get_propertyset ( proplist ) : from pykechain . models import Property propertyset = [ ] for property in proplist : if isinstance ( property , Property ) : propertyset . append ( property . id ) elif is_uuid ( property ) : propertyset . append ( property ) return list ( set ( propertyset ) ) url = self . _client . _build_url ( 'activity' , activity_id = '{}/update_associations' . format ( self . id ) ) if not all ( [ p . _json_data . get ( 'category' ) == Category . MODEL for p in inputs ] ) and not all ( [ p . _json_data . get ( 'category' ) == Category . MODEL for p in outputs ] ) : raise IllegalArgumentError ( 'All Properties need to be of category MODEL to configure a task' ) r = self . _client . _request ( 'PUT' , url , json = { 'inputs' : _get_propertyset ( inputs ) , 'outputs' : _get_propertyset ( outputs ) } ) if r . status_code != requests . codes . ok : raise APIError ( "Could not configure activity" )
Configure activity input and output.

        You need to provide a list of input and output :class:`Property`. Does not work with lists of propery id's.

        :param inputs: iterable of input property models
        :type inputs: list(:class:`Property`)
        :param outputs: iterable of output property models
        :type outputs: list(:class:`Property`)
        :raises APIError: when unable to configure the activity