Skip to content

onnx model info and doc fixes #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
06939a9
feat: initial onnx model info
jlwalke2 Aug 27, 2024
91f9b15
feat: extract onnx info
jlwalke2 Aug 28, 2024
24102f7
test: ignore classifier
jlwalke2 Aug 28, 2024
073fd78
test: install deep learning libraries
jlwalke2 Aug 28, 2024
9d06853
test: skip tf and h2o install
jlwalke2 Aug 28, 2024
0880489
test: don't check callspec on functions
jlwalke2 Aug 28, 2024
51ef8ae
chore: black
jlwalke2 Aug 28, 2024
f07f066
test: explicit fixture scope
jlwalke2 Aug 28, 2024
1c3df3d
test: remove incremental marker
jlwalke2 Aug 29, 2024
2e534af
test: remove incremental marker
jlwalke2 Aug 29, 2024
28cd970
test: rest mock
jlwalke2 Aug 29, 2024
39cc8af
test: debug mock reset
jlwalke2 Aug 29, 2024
4419d87
test: separate non-paging tests
jlwalke2 Aug 29, 2024
7f5a3ac
test: reset mock
jlwalke2 Aug 29, 2024
9248073
test: reset mock
jlwalke2 Aug 29, 2024
2dcf5b2
test: debug mock calls
jlwalke2 Aug 29, 2024
0810d1d
test: dont install onnx
jlwalke2 Aug 29, 2024
82a9bec
test: dont install pytorch
jlwalke2 Aug 29, 2024
02ceda2
feat: cleanup threadpool
jlwalke2 Aug 29, 2024
63a5816
fix: cancel_futures arg not supported until 3.8
jlwalke2 Aug 29, 2024
1734a33
test: wtf
jlwalke2 Aug 29, 2024
02654fb
test: mock session request
jlwalke2 Aug 29, 2024
f30d1e5
test: cleanup
jlwalke2 Aug 29, 2024
a3d5ca8
test: i give up
jlwalke2 Aug 29, 2024
254deb1
test: cleanup
jlwalke2 Aug 29, 2024
3f38327
doc: cleanup
jlwalke2 Aug 29, 2024
4f0d102
Merge branch 'master' of github.com:sassoftware/python-sasctl into onnx
jlwalke2 Aug 29, 2024
9ac2ddb
chore: black
jlwalke2 Aug 29, 2024
26ffc7c
fix: import name
jlwalke2 Aug 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/api/services/report_images.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ sasctl.services.report_images

.. automodule:: sasctl._services.report_images
:members:
:undoc-members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions doc/api/services/reports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ sasctl.services.reports
.. automodule:: sasctl._services.reports
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
('py:class','Response'),
('py:class','Request'),
('py:class','_io.BytesIO'),
('py:class','sasctl.utils.pymas.ds2.Ds2Variable'), # not sure what is wrong
('py:class','sasctl.utils.pymas.ds2.Ds2Variable'), # not sure what is wrong
('py:class','sasctl._services.service.Service') # should the Service class be documented?
]

Expand Down
2 changes: 1 addition & 1 deletion src/sasctl/_services/cas_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def check_keys(valid_keys: list, input_keys: list, parameters: str):

Raises
------
ValueError
ValueError
if input_keys are not valid
"""
if not all(key in valid_keys for key in input_keys):
Expand Down
2 changes: 1 addition & 1 deletion src/sasctl/_services/concepts.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def assign_concepts(
output_postfix : str, optional
Text to be added to the end of all output table names.
match_type : str, optional
Choose from ``{'all', 'longest', 'best'}``.
Choose from ``{'all', 'longest', 'best'}``.
Type of matches to return. Defaults to 'all'.
enable_facts : bool, optional
Whether to enable facts in the results. Defaults to False.
Expand Down
2 changes: 1 addition & 1 deletion src/sasctl/_services/data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_provider(cls, provider, refresh=False):
A dictionary containing the provider attributes or None.

Notes
-------
-----
If `provider` is a complete representation of the provider it will be
returned unless `refresh` is set. This prevents unnecessary REST calls
when data is already available on the client.
Expand Down
2 changes: 1 addition & 1 deletion src/sasctl/_services/folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def get_folder(cls, folder, refresh=False):
----------
folder : str or dict
May be one of:

- folder name
- folder ID
- folder path
Expand Down
2 changes: 1 addition & 1 deletion src/sasctl/_services/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def get_item(cls, item, refresh=False):
A dictionary containing the {item} attributes or None.

Notes
-------
-----
If `item` is a complete representation of the {item} it will be
returned unless `refresh` is set. This prevents unnecessary REST
calls when data is already available on the client.
Expand Down
15 changes: 12 additions & 3 deletions src/sasctl/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ def _request_token_with_oauth(
"""Request a token from the SAS SASLogon service.

Supports four different flows:

- authenticate with a username & password and receive a token
- authenticate with a client id & secret and receive a token
- provide an authorization code and receive a token
Expand Down Expand Up @@ -1531,6 +1531,13 @@ def __init__(self, obj, session=None, threads=4):
# Store the current items to iterate over
self._obj = obj

def __enter__(self):
return self

def __exit__(self, exc_type, exc_val, exc_tb):
if self._pool is not None:
self._pool.shutdown(wait=False)

def __next__(self):
if self._pool is None:
self._pool = concurrent.futures.ThreadPoolExecutor(
Expand Down Expand Up @@ -1778,7 +1785,7 @@ class VersionInfo:
Release cadence for Viya 4. Should be one of 'stable' or 'LTS'.
release : str, optional
Release number for Viya 4. Two formats are currently possible:

- YYYY.R.U where R is the LTS release number in YYYY and U is the updates since R
- YYYY.MM where MM is the month of the release.

Expand Down Expand Up @@ -2028,6 +2035,7 @@ def request(verb, path, session=None, format="auto", **kwargs):

Returns
-------
str, bytes, or requests.Response

"""
session = session or current_session()
Expand Down Expand Up @@ -2111,6 +2119,7 @@ def request_link(obj, rel, **kwargs):

Returns
-------
RestObj

"""
link = get_link(obj, rel)
Expand Down Expand Up @@ -2359,7 +2368,7 @@ def platform_version():

Returns
-------
str
str
SAS Viya version number '3.5' or '4.0'

"""
Expand Down
2 changes: 1 addition & 1 deletion src/sasctl/pzmm/import_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def import_model(
**kwargs
Other keyword arguments are passed to the following function:
:meth:`.ScoreCode.write_score_code`


Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion src/sasctl/pzmm/pickle_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def pickle_trained_model(
object.

The following files are generated by this function:

* '\*.pickle'
Binary pickle file containing a trained model.
* '\*.mojo'
Expand Down
3 changes: 2 additions & 1 deletion src/sasctl/pzmm/write_json_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import ast
import importlib
import json
# import math #not used

# import math #not used
import pickle
import pickletools
import sys
Expand Down
2 changes: 1 addition & 1 deletion src/sasctl/pzmm/zip_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def zip_files(
"""

if isinstance(model_files, dict):
buffer = io.BytesIO()
buffer = BytesIO()

with zipfile.ZipFile(buffer, "w", zipfile.ZIP_DEFLATED, False) as archive:
for file_name, data in model_files.items():
Expand Down
Loading
Loading