Skip to content

Installing a Custom Function🔗

This article will show how you can add new Custom Functions to Modelon Impact to start using them.

Custom Functions can either be developed and installed as part of Projects or installed globally.

Project Specific Custom Functions🔗

Installation as part of a Project makes the Custom Functions available in the Workspaces containing that Project. This is the recommended way to develop and install Custom Functions.

To test installing a Custom Function this way then check out the open source example from Linearize Example . Use Workspace Management to bring the LinearizeExample Project into your workspace.

The function LinerazeExample.linearize is now available under the custom analysis in the experiment tab in the Details panel to the right. It can also be picked under the Run button.

Global Custom Functions🔗

Globally installed Custom Functions are available in all the workspaces. They are installed by uploading Python files into /home/jovyan/impact/custom_functions directory either via JupyterLab or VSCode user interface. Globally installed Custom Functions do not have a Project prefix in the name and are not distributed together with Modelon Impact Workspaces.

Add the Custom Function Python file in the folder C:/Users/<user_name>/impact/custom_functions.

The function is now available under the custom analysis in the experiment tab in the Details panel to the right.

Note

After the Custom Function has been added, you might need to reload (press F5) to see it in the web UI.