diff --git a/odm2api/ODM2/services/readService.py b/odm2api/ODM2/services/readService.py index fd95953..a3a4b0e 100644 --- a/odm2api/ODM2/services/readService.py +++ b/odm2api/ODM2/services/readService.py @@ -549,19 +549,19 @@ def getAffiliations(self, ids=None, personfirst=None, personlast=None, orgcode=N all Affiliation objects in the database will be returned. Args: - ids (:obj:`list`, optional): List of AffiliationIDs. Defaults to None. - personfirst (:obj:`str`, optional): Person First Name. Defaults to None. - personlast (:obj:`str`, optional): Person Last Name. Defaults to None. - orgcode (:obj:`str`, optional): Organization Code. Defaults to None. + ids (list, optional): List of AffiliationIDs. + personfirst (str, optional): Person First Name. + personlast (str, optional): Person Last Name. + orgcode (str, optional): Organization Code. Returns: list: List of Affiliation objects Examples: - >>> read.getAffiliations(ids=[39,40]) - >>> read.getAffiliations(personfirst='John', + >>> ReadODM2.getAffiliations(ids=[39,40]) + >>> ReadODM2.getAffiliations(personfirst='John', ... personlast='Smith') - >>> read.getAffiliations(orgcode='Acme') + >>> ReadODM2.getAffiliations(orgcode='Acme') """ q = self._session.query(Affiliations) @@ -588,18 +588,36 @@ def getResults(self, ids=None, type=None, uuids=None, actionid=None, simulationi variableid=None, siteid=None): # TODO what if user sends in both type and actionid vs just actionid - """ - getResults(self, ids=None, type=None, uuids=None, actionid=None, simulationid=None, sfid=None, - variableid=None, siteid=None) - * Pass nothing - returns a list of all Results objects - * Pass a list of ResultID - returns a single Results object - * Pass a ResultType - returns a list of Result objects of that type. must be from ResultTypeCV - * Pass a list of UUIDs - - * Pass an ActionID - returns a single Results object - * Pass a Sampling Feature ID- returns a list of objects with that Sampling Feature ID - * Pass a Variable ID - returns a list of results with that Variable ID - * Pass a Simulation ID - return a list of results that were generated by that simulation - * Pass a Site ID - return a list of results from that site location, through the related features table. + """Retrieve a list of Result objects. + + If no arguments are passed to the function, or their values are None, + all Result objects in the database will be returned. + + Args: + ids (list, optional): List of ResultIDs. + type (str, optional): Type of Result from + `controlled vocabulary name `_. + uuids (list, optional): List of UUIDs string. + actionid (int, optional): ActionID. + simulationid (int, optional): SimulationID. + sfid (int, optional): SamplingFeatureID. + variableid (int, optional): VariableID. + siteid (int, optional): SiteID. + + Returns: + list: List of Result objects + + Examples: + >>> ReadODM2.getResults(ids=[39,40]) + >>> ReadODM2.getResults(type='Time series coverage') + >>> ReadODM2.getResults(sfid=65) + >>> ReadODM2.getResults(uuids=['a6f114f1-5416-4606-ae10-23be32dbc202', + ... '5396fdf3-ceb3-46b6-aaf9-454a37278bb4']) + >>> ReadODM2.getResults(simulationid=50) + >>> ReadODM2.getResults(siteid=6) + >>> ReadODM2.getResults(variableid=7) + >>> ReadODM2.getResults(actionid=20) + """ query = self._session.query(Results)