From 9ed17c1bb98277404c286c4d91160007afb541b5 Mon Sep 17 00:00:00 2001 From: djm21 Date: Wed, 19 Aug 2026 09:48:13 -0700 Subject: [PATCH] updated docstrings for scoring functions --- src/sasctl/_services/score_definitions.py | 8 +++--- src/sasctl/_services/score_execution.py | 4 +-- src/sasctl/tasks.py | 32 +++++++++++++++++++++++ 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/sasctl/_services/score_definitions.py b/src/sasctl/_services/score_definitions.py index 0e3f4a57..9678238d 100644 --- a/src/sasctl/_services/score_definitions.py +++ b/src/sasctl/_services/score_definitions.py @@ -60,7 +60,7 @@ def create_score_definition( table_name: str A user-inputted table name in CAS Management. use_cas_gateway: bool, optional - Determines whether object uses CAS Gateway or not. + Determines if scoring uses CAS Gateway. table_file: str or Path, optional A user-provided path to an uploadable file. Defaults to None. description: str, optional @@ -70,9 +70,9 @@ def create_score_definition( library_name: str, optional The library within the CAS server the table exists in. Defaults to "Public". model_version: str, optional - The user-chosen version of the model. Deafaults to "latest". - input_mapping: list, optional - A list of dictionaries mapping variables from the data table to the variables in the model if they are different. Defaults to None. + The user-chosen version of the model. Defaults to "latest". + input_mapping: dict, optional + A dictionary mapping variables from the data table to the variables in the model if they are different. Defaults to None. Returns ------- diff --git a/src/sasctl/_services/score_execution.py b/src/sasctl/_services/score_execution.py index dfedb608..e55a16d1 100644 --- a/src/sasctl/_services/score_execution.py +++ b/src/sasctl/_services/score_execution.py @@ -158,7 +158,7 @@ def get_score_execution_results( Returns ------- - Table reference + pandas.DataFrame """ try: @@ -216,7 +216,7 @@ def _no_gateway_get_results(cls, server_name, library_name, table_name): Returns ------- - Pandas Dataframe + pandas.DataFrame """ if Version(pd.__version__) >= Version("1.0.3"): diff --git a/src/sasctl/tasks.py b/src/sasctl/tasks.py index 1b6db1a8..872cd564 100644 --- a/src/sasctl/tasks.py +++ b/src/sasctl/tasks.py @@ -984,6 +984,38 @@ def score_model_with_cas( timeout: int = 300, input_mapping: dict = None, ): + """Runs a score test on the specified model. + + Parameters + -------- + score_def_name: str + Name of score definition. + model : str or dict + The name or id of the model, or a dictionary representation of the model. + table_name: str + A user-inputted table name in CAS Management. + table_file: str or Path, optional + A user-provided path to an uploadable file. Defaults to None. + description: str, optional + Description of score definition. Defaults to an empty string. + server_name: str, optional + The server within CAS that the table is in. Defaults to "cas-shared-default". + library_name: str, optional + The library within the CAS server the table exists in. Defaults to "Public". + model_version: str, optional + The user-chosen version of the model. Defaults to "latest". + use_cas_gateway: bool, optional + Determines if scoring uses CAS Gateway. + timeout: int, optional + The maximum time in seconds to wait for the score execution to complete. Defaults to 300. + input_mapping: dict, optional + A dictionary mapping variables from the data table to the variables in the model if they are different. Defaults to None. + + Returns + ------- + pandas.DataFrame + + """ score_definition = sd.create_score_definition( score_def_name, model,