Skip to content

Commit 7eb9914

Browse files
authored
Merge pull request #98 from lsetiawan/gaff_doc
Improve getAffiliation docstring to follow numpy/scipy documentation
2 parents feff576 + b81521d commit 7eb9914

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

odm2api/ODM2/services/readService.py

+20-7
Original file line numberDiff line numberDiff line change
@@ -543,13 +543,26 @@ def getPeople(self, ids=None, firstname=None, lastname=None):
543543
return None
544544

545545
def getAffiliations(self, ids=None, personfirst=None, personlast=None, orgcode=None):
546-
"""
547-
getAffiliations(self, ids=None, personfirst=None, personlast=None, orgcode=None)
548-
* Pass nothing - returns a list of all Affiliation objects
549-
* Pass a list of AffiliationID - returns a single Affiliation object
550-
* Pass a First Name - returns a single Affiliation object
551-
* Pass a Last Name - returns a single Affiliation object
552-
* Pass an OrganizationCode - returns a Affiliation object
546+
"""Retrieve a list of Affiliation objects.
547+
548+
If no arguments are passed to the function, or their values are None,
549+
all Affiliation objects in the database will be returned.
550+
551+
Args:
552+
ids (:obj:`list`, optional): List of AffiliationIDs. Defaults to None.
553+
personfirst (:obj:`str`, optional): Person First Name. Defaults to None.
554+
personlast (:obj:`str`, optional): Person Last Name. Defaults to None.
555+
orgcode (:obj:`str`, optional): Organization Code. Defaults to None.
556+
557+
Returns:
558+
list: List of Affiliation objects
559+
560+
Examples:
561+
>>> read.getAffiliations(ids=[39,40])
562+
>>> read.getAffiliations(personfirst='John',
563+
... personlast='Smith')
564+
>>> read.getAffiliations(orgcode='Acme')
565+
553566
"""
554567
q = self._session.query(Affiliations)
555568

0 commit comments

Comments
 (0)