8. Skip to content

8. User-Defined Statistics Setup

Specification Compliance Manager (SCM) enables users to calculate user-defined statistics on measurement data by writing custom Python scripts. Refer to the following instructions to learn how to set up and deploy the user-defined compliance scripts in server.

8.1 Managing dependencies

8.1.1 Getting the list of modules installed in the server environment

  1. Open the command line in the server PC and navigate to the following location using the cd command: > C:\Program Files\National Instruments\Shared\Skyline\Python\3.8

  2. Run the command: python -m pip freeze >> server_requirements.txt

    The server_requirements.txt file is created in the previous folder. This file contains the list of dependencies with versions.

8.1.2 Updating or installing new python modules in the server

If there is a need to install any new library that is not present in the development environment as well as in the server’s environment, then the library has to be installed in both the development and the server’s environment.

  1. To install a library in server environment, open the command line as admin in the server PC. Navigate to the following location using the cd command: > C:\Program Files\National Instruments\Shared\Skyline\Python\3.8

  2. Run the command **python -m pip install \<library_name>==\** > For example, "python -m pip install polars==0.16.9"

8.2 Deploying the user-defined compliance scripts to the server

8.2.1 Copying the scripts to the server

After a custom script has been tested and is ready for deployment, users can upload it to the server by placing the .py file inside the following directory in the server PC:

C:\ProgramData\National Instruments\Skyline\JupyterHub\notebooks\shared\reports\SpecManagement\UserDefinedCompliance\Scripts

8.2.2 Error Logs

If an error or exception occurs while running a custom Python script after deployment, the error traceback will be logged in the following folder

C:\ProgramData\National Instruments\SCM\NotebookExecutionLogs\UserDefinedStatistics

The latest logs are kept in the log_file.log file within this folder.


Last update: April 13, 2023