Skip to content

Commit

Permalink
Update function docstrings to include info about params.
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoknjas committed Oct 28, 2024
1 parent 4551954 commit 6bac736
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions berserk/clients/studies.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ def export_chapter(
) -> str:
"""Export one chapter of a study.
:param study_id: study id
:param chapter_id: chapter id
:param clocks: include any clock comments in the PGN moves
:param comments: include any analysis and annotator comments in the PGN moves
:param variations: include any variations in the PGN moves
:param source: include a `Source` PGN tag containing the chapter URL
:param orientation: include an `Orientation` PGN tag containing the chapter's board orientation
:return: chapter PGN
"""
path = f"/api/study/{study_id}/{chapter_id}.pgn"
Expand All @@ -46,7 +53,13 @@ def export(
) -> Iterator[str]:
"""Export all chapters of a study.
:return: iterator over all chapters as PGN
:param study_id: study id
:param clocks: include any clock comments in the PGN moves
:param comments: include any analysis and annotator comments in the PGN moves
:param variations: include any variations in the PGN moves
:param source: for each chapter, include a `Source` PGN tag containing the chapter URL
:param orientation: for each chapter, include an `Orientation` PGN tag containing the chapter's board orientation
:return: iterator over all chapters as PGNs
"""
path = f"/api/study/{study_id}.pgn"
params = {
Expand All @@ -73,7 +86,14 @@ def export_by_username(
If not, only public (non-unlisted) studies are included.
return:iterator over all chapters as PGN"""
:param username: the user whose studies will be exported
:param clocks: include any clock comments in the PGN moves
:param comments: include any analysis and annotator comments in the PGN moves
:param variations: include any variations in the PGN moves
:param source: for each chapter, include a `Source` PGN tag containing the chapter URL
:param orientation: for each chapter, include an `Orientation` PGN tag containing the chapter's board orientation
:return: iterator over all chapters as PGNs
"""
path = f"/study/by/{username}/export.pgn"
params = {
"clocks": clocks,
Expand All @@ -92,7 +112,7 @@ def import_pgn(
orientation: Color = "white",
variant: Variant = "standard",
) -> List[ChapterIdName]:
"""Imports arbitrary PGN into an existing study.
"""Imports an arbitrary PGN into an existing study.
Creates a new chapter in the study.
If the PGN contains multiple games (separated by 2 or more newlines) then multiple chapters will be created within the study.
Expand Down

0 comments on commit 6bac736

Please sign in to comment.