1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
|
import os
from . import version # noqa: api import
from .depends import depends # noqa: api import
from .parameterized import ( # noqa: api import
Parameterized, Parameter, Skip, String, ParameterizedFunction,
ParamOverrides, Undefined, get_logger
)
from .parameterized import (batch_watch, output, script_repr, # noqa: api import
discard_events, edit_constant)
from .parameterized import shared_parameters # noqa: api import
from .parameterized import logging_level # noqa: api import
from .parameterized import DEBUG, VERBOSE, INFO, WARNING, ERROR, CRITICAL # noqa: api import
from .parameters import ( # noqa: api import
guess_param_types,
param_union,
parameterized_class,
guess_bounds,
get_soft_bounds,
resolve_path,
normalize_path,
Time,
Infinity,
Dynamic,
Bytes,
Number,
Integer,
Magnitude,
Boolean,
Tuple,
NumericTuple,
XYCoordinates,
Callable,
Action,
Composite,
SelectorBase,
ListProxy,
Selector,
ObjectSelector,
ClassSelector,
List,
HookList,
Dict,
Array,
DataFrame,
Series,
Path,
Filename,
Foldername,
FileSelector,
ListSelector,
MultiFileSelector,
Date,
CalendarDate,
Color,
Range,
DateRange,
CalendarDateRange,
Event,
)
from .reactive import bind, rx # noqa: api import
from ._utils import ( # noqa: api import
produce_value,
as_unicode,
is_ordered_dict,
hashable,
named_objs,
descendents,
concrete_descendents,
abbreviate_paths,
exceptions_summarized,
_is_number,
)
# Define '__version__'
try:
# For performance reasons on imports, avoid importing setuptools_scm
# if not in a .git folder
if os.path.exists(os.path.join(os.path.dirname(__file__), "..", ".git")):
# If setuptools_scm is installed (e.g. in a development environment with
# an editable install), then use it to determine the version dynamically.
from setuptools_scm import get_version
# This will fail with LookupError if the package is not installed in
# editable mode or if Git is not installed.
__version__ = get_version(root="..", relative_to=__file__)
else:
raise FileNotFoundError
except (ImportError, LookupError, FileNotFoundError):
# As a fallback, use the version that is hard-coded in the file.
try:
# __version__ was added in _version in setuptools-scm 7.0.0, we rely on
# the hopefully stable version variable.
from ._version import version as __version__
except (ModuleNotFoundError, ImportError):
# Either _version doesn't exist (ModuleNotFoundError) or version isn't
# in _version (ImportError). ModuleNotFoundError is a subclass of
# ImportError, let's be explicit anyway.
# Try something else:
from importlib.metadata import version as mversion, PackageNotFoundError
try:
__version__ = mversion("param")
except PackageNotFoundError:
# The user is probably trying to run this without having installed
# the package.
__version__ = "0.0.0+unknown"
#: Top-level object to allow messaging not tied to a particular
#: Parameterized object, as in 'param.main.warning("Invalid option")'.
main=Parameterized(name="main")
# A global random seed (integer or rational) available for controlling
# the behaviour of Parameterized objects with random state.
random_seed = 42
__all__ = (
'Action',
'Array',
'Boolean',
'Bytes',
'CRITICAL',
'CalendarDate',
'CalendarDateRange',
'Callable',
'ClassSelector',
'Color',
'Composite',
'DEBUG',
'DataFrame',
'Date',
'DateRange',
'Dict',
'Dynamic',
'ERROR',
'Event',
'FileSelector',
'Filename',
'Foldername',
'HookList',
'INFO',
'Infinity',
'Integer',
'List',
'ListProxy',
'ListSelector',
'Magnitude',
'MultiFileSelector',
'Number',
'NumericTuple',
'ObjectSelector',
'ParamOverrides',
'Parameter',
'Parameterized',
'ParameterizedFunction',
'Path',
'Range',
'Selector',
'SelectorBase',
'Series',
'Skip',
'String',
'Time',
'Tuple',
'Undefined',
'VERBOSE',
'WARNING',
'XYCoordinates',
'__version__',
'_is_number',
'abbreviate_paths',
'as_unicode',
'batch_watch',
'bind',
'concrete_descendents',
'depends',
'descendents',
'discard_events',
'edit_constant',
'exceptions_summarized',
'get_logger',
'get_soft_bounds',
'guess_bounds',
'guess_param_types',
'hashable',
'is_ordered_dict',
'logging_level',
'main',
'named_objs',
'normalize_path',
'output',
'param_union',
'parameterized_class',
'produce_value',
'random_seed',
'resolve_path',
'rx',
'script_repr',
'serializer',
'shared_parameters',
'version',
)
|