Skip to content

Commit

Permalink
adding docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
J-A-Ha committed Sep 18, 2024
1 parent 86c0d2a commit 6d19093
Show file tree
Hide file tree
Showing 4 changed files with 632 additions and 37 deletions.
Binary file modified art/classes/__pycache__/authors.cpython-39.pyc
Binary file not shown.
13 changes: 7 additions & 6 deletions art/classes/authors.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def name_set(self) -> set:
def has_orcid(self) -> bool:

"""
Returns True if the Author has an Orcid ID associated.
Returns True if the Author has an Orcid ID associated. Else, returns False.
"""

orcid = self.summary.loc[0, 'orcid']
Expand Down Expand Up @@ -465,7 +465,7 @@ def add_dataframe(self, dataframe: pd.DataFrame):
def from_dataframe(dataframe: pd.DataFrame): # type: ignore

"""
Takes a Pandas DataFrame and returns an Author.
Takes a Pandas DataFrame and returns an Author object.
Parameters
----------
Expand Down Expand Up @@ -728,7 +728,7 @@ def update_from_orcid(self):
class Authors(Entities):

"""
This is an Authors object. It contains a collection of Authors objects and a summary of data about them.
This is an Authors object. It contains a collection of Author objects and a summary of data about them.
Parameters
----------
Expand Down Expand Up @@ -822,7 +822,7 @@ def __repr__(self) -> str:
def __len__(self) -> int:

"""
Returns the number of Authors in the Authors collection. Uses the number of Author objects stored in the Authors.all dictionary.
Returns the number of Author objects in the Authors collection. Uses the number of Author objects stored in the Authors.all dictionary.
Returns
-------
Expand Down Expand Up @@ -886,6 +886,7 @@ def merge(self, authors, drop_duplicates = False, drop_empty_rows=False):
self : Authors
the merged Authors collection.
"""

left = self.summary.copy(deep=True)
right = authors.summary.copy(deep=True)

Expand Down Expand Up @@ -1508,12 +1509,12 @@ def search_orcid(self, query: str = 'request_input', add_to_authors: bool = True
def format_authors(author_data, drop_duplicates = False, drop_empty_rows=False):

"""
Formats a collection of author data as an Authors object.
Formats a collection of authors data as an Authors object.
Parameters
----------
author_data : object
a collection of author data.
a collection of authors data.
drop_empty_rows : bool
whether to remove rows which do not contain any data. Defaults to False.
drop_duplicates : bool
Expand Down
Loading

0 comments on commit 6d19093

Please sign in to comment.