Skip to content

Commit bd3fb4d

Browse files
committed
docs: more constructor docstrings
1 parent c3dd119 commit bd3fb4d

File tree

1 file changed

+55
-10
lines changed

1 file changed

+55
-10
lines changed

pins/constructors.py

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,31 @@ def board(
9595
# TODO(#31): change file boards to unversioned once implemented
9696

9797

98-
def board_folder(path, versioned=True, allow_pickle_read=None):
98+
def board_folder(path: str, versioned=True, allow_pickle_read=None):
99+
"""Create a pins board inside a folder.
100+
101+
Parameters
102+
----------
103+
path:
104+
The folder that will hold the board.
105+
**kwargs:
106+
Passed to the pins.board function.
107+
"""
108+
99109
return board(
100110
"file", path, versioned, cache=None, allow_pickle_read=allow_pickle_read
101111
)
102112

103113

104114
def board_temp(versioned=True, allow_pickle_read=None):
115+
"""Create a pins board in a temporary directory.
116+
117+
Parameters
118+
----------
119+
**kwargs:
120+
Passed to the pins.board function.
121+
"""
122+
105123
tmp_dir = tempfile.TemporaryDirectory()
106124

107125
board_obj = board(
@@ -117,6 +135,13 @@ def board_temp(versioned=True, allow_pickle_read=None):
117135

118136

119137
def board_local(versioned=True, allow_pickle_read=None):
138+
"""Create a board in a system data directory.
139+
140+
Parameters
141+
----------
142+
**kwargs:
143+
Passed to the pins.board function.
144+
"""
120145
path = get_data_dir()
121146

122147
return board(
@@ -131,15 +156,14 @@ def board_github(
131156
132157
Parameters
133158
----------
134-
path:
135-
TODO
136-
versioned:
137-
TODO
138159
org:
139160
Name of the github org (e.g. user account).
140161
repo:
141162
Name of the repo.
142-
163+
path:
164+
A subfolder in the github repo holding the board.
165+
**kwargs:
166+
Passed to the pins.board function.
143167
144168
Note
145169
----
@@ -172,7 +196,16 @@ def board_github(
172196

173197

174198
def board_urls(path: str, pin_paths: dict, cache=DEFAULT, allow_pickle_read=None):
175-
"""
199+
"""Create a board from individual urls.
200+
201+
Parameters
202+
----------
203+
path:
204+
A base url to prefix all individual pin urls with.
205+
pin_paths: Mapping
206+
A dictionary mapping pin name to pin url .
207+
**kwargs:
208+
Passed to the pins.board function.
176209
177210
Example
178211
-------
@@ -210,14 +243,17 @@ def board_urls(path: str, pin_paths: dict, cache=DEFAULT, allow_pickle_read=None
210243
def board_rsconnect(
211244
versioned=True, server_url=None, api_key=None, cache=DEFAULT, allow_pickle_read=None
212245
):
213-
"""
246+
"""Create a board to read and write pins from an RStudio Connect instance.
214247
215248
Parameters
216249
----------
217250
server_url:
218-
TODO
251+
Url to the RStudio Connect server.
219252
api_key:
220-
TODO
253+
API key for server. If not specified, pins will attempt to read it from
254+
CONNECT_API_KEY environment variable.
255+
**kwargs:
256+
Passed to the pins.board function.
221257
"""
222258

223259
# TODO: api_key can be passed in to underlying RscApi, equiv to R's manual mode
@@ -231,5 +267,14 @@ def board_rsconnect(
231267

232268

233269
def board_s3(path, versioned=True, cache=DEFAULT, allow_pickle_read=None):
270+
"""Create a board to read and write pins from an AWS S3 bucket folder.
271+
272+
Parameters
273+
----------
274+
path:
275+
Path of form <bucket_name>/<optional>/<subdirectory>.
276+
**kwargs:
277+
Passed to the pins.board function.
278+
"""
234279
# TODO: user should be able to specify storage options here?
235280
return board("s3", path, versioned, cache, allow_pickle_read)

0 commit comments

Comments
 (0)