qcfractal/interface/client.py
def _automodel_request(
        self, name: str, rest: str, payload: Dict[str, Any], full_return: bool = False, timeout: int = None
    ) -> Any:
        """Automatic model request profiling and creation using rest_models

        Parameters
        ----------
        name : str
            The name of the REST endpoint
        rest : str
            The type of the REST endpoint
        payload : Dict[str, Any]
            The input dictionary
        full_return : bool, optional
            Returns the full server response if True that contains additional metadata.
        timeout : int, optional
            Timeout time

        Returns
        -------
        Any
            The REST response object
        """
        sname = name.strip("/")
        self._request_counter[(sname, rest)] += 1

        body_model, response_model = rest_model(sname, rest)

        # Provide a reasonable traceback
        try:
            payload = body_model(**payload)
        except ValidationError as exc:
            raise TypeError(str(exc))

        r = self._request(rest, name, data=payload.serialize(self.encoding), timeout=timeout)
        encoding = r.headers["Content-Type"].split("/")[1]
        response = response_model.parse_raw(r.content, encoding=encoding)

        if full_return:
            return response
        else:
            return response.data
Automatic model request profiling and creation using rest_models

        Parameters
        ----------
        name : str
            The name of the REST endpoint
        rest : str
            The type of the REST endpoint
        payload : Dict[str, Any]
            The input dictionary
        full_return : bool, optional
            Returns the full server response if True that contains additional metadata.
        timeout : int, optional
            Timeout time

        Returns
        -------
        Any
            The REST response object
        
Automatic model request profiling and creation using rest_models
Parameters

name : str
The name of the REST endpoint
rest : str
The type of the REST endpoint
payload : Dict[str, Any]
The input dictionary
full_return : bool, optional
Returns the full server response if True that contains additional metadata.
timeout : int, optional
Timeout time

Returns

Any
The REST response object
Automatic model request profiling and creation using rest_models Parameters name : str The name of the REST endpoint rest : str The type of the REST endpoint payload : Dict [ str Any ] The input dictionary full_return : bool optional Returns the full server response if True that contains additional metadata . timeout : int optional Timeout time Returns Any The REST response object
def _automodel_request(
        self, name: str, rest: str, payload: Dict[str, Any], full_return: bool = False, timeout: int = None
    ) -> Any:
        sname = name.strip("/")
        self._request_counter[(sname, rest)] += 1
        body_model, response_model = rest_model(sname, rest)
        try:
            payload = body_model(**payload)
        except ValidationError as exc:
            raise TypeError(str(exc))
        r = self._request(rest, name, data=payload.serialize(self.encoding), timeout=timeout)
        encoding = r.headers["Content-Type"].split("/")[1]
        response = response_model.parse_raw(r.content, encoding=encoding)
        if full_return:
            return response
        else:
            return response.data
def _automodel_request ( self , name : str , rest : str , payload : Dict [ str , Any ] , full_return : bool = False , timeout : int = None ) -> Any : sname = name . strip ( "/" ) self . _request_counter [ ( sname , rest ) ] += 1 body_model , response_model = rest_model ( sname , rest ) try : payload = body_model ( ** payload ) except ValidationError as exc : raise TypeError ( str ( exc ) ) r = self . _request ( rest , name , data = payload . serialize ( self . encoding ) , timeout = timeout ) encoding = r . headers [ "Content-Type" ] . split ( "/" ) [ 1 ] response = response_model . parse_raw ( r . content , encoding = encoding ) if full_return : return response else : return response . data
Automatic model request profiling and creation using rest_models
Parameters
Automatic model request profiling and creation using rest_models Parameters
"""Automatic model request profiling and creation using rest_models

        Parameters
        ----------
        name : str
            The name of the REST endpoint
        rest : str
            The type of the REST endpoint
        payload : Dict[str, Any]
            The input dictionary
        full_return : bool, optional
            Returns the full server response if True that contains additional metadata.
        timeout : int, optional
            Timeout time

        Returns
        -------
        Any
            The REST response object
        """ # Provide a reasonable traceback
self
name
str
rest
str
payload
Dict[str, Any]
full_return
bool
timeout
int