Skip to content

Commit a3f4a52

Browse files
clear most docstrings reference warnings
1 parent c06fe48 commit a3f4a52

27 files changed

+353
-328
lines changed

doc/conf.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,26 @@
5050
]
5151

5252
intersphinx_mapping = {
53-
"python": ("https://docs.python.org/3", None),
53+
"python": ("https://docs.python.org/3/", None),
54+
"pandas": ("https://pandas.pydata.org/docs/", None),
55+
"numpy": ("https://numpy.org/doc/stable/", None),
5456
"swat": ("https://sassoftware.github.io/python-swat/", None),
5557
"pytest": ("https://docs.pytest.org/en/latest/", None),
5658
"betamax": ("https://betamax.readthedocs.io/en/latest/", None),
5759
"requests": ("https://requests.readthedocs.io/en/latest/", None),
58-
"tox": ("https://tox.readthedocs.io/en/latest/", None),
59-
"flake8": ("http://flake8.pycqa.org/en/latest/", None),
60+
"tox": ("https://tox.wiki/en/latest/", None),
61+
"flake8": ("https://flake8.pycqa.org/en/latest/", None),
6062
}
6163

6264
autosummary_generate = True
6365

66+
# Napoleon settings
67+
napoleon_google_docstring = False
68+
napoleon_numpy_docstring = True
69+
napoleon_use_ivar = True
70+
napoleon_use_param = False
71+
napoleon_use_rtype = False
72+
6473
todo_include_todos = True
6574

6675
todo_emit_warnings = True
@@ -92,6 +101,9 @@
92101
# The name of the Pygments (syntax highlighting) style to use.
93102
pygments_style = "sphinx"
94103

104+
# Suppress warnings 'py:class reference target not found: <type>'
105+
nitpicky = True
106+
nitpick_ignore = [('py:class','Response'),('py:class','Request'),('py:class','sasctl._services.service.Service')]
95107

96108
# -- Options for HTML output -------------------------------------------------
97109

doc/index.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ sasctl
44

55
Version |version|
66

7-
.. toctree::
8-
:maxdepth: 3
9-
:hidden: true
10-
11-
index
127

138
Introduction
149
------------
@@ -313,7 +308,7 @@ Logging
313308
+++++++
314309

315310
All logging is handled through the built-in :mod:`logging` module with standard module-level loggers. The one exception
316-
to this is :class:`.Session` request/response logging. Sessions contain a :attr:`~sasctl.core.Session.message_log` which is exclusively used
311+
to this is :class:`.Session` request/response logging. Sessions contain a `message_log` which is exclusively used
317312
to record requests and responses made through the session. Message recording can be configured on a per-session basis
318313
by updating this logger, or the ``sasctl.core.session`` logger can be configured to control all message recording by all sessions.
319314

@@ -497,7 +492,7 @@ Python versions.
497492

498493
Useful Tox Commands
499494
+++++++++++++++++++
500-
:mod:`tox` is used to automate common development tasks such as testing, linting, and building documentation.
495+
:mod:`tox` is used to automate common development tasks such as testing, linting, and building documentation.
501496
Running :program:`tox` from the project root directory will automatically build virtual environments for all Python interpreters
502497
found on the system and then install the required packages necessary to perform a given task. The simplest way to run Tox is:
503498

src/sasctl/_services/cas_management.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ def check_required_key(
5858
5959
Raises
6060
------
61-
ValueError if required_key is not present.
62-
TypeError if required_key is neither a list or a string.
61+
ValueError
62+
if required_key is not present.
63+
TypeError
64+
if required_key is neither a list or a string.
6365
"""
6466
if isinstance(required_key, str):
6567
if required_key not in input_keys:
@@ -310,7 +312,7 @@ def upload_file(
310312
311313
Parameters
312314
----------
313-
file : str or file-like object
315+
file : str or typing.TextIO
314316
File containing data to upload or path to the file.
315317
name : str
316318
Name of the table to create

src/sasctl/_services/concepts.py

Lines changed: 3 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_like
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.
@@ -71,8 +71,8 @@ def assign_concepts(
7171
7272
See Also
7373
--------
74-
cas_management.get_caslib
75-
cas_management.get_table
74+
.cas_management.CASManagement.get_caslib
75+
.cas_management.CASManagement.get_table
7676
7777
"""
7878
if documents is None:

src/sasctl/_services/data_sources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def table_uri(cls, table):
227227
228228
Parameters
229229
----------
230-
table : dict or CASTable
230+
table : dict or swat.cas.table.CASTable
231231
232232
Returns
233233
-------

src/sasctl/_services/files.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def create_file(cls, file, folder=None, filename=None, expiration=None):
4343
file : str or file_like
4444
Path to the file to upload or a file-like object.
4545
folder : str or dict, optional
46-
Name, or, or folder information as returned by :func:`.get_folder`.
46+
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.
4949
expiration : datetime, optional
@@ -96,7 +96,8 @@ def get_file_content(cls, file):
9696
9797
Returns
9898
-------
99-
content
99+
str
100+
content
100101
101102
"""
102103
file = cls.get_file(file)

src/sasctl/_services/folders.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@ def get_folder(cls, folder, refresh=False):
7171
----------
7272
folder : str or dict
7373
May be one of:
74-
- folder name
75-
- folder ID
76-
- folder path
77-
- folder delegate string
78-
- dictionary representation of the folder
74+
75+
- folder name
76+
- folder ID
77+
- folder path
78+
- folder delegate string
79+
- dictionary representation of the folder
7980
refresh : bool, optional
8081
Obtain an updated copy of the folder.
8182

src/sasctl/_services/microanalytic_score.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def execute_module_step(cls, module, step, return_dict=True, **kwargs):
102102
return_dict : bool, optional
103103
Whether the results should be returned as a dictionary instead
104104
of a tuple
105-
kwargs : any
105+
**kwargs
106106
Passed as arguments to the module step
107107
108108
Returns
@@ -180,8 +180,8 @@ def create_module(
180180
name : str
181181
description : str
182182
source : str
183-
language : str { 'python', 'ds2' }
184-
scope : str { 'public', 'private' }
183+
language : {'python','ds2'}
184+
scope : {'public','private'}
185185
186186
Returns
187187
-------

src/sasctl/_services/model_management.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,8 @@ def create_custom_kpi(
456456
Name of the custom KPI.
457457
kpiValue : int or float or list
458458
Value of the custom KPI.
459-
timeSK : int or list, by default None
460-
Indicator for the MM_STD_KPI table to denote performance task order.
459+
timeSK : int or list
460+
Default is None. Indicator for the MM_STD_KPI table to denote performance task order.
461461
"""
462462
from .model_repository import ModelRepository
463463

src/sasctl/_services/model_repository.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -813,10 +813,10 @@ def list_project_versions(cls, project):
813813
list of dicts
814814
List of dicts representing different project versions. Dict key/value
815815
pairs are as follows.
816-
name : str
817-
id : str
818-
number : str
819-
modified : datetime
816+
- name : str
817+
- id : str
818+
- number : str
819+
- modified : datetime
820820
821821
"""
822822
project_info = cls.get_project(project)

src/sasctl/_services/sentiment_analysis.py

Lines changed: 3 additions & 3 deletions
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 list_like:
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.
@@ -67,8 +67,8 @@ def analyze_sentiment(
6767
6868
See Also
6969
--------
70-
cas_management.get_caslib
71-
cas_management.get_table
70+
.cas_management.CASManagement.get_caslib
71+
.cas_management.CASManagement.get_table
7272
7373
"""
7474
if current_session().version_info() >= 4:

src/sasctl/_services/service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def request(cls, verb, path, session=None, format_="auto", **kwargs):
7878
text: Response.text
7979
auto: `RestObj` constructed from JSON if possible, otherwise same as
8080
`text`.
81-
kwargs : any
81+
**kwargs
8282
Additional arguments are passed to the session `request` method.
8383
8484
Returns
@@ -369,7 +369,7 @@ def _get_rel(cls, item, rel, *args, func=None, filter_=None):
369369
----------
370370
item : str or dict
371371
rel : str
372-
args : any
372+
*args
373373
Passed to `func`
374374
func : function, optional
375375
Callable that takes (item, *args) and returns a RestObj of `item`
@@ -408,7 +408,7 @@ def _monitor_job(cls, job, max_retries=60):
408408
409409
Returns
410410
-------
411-
job
411+
job : dict
412412
413413
Raises
414414
------

src/sasctl/_services/text_categorization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def categorize(
6060
6161
See Also
6262
--------
63-
cas_management.get_caslib
64-
cas_management.get_table
63+
.cas_management.CASManagement.get_caslib
64+
.cas_management.CASManagement.get_table
6565
6666
"""
6767
if current_session().version_info() >= 4:

src/sasctl/_services/text_parsing.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class TextParsing(Service):
1616
Parsing is a key operation in understanding your data. Parsing a document
1717
involves the following analyses:
1818
19-
- Identifying terms used in the document
20-
- Recognizing parts of speech for each term
21-
- Identifying which terms are entities (person, country, and so on)
22-
- Resolving synonyms, misspellings, and so on
19+
- Identifying terms used in the document
20+
- Recognizing parts of speech for each term
21+
- Identifying which terms are entities (person, country, and so on)
22+
- Resolving synonyms, misspellings, and so on
2323
2424
The output tables that are generated during parsing can also be used in
2525
downstream analyses such as topic generation.
@@ -97,8 +97,8 @@ def parse_documents(
9797
9898
See Also
9999
--------
100-
cas_management.get_caslib
101-
cas_management.get_table
100+
.cas_management.CASManagement.get_caslib
101+
.cas_management.CASManagement.get_table
102102
103103
"""
104104
if current_session().version_info() >= 4:

0 commit comments

Comments
 (0)