Skip to content

Commit f15dbe6

Browse files
update more docstrings
1 parent a3f4a52 commit f15dbe6

23 files changed

+74
-60
lines changed

doc/conf.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
intersphinx_mapping = {
5353
"python": ("https://docs.python.org/3/", None),
5454
"pandas": ("https://pandas.pydata.org/docs/", None),
55+
"sklearn": ("https://scikit-learn.org/stable/", None),
5556
"numpy": ("https://numpy.org/doc/stable/", None),
5657
"swat": ("https://sassoftware.github.io/python-swat/", None),
5758
"pytest": ("https://docs.pytest.org/en/latest/", None),
@@ -67,7 +68,6 @@
6768
napoleon_google_docstring = False
6869
napoleon_numpy_docstring = True
6970
napoleon_use_ivar = True
70-
napoleon_use_param = False
7171
napoleon_use_rtype = False
7272

7373
todo_include_todos = True
@@ -103,7 +103,13 @@
103103

104104
# Suppress warnings 'py:class reference target not found: <type>'
105105
nitpicky = True
106-
nitpick_ignore = [('py:class','Response'),('py:class','Request'),('py:class','sasctl._services.service.Service')]
106+
nitpick_ignore = [
107+
('py:class','optional'),
108+
('py:class','json.encoder.JSONEncoder'), # I don't understand why it can't find it
109+
('py:class','Response'),
110+
('py:class','Request'),
111+
('py:class','sasctl._services.service.Service') # should the Service class be documented?
112+
]
107113

108114
# -- Options for HTML output -------------------------------------------------
109115

src/sasctl/_services/cas_management.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ def upload_file(
324324
header : bool, optional
325325
Whether the first row of data contains column headers. Defaults to
326326
True.
327-
format_ : {"csv", "xls", "xlsx", "sas7bdat", "sashdat"}, optional
327+
format_ : str, optional
328+
Choose from {"csv", "xls", "xlsx", "sas7bdat", "sashdat"}.
328329
File of input `file`. Not required if format can be discerned from
329330
the file path.
330331
detail : dict, optional

src/sasctl/_services/concepts.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def assign_concepts(
3737
3838
Parameters
3939
----------
40-
documents : str or dict or list_like
40+
documents : str or dict or list
4141
Documents to analyze. May be either the URI to a CAS table where the
4242
documents are currently stored, or an iterable of strings containing
4343
the documents' text.
@@ -55,8 +55,9 @@ def assign_concepts(
5555
model
5656
output_postfix : str, optional
5757
Text to be added to the end of all output table names.
58-
match_type : {'all', 'longest', 'best'}, optional
59-
Type of matches to return. Defaults to 'all'.
58+
match_type : str, optional
59+
Choose from ``{'all', 'longest', 'best'}``.
60+
Type of matches to return. Defaults to 'all'.
6061
enable_facts : bool, optional
6162
Whether to enable facts in the results. Defaults to False.
6263
language : str, optional

src/sasctl/_services/files.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ def create_file(cls, file, folder=None, filename=None, expiration=None):
4040
4141
Parameters
4242
----------
43-
file : str or file_like
43+
file : str or io.BytesIO
4444
Path to the file to upload or a file-like object.
4545
folder : str or dict, optional
4646
Name or folder information as returned by :meth:`.get_folder`.
4747
filename : str, optional
4848
Name to assign to the uploaded file. Defaults to the filename if `file` is a path, otherwise required.
49-
expiration : datetime, optional
49+
expiration : datetime.datetime, optional
5050
A timestamp that indicates when to expire the file. Defaults to no expiration.
5151
5252
Returns

src/sasctl/_services/microanalytic_score.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def execute_module_step(cls, module, step, return_dict=True, **kwargs):
107107
108108
Returns
109109
-------
110-
any
110+
Any
111111
Results of the step execution. Returned as a dictionary if
112112
`return_dict` is True, otherwise returned as a tuple if more
113113
than one value is returned, otherwise the single value.
@@ -180,8 +180,10 @@ def create_module(
180180
name : str
181181
description : str
182182
source : str
183-
language : {'python','ds2'}
184-
scope : {'public','private'}
183+
language : str
184+
Choose from ``{'python','ds2'}``
185+
scope : str
186+
Choose from ``{'public','private'}``
185187
186188
Returns
187189
-------

src/sasctl/_services/model_management.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,8 @@ def create_custom_kpi(
448448
model : str or dict
449449
The name or id of the model, or a dictionary representation of the model.
450450
project : str or dict
451-
The name or id of the project, or a dictionary representation of
452-
the project.
451+
The name or id of the project, or a dictionary representation of
452+
the project.
453453
timeLabel : str or list
454454
Label associated with the dataset used within the performance definition.
455455
kpiName : str or list

src/sasctl/_services/model_publish.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ def create_destination(
230230
----------
231231
name : str
232232
Name of the publishing destination.
233-
type_ : {'cas', 'mas', 'hadoop', 'teradata'}
233+
type_ : str
234+
Choose from ``{'cas', 'mas', 'hadoop', 'teradata'}``
234235
Type of publishing definition being created
235236
cas_server : str, optional
236237
Name of the CAS server. Defaults to 'cas-shared-default'.

src/sasctl/_services/model_repository.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def get_astore(cls, model):
6565
6666
Returns
6767
----------
68-
binary?
68+
BinaryIO
6969
7070
"""
7171
# TODO: Download binary object?
@@ -296,10 +296,10 @@ def create_model(
296296
properties : dict, optional
297297
Custom model properties provided as name: value pairs.
298298
Allowed types are int, float, string, datetime.date, and datetime.datetime
299-
input_variables : array_like, optional
299+
input_variables : Iterable, optional
300300
Model input variables. By default, these are the same as the model
301301
project.
302-
output_variables : array_like, optional
302+
output_variables : Iterable, optional
303303
Model output variables. By default, these are the same as the model
304304
project.
305305
project_version : str

src/sasctl/_services/saslogon.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def create_client(
4646
The ID to be assigned to the client.
4747
client_secret : str
4848
The client secret used for authentication.
49-
scopes : list of string, optional
49+
scopes : list of str, optional
5050
Specifies the levels of access that the client will be able to
5151
obtain on behalf of users when not using client credential
5252
authentication. If `allow_password` or `allow_auth_code` are
@@ -160,7 +160,7 @@ def list_clients(cls, start_index=None, count=None, descending=False):
160160
----------
161161
start_index : int, optional
162162
Index of first client to return. Defaults to 1.
163-
count : int, optiona;
163+
count : int, optional
164164
Number of clients to retrieve. Defaults to 100.
165165
descending : bool, optional
166166
Whether to clients should be returned in descending order.

src/sasctl/_services/sentiment_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def analyze_sentiment(
3737
3838
Parameters
3939
----------
40-
documents : str or dict or Iterable:
40+
documents : str or dict or Iterable
4141
Documents to analyze. May be either the URI to a CAS table where the
4242
documents are currently stored, or an iterable of strings containing
4343
the documents' text.

0 commit comments

Comments
 (0)