univariate_tools

 1# -----------------------------------------------------------------------------
 2# Authors:     [email protected]
 3# Created:     03/19/2025
 4# License:     NIST License
 5# -----------------------------------------------------------------------------
 6"""
 7
 8
 9"""
10
11#----------------------------------------------------------------------
12# Standard Imports
13import os
14import sys
15
16# -----------------------------------------------------------------------------
17# Third Party Imports
18sys.path.append(os.path.join(os.path.dirname( __file__ ), '..'))
19
20# -----------------------------------------------------------------------------
21# Module Constants
22VERBOSE_IMPORT = False
23TIMED_IMPORT = False
24__version__ = "0.0.9"
25"Constant that determines if import statements are echoed to output"
26# The new module load scheme can be for module in DE_API_MODULES.keys()
27# -----------------------------------------------------------------------------
28DE_API_MODULES = {"univariate_tools.fitting":True,
29                  "univariate_tools.interpolation":True}
30"Dictionary that controls the definition of the API, this can be set to leave out any unwanted modules. Also it is" \
31    "possible to discover all modules by DE_API_MODULES.keys()"
32
33# This makes sure this file is the one loaded
34sys.path.append(os.path.dirname(__file__))
35# To tune the imported API change the DE_API_MODULES dictionary
36if TIMED_IMPORT:
37    import datetime
38
39    first_timer = datetime.datetime.now(datetime.timezone.utc)
40    start_timer = datetime.datetime.now(datetime.timezone.utc)
41for module in sorted(DE_API_MODULES.keys()):
42    try:
43        if DE_API_MODULES[module]:
44            if VERBOSE_IMPORT:
45                print(("Importing {0}".format(module)))
46            exec('from {0} import *'.format(module))
47            if TIMED_IMPORT:
48                end_timer = datetime.datetime.now(datetime.timezone.utc)
49                time_difference = end_timer - start_timer
50                print(("It took {0} s to import {1}".format(time_difference.total_seconds(), module)))
51                start_timer = end_timer
52    except:
53        print(f"The {module}failed to import")
54        pass
55if TIMED_IMPORT:
56    end_timer = datetime.datetime.now(datetime.timezone.utc)
57    time_difference = end_timer - first_timer
58    print(("It took {0} s to import all of the active modules".format(time_difference.total_seconds())))
VERBOSE_IMPORT = False
TIMED_IMPORT = False
DE_API_MODULES = {'univariate_tools.fitting': True, 'univariate_tools.interpolation': True}

Dictionary that controls the definition of the API, this can be set to leave out any unwanted modules. Also it ispossible to discover all modules by DE_API_MODULES.keys()