Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

When importing code, use the following prefixes:

  • python. : to import Python Module configurations. ultra. : to import built-in UDR types or Ultra Format configurations.

  • apl. : to import functions and/or constants from APL Code configurations.

  • . : to import something relative to any of the items listed above if located in the same folder.

  • <nothing> : to import any standard or third party Python module.

A good practice is to strive to organize the code in modules for maximum reuse.

Note!

Always import your Python Module configurations, Ultra Format configurations, and APL Code configurations from the global scope, i.e. not from within a function.

Example - Importing Code to the Python Agent

# Absolute imports
from python.Analytics.PYM_Algorithms import findclu
from ultra.Analytics.UFL_Types import InputData
from apl.Analytics.APL_Helpers import logger
 
# Relative imports
from .PYM_Algorithms import findclu
from .UFL_Types import InputData
from .APL_Helpers import logger
 
# Other imports
import numpy as np

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.