fdi.dataset package

Submodules

fdi.dataset.abstractcomposite module

class fdi.dataset.abstractcomposite.AbstractComposite(**kwds)[source]

Bases: Attributable, EventListener, Composite, DataWrapperMapper

an annotatable and attributable subclass of Composite.

Composite inherits annotatable via EventListener via DataContainer.

__init__(**kwds)[source]
string(level=0, extra=False, param_widths=None, tablefmt='grid', tablefmt1='simple', tablefmt2='psql', width=0, matprint=None, trans=True, beforedata='', heavy=True, center=-1, **kwds)

matprint: an external matrix print function

Parameters:
  • level (int) – Detailedness level.

  • trans (print 2D matrix transposed. default is True.)

  • ——-

toString(level=0, extra=False, param_widths=None, tablefmt='grid', tablefmt1='simple', tablefmt2='psql', width=0, matprint=None, trans=True, beforedata='', heavy=True, center=-1, **kwds)[source]

matprint: an external matrix print function

Parameters:
  • level (int) – Detailedness level.

  • trans (print 2D matrix transposed. default is True.)

  • ——-

txt(level=0, extra=False, param_widths=None, tablefmt='grid', tablefmt1='simple', tablefmt2='psql', width=0, matprint=None, trans=True, beforedata='', heavy=True, center=-1, **kwds)

matprint: an external matrix print function

Parameters:
  • level (int) – Detailedness level.

  • trans (print 2D matrix transposed. default is True.)

  • ——-

fdi.dataset.annotatable module

class fdi.dataset.annotatable.Annotatable(description='UNKNOWN', **kwds)[source]

Bases: object

An Annotatable object is an object that can give a human readable description of itself.

__init__(description='UNKNOWN', **kwds)[source]
getDescription()[source]

gets the description of this Annotatable object.

Returns:

The current description.

Return type:

string

setDescription(newDescription)[source]

sets the description of this Annotatable object.

Parameters:

newDescription (string) – The new description.

fdi.dataset.arraydataset module

class fdi.dataset.arraydataset.ArrayDataset(data=None, unit=None, description=None, typ_=None, typecode=None, version=None, zInfo=None, alwaysMeta=True, **kwds)[source]

Bases: GenericDataset, Iterable, Shaped

Special dataset that contains a single Array Data object.

mh: If omit the parameter names during instanciation, e.g. ArrayDataset(a, b, c), the assumed order is data, unit, description. mh: contains a sequence which provides methods count(), index(), remove(), reverse(). A mutable sequence would also need append(), extend(), insert(), pop() and sort().

Data:

the payload data of this dataset. Default is None, Can be any iterable except for memoryview. Returns ——-

Initializes an ArrayDataset.

Default `None` will initialize MetaData Parameters to their default values. If data is not None and has shape (len applies), shape MDP is set to the actual data shape.

__init__(data=None, unit=None, description=None, typ_=None, typecode=None, version=None, zInfo=None, alwaysMeta=True, **kwds)[source]

Initializes an ArrayDataset.

Default `None` will initialize MetaData Parameters to their default values. If data is not None and has shape (len applies), shape MDP is set to the actual data shape.

append(*args, **kwargs)[source]

appends to data.

count(*args, **kwargs)[source]

returns size.

extend(*args, **kwargs)[source]

extend data.

index(*args, **kwargs)[source]

returns the index of a value.

pop(*args, **kwargs)[source]

revomes and returns value

remove(*args, **kwargs)[source]

removes value at first occurrence.

setData(data)[source]
string(level=0, param_widths=None, tablefmt='grid', tablefmt1='simple', tablefmt2='simple', width=0, matprint=None, trans=True, center=-1, heavy=True, **kwds)

matprint: an external matrix print function trans: print 2D matrix transposed. default is True.

toString(level=0, param_widths=None, tablefmt='grid', tablefmt1='simple', tablefmt2='simple', width=0, matprint=None, trans=True, center=-1, heavy=True, **kwds)[source]

matprint: an external matrix print function trans: print 2D matrix transposed. default is True.

txt(level=0, param_widths=None, tablefmt='grid', tablefmt1='simple', tablefmt2='simple', width=0, matprint=None, trans=True, center=-1, heavy=True, **kwds)

matprint: an external matrix print function trans: print 2D matrix transposed. default is True.

class fdi.dataset.arraydataset.Column(*args, typ_='Column', **kwds)[source]

Bases: ArrayDataset, ColumnListener

A Column is a the vertical cut of a table for which all cells have the same signature.

A Column contains raw ArrayData, and optionally a description and unit. example:

table = TableDataset()
table.addColumn("Energy",Column(data=[1,2,3,4],description="desc",unit='eV'))

Initializes an ArrayDataset.

Default `None` will initialize MetaData Parameters to their default values. If data is not None and has shape (len applies), shape MDP is set to the actual data shape.

fdi.dataset.arraydataset.mkline(line)[source]

make a display row from a given sequence.

Line:

the array or sequence line to display.

fdi.dataset.arraydataset_datamodel module

fdi.dataset.attributable module

class fdi.dataset.attributable.Attributable(meta=None, zInfo=None, alwaysMeta=False, **kwds)[source]

Bases: MetaDataHolder

An Attributable object is an object that has the notion of meta data.

MetaData Porperties (MDPs) are Attributes that store their properties in te metadata table.

Pick out arguments listed in zInfo then put updated parameters into MetaData meta.

meta: meta data container. zInfo: configuration alwaysMeta: always treat parameters as MetaDataProperties.

__init__(meta=None, zInfo=None, alwaysMeta=False, **kwds)[source]

Pick out arguments listed in zInfo then put updated parameters into MetaData meta.

meta: meta data container. zInfo: configuration alwaysMeta: always treat parameters as MetaDataProperties.

makeMdpMethods(outputfile=None)[source]

Generates a mix-in class file according to MetaData Property list.

property meta
setMdp(name, value, met=None, strict=False)[source]

Set Metadata Property.

An MDP attribute like ‘description’, stored in meta

Parameters:
  • name (string) – Name of the parameter.

  • value (Value of the parameter.)

  • met (FrozenDict) – Is zInfo(‘metadata’] or `zInfo[‘dataset’][xxx]`self.

Return type:

None

Raises:

TypeError – Wrong type.

setMeta(newMetadata)[source]

Replaces the current MetaData with specified argument.

Product will override this to add listener when meta is replaced. _defaults which usually is self.zInfo is added to new meta so str(meta) can ommit the parameters with default value.

setParameters(params)[source]

Set a group of name-value pairs to the object as properties.

params: a dictionary of name:value where value is a subclass of AbstractParameter. value can be the value of a registered MDP. type will be used if typ_ is given as the name.

fdi.dataset.attributable.MdpInfo = {}

Names not for mormal properties.

class fdi.dataset.attributable.MetaDataProperties[source]

Bases: object

Mix-in place-holder for Class denifitions that has not their own property.py generated by :meth: makeMdpMethods.

fdi.dataset.attributable.Reserved_Property_Names = ['history', 'meta', 'refs', 'dataset', 'zInfo', '_MDP', 'extraMdp', 'alwaysMeta', 'toString', 'string', 'yaml', 'tree']

These MetaData Parameters (MDPs) and vital attrbutes are Set By Parent classes: | Special MDPs and attrbutes | set by parent Classes | attribute holder | | ‘meta’ | Attributable | _meta | | ‘description’ | Annotatable | description | | ‘data’ and ‘shape’ | DataWrapper | _data | | ‘listeners’ | EventSender | _listener |

fdi.dataset.attributable.addMetaDataProperty(cls)[source]

mh: Add MDP to a class so that although they are metadata, they can be accessed by for example, productfoo.creator.

dynamic properties see https://stackoverflow.com/a/2584050 https://stackoverflow.com/a/1355444

fdi.dataset.attributable.make_class_properties(attrs, reserved=None)[source]

Generates class properties source code string according to given attribute names.

fdi.dataset.attributable.value2parameter(name, value, descriptor)[source]

returns a parameter with correct type and attributes.

According to the value, name, and specification in the data model.

Parameters:
  • name (str)

  • value (multiple) – Type must be compatible with data_type. Use datatypes.cast to cast nominal string values first, the pass the result to value here, if needed. For example [0, 0] is wrong; Vector2d([0, 0)] is right if data_type``==``vector2d.

  • descriptor (dict) – Is zInfo(‘metadata’] or zInfo[‘dataset’][xxx].

Returns:

The parameter.

Return type:

Parameter

Raises:

NameError – Parameter name not found.

fdi.dataset.baseproduct module

class fdi.dataset.baseproduct.BaseProduct(description='UNKNOWN', typ_='BaseProduct', level='ALL', creator='UNKNOWN', creationDate=FineTime(1958-01-01T00:00:00.000000), rootCause='UNKNOWN', version='0.8', FORMATV='1.6.0.11', zInfo=None, **kwds)[source]

Bases: AbstractComposite, Copyable, EventSender

A BaseProduct is the starting point of te whole product tree, and a generic result that can be passed on between processes.

In general a Product contains zero or more datasets, history, optional reference pointers and metadata some required metadata fields. A Product is expected to fully describe itself; this includes the way how this product was achieved (its history). As it is the result of a process, it should be able to save to and restore from an Archive device.

Many times a Product may contain a single dataset and for this purpose the first dataset entry can be accessed by the getDefault() method. Note that the datasets may be a composite of datasets by themselves.

A built-in attributes in Model[‘metadata’] (“MetaData Parameter” or MDP) can be accessed with e.g. p.creator, or p.meta[‘creator’].value:

p.creator='foo'
assert p.creatur=='foo'
assert p.meta['creator']=='foo'
p.meta['creator']=Parameter('bar')
assert p.meta['creator']==Parameter('bar')

BaseProduct class schema 1.6 inheriting [None].

Automatically generated from fdi/dataset/resources/BaseProduct.yml on 2022-10-14 23:26:41.001193.

Description: FDI base class data model

property FORMATV
accept(visitor)[source]

Hook for adding functionality to meta data object through visitor pattern.

property creationDate
property creator
property description
property history

xx must be a property for self.xx = yy to work in super class after xx is set as a property also by a subclass.

property level
property rootCause
string(level=0, tablefmt='grid', tablefmt1='rst', tablefmt2='psql', extra=False, param_widths=None, matprint=None, trans=True, beforedata='', **kwds)

like AbstractComposite but with history.

targetChanged(event)[source]

Informs that an event has happened in a target of any type. Paremeters ———-

toString(level=0, tablefmt='grid', tablefmt1='rst', tablefmt2='psql', extra=False, param_widths=None, matprint=None, trans=True, beforedata='', **kwds)[source]

like AbstractComposite but with history.

txt(level=0, tablefmt='grid', tablefmt1='rst', tablefmt2='psql', extra=False, param_widths=None, matprint=None, trans=True, beforedata='', **kwds)

like AbstractComposite but with history.

property type
property version

fdi.dataset.browseproduct module

class fdi.dataset.browseproduct.BrowseProduct(description='UNKNOWN', typ_='BrowseProduct', level='ALL', creator='UNKNOWN', creationDate=FineTime(1958-01-01T00:00:00.000000), rootCause='UNKNOWN', version='0.8', FORMATV='1.6.0.1', zInfo=None, **kwds)[source]

Bases: BaseProduct

BrowseProduct class schema 1.6 inheriting [‘BaseProduct’].

Automatically generated from fdi/dataset/resources/BrowseProduct.yml on 2022-10-14 23:26:41.090072.

Description: Container of media data for browsing.

Generally a Product (inheriting BaseProduct) has project-wide attributes and can be extended to define a plethora of specialized products.

Initializes instances with more metadata as attributes, set to default values.

Put description keyword argument here to allow e.g. BaseProduct(“foo”) and description=’foo’

__init__(description='UNKNOWN', typ_='BrowseProduct', level='ALL', creator='UNKNOWN', creationDate=FineTime(1958-01-01T00:00:00.000000), rootCause='UNKNOWN', version='0.8', FORMATV='1.6.0.1', zInfo=None, **kwds)[source]

Initializes instances with more metadata as attributes, set to default values.

Put description keyword argument here to allow e.g. BaseProduct(“foo”) and description=’foo’

fdi.dataset.classes module

fdi.dataset.classes.All_Exceptions = {'ArithmeticError': <class 'ArithmeticError'>, 'AssertionError': <class 'AssertionError'>, 'AttributeError': <class 'AttributeError'>, 'BlockingIOError': <class 'BlockingIOError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'BufferError': <class 'BufferError'>, 'BytesWarning': <class 'BytesWarning'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, 'ConnectionError': <class 'ConnectionError'>, 'ConnectionRefusedError': <class 'ConnectionRefusedError'>, 'ConnectionResetError': <class 'ConnectionResetError'>, 'DeprecationWarning': <class 'DeprecationWarning'>, 'EOFError': <class 'EOFError'>, 'EnvironmentError': <class 'OSError'>, 'Exception': <class 'Exception'>, 'FileExistsError': <class 'FileExistsError'>, 'FileNotFoundError': <class 'FileNotFoundError'>, 'FloatingPointError': <class 'FloatingPointError'>, 'FutureWarning': <class 'FutureWarning'>, 'IOError': <class 'OSError'>, 'ImportError': <class 'ImportError'>, 'ImportWarning': <class 'ImportWarning'>, 'IndentationError': <class 'IndentationError'>, 'IndexError': <class 'IndexError'>, 'InterruptedError': <class 'InterruptedError'>, 'IsADirectoryError': <class 'IsADirectoryError'>, 'KeyError': <class 'KeyError'>, 'LookupError': <class 'LookupError'>, 'MemoryError': <class 'MemoryError'>, 'ModuleNotFoundError': <class 'ModuleNotFoundError'>, 'NameError': <class 'NameError'>, 'NotADirectoryError': <class 'NotADirectoryError'>, 'NotImplementedError': <class 'NotImplementedError'>, 'OSError': <class 'OSError'>, 'OverflowError': <class 'OverflowError'>, 'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>, 'PermissionError': <class 'PermissionError'>, 'ProcessLookupError': <class 'ProcessLookupError'>, 'RecursionError': <class 'RecursionError'>, 'ReferenceError': <class 'ReferenceError'>, 'ResourceWarning': <class 'ResourceWarning'>, 'RuntimeError': <class 'RuntimeError'>, 'RuntimeWarning': <class 'RuntimeWarning'>, 'StopAsyncIteration': <class 'StopAsyncIteration'>, 'StopIteration': <class 'StopIteration'>, 'SyntaxError': <class 'SyntaxError'>, 'SyntaxWarning': <class 'SyntaxWarning'>, 'SystemError': <class 'SystemError'>, 'TabError': <class 'TabError'>, 'TimeoutError': <class 'TimeoutError'>, 'TypeError': <class 'TypeError'>, 'UnboundLocalError': <class 'UnboundLocalError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'UnicodeEncodeError': <class 'UnicodeEncodeError'>, 'UnicodeError': <class 'UnicodeError'>, 'UnicodeTranslateError': <class 'UnicodeTranslateError'>, 'UnicodeWarning': <class 'UnicodeWarning'>, 'UserWarning': <class 'UserWarning'>, 'ValueError': <class 'ValueError'>, 'Warning': <class 'Warning'>, 'ZeroDivisionError': <class 'ZeroDivisionError'>}

A name-class dict of all Exceptions.

fdi.dataset.classes.All_Globals_Builtins = ChainMap({'__name__': 'fdi.dataset.classes', '__doc__': None, '__package__': 'fdi.dataset', '__loader__': <_frozen_importlib_external.SourceFileLoader object>, '__spec__': ModuleSpec(name='fdi.dataset.classes', loader=<_frozen_importlib_external.SourceFileLoader object>, origin='/home/docs/checkouts/readthedocs.org/user_builds/fdi/envs/latest/lib/python3.8/site-packages/fdi/dataset/classes.py'), '__file__': '/home/docs/checkouts/readthedocs.org/user_builds/fdi/envs/latest/lib/python3.8/site-packages/fdi/dataset/classes.py', '__cached__': '/home/docs/checkouts/readthedocs.org/user_builds/fdi/envs/latest/lib/python3.8/site-packages/fdi/dataset/__pycache__/classes.cpython-38.pyc', '__builtins__': {'__name__': 'builtins', '__doc__': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", '__package__': '', '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__spec__': ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>), '__build_class__': <built-in function __build_class__>, '__import__': <built-in function __import__>, 'abs': <built-in function abs>, 'all': <built-in function all>, 'any': <built-in function any>, 'ascii': <built-in function ascii>, 'bin': <built-in function bin>, 'breakpoint': <built-in function breakpoint>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'compile': <built-in function compile>, 'delattr': <built-in function delattr>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'eval': <built-in function eval>, 'exec': <built-in function exec>, 'format': <built-in function format>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <built-in function input>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'len': <built-in function len>, 'locals': <built-in function locals>, 'max': <built-in function max>, 'min': <built-in function min>, 'next': <built-in function next>, 'oct': <built-in function oct>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'print': <built-in function print>, 'repr': <built-in function repr>, 'round': <built-in function round>, 'setattr': <built-in function setattr>, 'sorted': <built-in function sorted>, 'sum': <built-in function sum>, 'vars': <built-in function vars>, 'None': None, 'Ellipsis': Ellipsis, 'NotImplemented': NotImplemented, 'False': False, 'True': True, 'bool': <class 'bool'>, 'memoryview': <class 'memoryview'>, 'bytearray': <class 'bytearray'>, 'bytes': <class 'bytes'>, 'classmethod': <class 'classmethod'>, 'complex': <class 'complex'>, 'dict': <class 'dict'>, 'enumerate': <class 'enumerate'>, 'filter': <class 'filter'>, 'float': <class 'float'>, 'frozenset': <class 'frozenset'>, 'property': <class 'property'>, 'int': <class 'int'>, 'list': <class 'list'>, 'map': <class 'map'>, 'object': <class 'object'>, 'range': <class 'range'>, 'reversed': <class 'reversed'>, 'set': <class 'set'>, 'slice': <class 'slice'>, 'staticmethod': <class 'staticmethod'>, 'str': <class 'str'>, 'super': <class 'super'>, 'tuple': <class 'tuple'>, 'type': <class 'type'>, 'zip': <class 'zip'>, '__debug__': True, 'BaseException': <class 'BaseException'>, 'Exception': <class 'Exception'>, 'TypeError': <class 'TypeError'>, 'StopAsyncIteration': <class 'StopAsyncIteration'>, 'StopIteration': <class 'StopIteration'>, 'GeneratorExit': <class 'GeneratorExit'>, 'SystemExit': <class 'SystemExit'>, 'KeyboardInterrupt': <class 'KeyboardInterrupt'>, 'ImportError': <class 'ImportError'>, 'ModuleNotFoundError': <class 'ModuleNotFoundError'>, 'OSError': <class 'OSError'>, 'EnvironmentError': <class 'OSError'>, 'IOError': <class 'OSError'>, 'EOFError': <class 'EOFError'>, 'RuntimeError': <class 'RuntimeError'>, 'RecursionError': <class 'RecursionError'>, 'NotImplementedError': <class 'NotImplementedError'>, 'NameError': <class 'NameError'>, 'UnboundLocalError': <class 'UnboundLocalError'>, 'AttributeError': <class 'AttributeError'>, 'SyntaxError': <class 'SyntaxError'>, 'IndentationError': <class 'IndentationError'>, 'TabError': <class 'TabError'>, 'LookupError': <class 'LookupError'>, 'IndexError': <class 'IndexError'>, 'KeyError': <class 'KeyError'>, 'ValueError': <class 'ValueError'>, 'UnicodeError': <class 'UnicodeError'>, 'UnicodeEncodeError': <class 'UnicodeEncodeError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'UnicodeTranslateError': <class 'UnicodeTranslateError'>, 'AssertionError': <class 'AssertionError'>, 'ArithmeticError': <class 'ArithmeticError'>, 'FloatingPointError': <class 'FloatingPointError'>, 'OverflowError': <class 'OverflowError'>, 'ZeroDivisionError': <class 'ZeroDivisionError'>, 'SystemError': <class 'SystemError'>, 'ReferenceError': <class 'ReferenceError'>, 'MemoryError': <class 'MemoryError'>, 'BufferError': <class 'BufferError'>, 'Warning': <class 'Warning'>, 'UserWarning': <class 'UserWarning'>, 'DeprecationWarning': <class 'DeprecationWarning'>, 'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>, 'SyntaxWarning': <class 'SyntaxWarning'>, 'RuntimeWarning': <class 'RuntimeWarning'>, 'FutureWarning': <class 'FutureWarning'>, 'ImportWarning': <class 'ImportWarning'>, 'UnicodeWarning': <class 'UnicodeWarning'>, 'BytesWarning': <class 'BytesWarning'>, 'ResourceWarning': <class 'ResourceWarning'>, 'ConnectionError': <class 'ConnectionError'>, 'BlockingIOError': <class 'BlockingIOError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, 'ConnectionRefusedError': <class 'ConnectionRefusedError'>, 'ConnectionResetError': <class 'ConnectionResetError'>, 'FileExistsError': <class 'FileExistsError'>, 'FileNotFoundError': <class 'FileNotFoundError'>, 'IsADirectoryError': <class 'IsADirectoryError'>, 'NotADirectoryError': <class 'NotADirectoryError'>, 'InterruptedError': <class 'InterruptedError'>, 'PermissionError': <class 'PermissionError'>, 'ProcessLookupError': <class 'ProcessLookupError'>, 'TimeoutError': <class 'TimeoutError'>, 'open': <built-in function open>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'copyright': Copyright (c) 2001-2020 Python Software Foundation. All Rights Reserved.  Copyright (c) 2000 BeOpen.com. All Rights Reserved.  Copyright (c) 1995-2001 Corporation for National Research Initiatives. All Rights Reserved.  Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved., 'credits':     Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands     for supporting Python development.  See www.python.org for more information., 'license': Type license() to see the full license text, 'help': Type help() for interactive help, or help(object) for help about object.}, 'trbk': <function trbk>, 'SelectiveMetaFinder': <class 'fdi.utils.moduleloader.SelectiveMetaFinder'>, 'installSelectiveMetaFinder': <function installSelectiveMetaFinder>, 'Load_Failed': <object object>, 'NameSpace_meta': <class 'fdi.dataset.namespace.NameSpace_meta'>, 'builtins': <module 'builtins' (built-in)>, 'ChainMap': <class 'collections.ChainMap'>, 'sys': <module 'sys' (built-in)>, 'logging': <module 'logging' from '/home/docs/.pyenv/versions/3.8.6/lib/python3.8/logging/__init__.py'>, 'copy': <module 'copy' from '/home/docs/checkouts/readthedocs.org/user_builds/fdi/envs/latest/lib/python3.8/copy.py'>, 'importlib': <module 'importlib' from '/home/docs/checkouts/readthedocs.org/user_builds/fdi/envs/latest/lib/python3.8/importlib/__init__.py'>, 'lru_cache': <function lru_cache>, 'PY3': True, 'logger': <Logger fdi.dataset.classes (WARNING)>, 'Modules_Classes': {'fdi.dataset.deserialize': ['deserialize'], 'fdi.dataset.listener': ['ListenerSet'], 'fdi.dataset.serializable': ['Serializable'], 'fdi.dataset.eq': ['DeepEqual'], 'fdi.dataset.odict': ['ODict'], 'fdi.dataset.finetime': ['FineTime', 'FineTime1', 'utcobj'], 'fdi.dataset.history': ['History'], 'fdi.dataset.baseproduct': ['BaseProduct'], 'fdi.dataset.product': ['Product'], 'fdi.dataset.browseproduct': ['BrowseProduct'], 'fdi.dataset.testproducts': ['TP', 'TP_0X', 'TB', 'TC', 'TCC', 'TM', 'SP', 'DemoProduct'], 'fdi.dataset.datatypes': ['Vector', 'Vector2D', 'Vector3D', 'Quaternion'], 'fdi.dataset.metadata': ['AbstractParameter', 'Parameter', 'MetaData'], 'fdi.dataset.numericparameter': ['NumericParameter', 'BooleanParameter'], 'fdi.dataset.dateparameter': ['DateParameter'], 'fdi.dataset.stringparameter': ['StringParameter'], 'fdi.dataset.arraydataset': ['ArrayDataset', 'Column'], 'fdi.dataset.mediawrapper': ['MediaWrapper'], 'fdi.dataset.dataset': ['GenericDataset', 'CompositeDataset'], 'fdi.dataset.tabledataset': ['TableDataset', 'IndexedTableDataset'], 'fdi.dataset.unstructureddataset': ['UnstructuredDataset'], 'fdi.dataset.readonlydict': ['ReadOnlyDict'], 'fdi.pal.context': ['AbstractContext', 'Context', 'MapContext', 'RefContainer', 'ContextRuleException'], 'fdi.pal.urn': ['Urn'], 'fdi.pal.productref': ['ProductRef'], 'fdi.pal.query': ['AbstractQuery', 'MetaQuery', 'StorageQuery']}, 'Class_Module_Map': {'deserialize': 'fdi.dataset.deserialize', 'ListenerSet': 'fdi.dataset.listener', 'Serializable': 'fdi.dataset.serializable', 'DeepEqual': 'fdi.dataset.eq', 'ODict': 'fdi.dataset.odict', 'FineTime': 'fdi.dataset.finetime', 'FineTime1': 'fdi.dataset.finetime', 'utcobj': 'fdi.dataset.finetime', 'History': 'fdi.dataset.history', 'BaseProduct': 'fdi.dataset.baseproduct', 'Product': 'fdi.dataset.product', 'BrowseProduct': 'fdi.dataset.browseproduct', 'TP': 'fdi.dataset.testproducts', 'TP_0X': 'fdi.dataset.testproducts', 'TB': 'fdi.dataset.testproducts', 'TC': 'fdi.dataset.testproducts', 'TCC': 'fdi.dataset.testproducts', 'TM': 'fdi.dataset.testproducts', 'SP': 'fdi.dataset.testproducts', 'DemoProduct': 'fdi.dataset.testproducts', 'Vector': 'fdi.dataset.datatypes', 'Vector2D': 'fdi.dataset.datatypes', 'Vector3D': 'fdi.dataset.datatypes', 'Quaternion': 'fdi.dataset.datatypes', 'AbstractParameter': 'fdi.dataset.metadata', 'Parameter': 'fdi.dataset.metadata', 'MetaData': 'fdi.dataset.metadata', 'NumericParameter': 'fdi.dataset.numericparameter', 'BooleanParameter': 'fdi.dataset.numericparameter', 'DateParameter': 'fdi.dataset.dateparameter', 'StringParameter': 'fdi.dataset.stringparameter', 'ArrayDataset': 'fdi.dataset.arraydataset', 'Column': 'fdi.dataset.arraydataset', 'MediaWrapper': 'fdi.dataset.mediawrapper', 'GenericDataset': 'fdi.dataset.dataset', 'CompositeDataset': 'fdi.dataset.dataset', 'TableDataset': 'fdi.dataset.tabledataset', 'IndexedTableDataset': 'fdi.dataset.tabledataset', 'UnstructuredDataset': 'fdi.dataset.unstructureddataset', 'ReadOnlyDict': 'fdi.dataset.readonlydict', 'AbstractContext': 'fdi.pal.context', 'Context': 'fdi.pal.context', 'MapContext': 'fdi.pal.context', 'RefContainer': 'fdi.pal.context', 'ContextRuleException': 'fdi.pal.context', 'Urn': 'fdi.pal.urn', 'ProductRef': 'fdi.pal.productref', 'AbstractQuery': 'fdi.pal.query', 'MetaQuery': 'fdi.pal.query', 'StorageQuery': 'fdi.pal.query'}, 'importModuleClasses': <function importModuleClasses>, 'load': <function load>, '_bltn': {'abs': <built-in function abs>, 'all': <built-in function all>, 'any': <built-in function any>, 'ascii': <built-in function ascii>, 'bin': <built-in function bin>, 'breakpoint': <built-in function breakpoint>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'compile': <built-in function compile>, 'delattr': <built-in function delattr>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'eval': <built-in function eval>, 'exec': <built-in function exec>, 'format': <built-in function format>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <built-in function input>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'len': <built-in function len>, 'locals': <built-in function locals>, 'max': <built-in function max>, 'min': <built-in function min>, 'next': <built-in function next>, 'oct': <built-in function oct>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'print': <built-in function print>, 'repr': <built-in function repr>, 'round': <built-in function round>, 'setattr': <built-in function setattr>, 'sorted': <built-in function sorted>, 'sum': <built-in function sum>, 'vars': <built-in function vars>, 'None': None, 'Ellipsis': Ellipsis, 'NotImplemented': NotImplemented, 'False': False, 'True': True, 'bool': <class 'bool'>, 'memoryview': <class 'memoryview'>, 'bytearray': <class 'bytearray'>, 'bytes': <class 'bytes'>, 'classmethod': <class 'classmethod'>, 'complex': <class 'complex'>, 'dict': <class 'dict'>, 'enumerate': <class 'enumerate'>, 'filter': <class 'filter'>, 'float': <class 'float'>, 'frozenset': <class 'frozenset'>, 'property': <class 'property'>, 'int': <class 'int'>, 'list': <class 'list'>, 'map': <class 'map'>, 'object': <class 'object'>, 'range': <class 'range'>, 'reversed': <class 'reversed'>, 'set': <class 'set'>, 'slice': <class 'slice'>, 'staticmethod': <class 'staticmethod'>, 'str': <class 'str'>, 'super': <class 'super'>, 'tuple': <class 'tuple'>, 'type': <class 'type'>, 'zip': <class 'zip'>, 'BaseException': <class 'BaseException'>, 'Exception': <class 'Exception'>, 'TypeError': <class 'TypeError'>, 'StopAsyncIteration': <class 'StopAsyncIteration'>, 'StopIteration': <class 'StopIteration'>, 'GeneratorExit': <class 'GeneratorExit'>, 'SystemExit': <class 'SystemExit'>, 'KeyboardInterrupt': <class 'KeyboardInterrupt'>, 'ImportError': <class 'ImportError'>, 'ModuleNotFoundError': <class 'ModuleNotFoundError'>, 'OSError': <class 'OSError'>, 'EnvironmentError': <class 'OSError'>, 'IOError': <class 'OSError'>, 'EOFError': <class 'EOFError'>, 'RuntimeError': <class 'RuntimeError'>, 'RecursionError': <class 'RecursionError'>, 'NotImplementedError': <class 'NotImplementedError'>, 'NameError': <class 'NameError'>, 'UnboundLocalError': <class 'UnboundLocalError'>, 'AttributeError': <class 'AttributeError'>, 'SyntaxError': <class 'SyntaxError'>, 'IndentationError': <class 'IndentationError'>, 'TabError': <class 'TabError'>, 'LookupError': <class 'LookupError'>, 'IndexError': <class 'IndexError'>, 'KeyError': <class 'KeyError'>, 'ValueError': <class 'ValueError'>, 'UnicodeError': <class 'UnicodeError'>, 'UnicodeEncodeError': <class 'UnicodeEncodeError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'UnicodeTranslateError': <class 'UnicodeTranslateError'>, 'AssertionError': <class 'AssertionError'>, 'ArithmeticError': <class 'ArithmeticError'>, 'FloatingPointError': <class 'FloatingPointError'>, 'OverflowError': <class 'OverflowError'>, 'ZeroDivisionError': <class 'ZeroDivisionError'>, 'SystemError': <class 'SystemError'>, 'ReferenceError': <class 'ReferenceError'>, 'MemoryError': <class 'MemoryError'>, 'BufferError': <class 'BufferError'>, 'Warning': <class 'Warning'>, 'UserWarning': <class 'UserWarning'>, 'DeprecationWarning': <class 'DeprecationWarning'>, 'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>, 'SyntaxWarning': <class 'SyntaxWarning'>, 'RuntimeWarning': <class 'RuntimeWarning'>, 'FutureWarning': <class 'FutureWarning'>, 'ImportWarning': <class 'ImportWarning'>, 'UnicodeWarning': <class 'UnicodeWarning'>, 'BytesWarning': <class 'BytesWarning'>, 'ResourceWarning': <class 'ResourceWarning'>, 'ConnectionError': <class 'ConnectionError'>, 'BlockingIOError': <class 'BlockingIOError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, 'ConnectionRefusedError': <class 'ConnectionRefusedError'>, 'ConnectionResetError': <class 'ConnectionResetError'>, 'FileExistsError': <class 'FileExistsError'>, 'FileNotFoundError': <class 'FileNotFoundError'>, 'IsADirectoryError': <class 'IsADirectoryError'>, 'NotADirectoryError': <class 'NotADirectoryError'>, 'InterruptedError': <class 'InterruptedError'>, 'PermissionError': <class 'PermissionError'>, 'ProcessLookupError': <class 'ProcessLookupError'>, 'TimeoutError': <class 'TimeoutError'>, 'open': <built-in function open>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'copyright': Copyright (c) 2001-2020 Python Software Foundation. All Rights Reserved.  Copyright (c) 2000 BeOpen.com. All Rights Reserved.  Copyright (c) 1995-2001 Corporation for National Research Initiatives. All Rights Reserved.  Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved., 'credits':     Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands     for supporting Python development.  See www.python.org for more information., 'license': Type license() to see the full license text, 'help': Type help() for interactive help, or help(object) for help about object.}}, {'abs': <built-in function abs>, 'all': <built-in function all>, 'any': <built-in function any>, 'ascii': <built-in function ascii>, 'bin': <built-in function bin>, 'breakpoint': <built-in function breakpoint>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'compile': <built-in function compile>, 'delattr': <built-in function delattr>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'eval': <built-in function eval>, 'exec': <built-in function exec>, 'format': <built-in function format>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <built-in function input>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'len': <built-in function len>, 'locals': <built-in function locals>, 'max': <built-in function max>, 'min': <built-in function min>, 'next': <built-in function next>, 'oct': <built-in function oct>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'print': <built-in function print>, 'repr': <built-in function repr>, 'round': <built-in function round>, 'setattr': <built-in function setattr>, 'sorted': <built-in function sorted>, 'sum': <built-in function sum>, 'vars': <built-in function vars>, 'None': None, 'Ellipsis': Ellipsis, 'NotImplemented': NotImplemented, 'False': False, 'True': True, 'bool': <class 'bool'>, 'memoryview': <class 'memoryview'>, 'bytearray': <class 'bytearray'>, 'bytes': <class 'bytes'>, 'classmethod': <class 'classmethod'>, 'complex': <class 'complex'>, 'dict': <class 'dict'>, 'enumerate': <class 'enumerate'>, 'filter': <class 'filter'>, 'float': <class 'float'>, 'frozenset': <class 'frozenset'>, 'property': <class 'property'>, 'int': <class 'int'>, 'list': <class 'list'>, 'map': <class 'map'>, 'object': <class 'object'>, 'range': <class 'range'>, 'reversed': <class 'reversed'>, 'set': <class 'set'>, 'slice': <class 'slice'>, 'staticmethod': <class 'staticmethod'>, 'str': <class 'str'>, 'super': <class 'super'>, 'tuple': <class 'tuple'>, 'type': <class 'type'>, 'zip': <class 'zip'>, 'BaseException': <class 'BaseException'>, 'Exception': <class 'Exception'>, 'TypeError': <class 'TypeError'>, 'StopAsyncIteration': <class 'StopAsyncIteration'>, 'StopIteration': <class 'StopIteration'>, 'GeneratorExit': <class 'GeneratorExit'>, 'SystemExit': <class 'SystemExit'>, 'KeyboardInterrupt': <class 'KeyboardInterrupt'>, 'ImportError': <class 'ImportError'>, 'ModuleNotFoundError': <class 'ModuleNotFoundError'>, 'OSError': <class 'OSError'>, 'EnvironmentError': <class 'OSError'>, 'IOError': <class 'OSError'>, 'EOFError': <class 'EOFError'>, 'RuntimeError': <class 'RuntimeError'>, 'RecursionError': <class 'RecursionError'>, 'NotImplementedError': <class 'NotImplementedError'>, 'NameError': <class 'NameError'>, 'UnboundLocalError': <class 'UnboundLocalError'>, 'AttributeError': <class 'AttributeError'>, 'SyntaxError': <class 'SyntaxError'>, 'IndentationError': <class 'IndentationError'>, 'TabError': <class 'TabError'>, 'LookupError': <class 'LookupError'>, 'IndexError': <class 'IndexError'>, 'KeyError': <class 'KeyError'>, 'ValueError': <class 'ValueError'>, 'UnicodeError': <class 'UnicodeError'>, 'UnicodeEncodeError': <class 'UnicodeEncodeError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'UnicodeTranslateError': <class 'UnicodeTranslateError'>, 'AssertionError': <class 'AssertionError'>, 'ArithmeticError': <class 'ArithmeticError'>, 'FloatingPointError': <class 'FloatingPointError'>, 'OverflowError': <class 'OverflowError'>, 'ZeroDivisionError': <class 'ZeroDivisionError'>, 'SystemError': <class 'SystemError'>, 'ReferenceError': <class 'ReferenceError'>, 'MemoryError': <class 'MemoryError'>, 'BufferError': <class 'BufferError'>, 'Warning': <class 'Warning'>, 'UserWarning': <class 'UserWarning'>, 'DeprecationWarning': <class 'DeprecationWarning'>, 'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>, 'SyntaxWarning': <class 'SyntaxWarning'>, 'RuntimeWarning': <class 'RuntimeWarning'>, 'FutureWarning': <class 'FutureWarning'>, 'ImportWarning': <class 'ImportWarning'>, 'UnicodeWarning': <class 'UnicodeWarning'>, 'BytesWarning': <class 'BytesWarning'>, 'ResourceWarning': <class 'ResourceWarning'>, 'ConnectionError': <class 'ConnectionError'>, 'BlockingIOError': <class 'BlockingIOError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, 'ConnectionRefusedError': <class 'ConnectionRefusedError'>, 'ConnectionResetError': <class 'ConnectionResetError'>, 'FileExistsError': <class 'FileExistsError'>, 'FileNotFoundError': <class 'FileNotFoundError'>, 'IsADirectoryError': <class 'IsADirectoryError'>, 'NotADirectoryError': <class 'NotADirectoryError'>, 'InterruptedError': <class 'InterruptedError'>, 'PermissionError': <class 'PermissionError'>, 'ProcessLookupError': <class 'ProcessLookupError'>, 'TimeoutError': <class 'TimeoutError'>, 'open': <built-in function open>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'copyright': Copyright (c) 2001-2020 Python Software Foundation. All Rights Reserved.  Copyright (c) 2000 BeOpen.com. All Rights Reserved.  Copyright (c) 1995-2001 Corporation for National Research Initiatives. All Rights Reserved.  Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved., 'credits':     Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands     for supporting Python development.  See www.python.org for more information., 'license': Type license() to see the full license text, 'help': Type help() for interactive help, or help(object) for help about object.})

A name-class dict of all global and builtins.

class fdi.dataset.classes.Classes[source]

Bases: object

A dictionary of class names and their class objects that are allowed to be deserialized.

An fdi package built-in dictionary is loaded from the module Class_Module_Map. Users who need add more deserializable class can for example:

mapping = Lazy_Loading_ChainMap({}, {'deserialize': 'fdi.dataset.deserialize', 'ListenerSet': 'fdi.dataset.listener', 'Serializable': 'fdi.dataset.serializable', 'DeepEqual': 'fdi.dataset.eq', 'ODict': 'fdi.dataset.odict', 'FineTime': 'fdi.dataset.finetime', 'FineTime1': 'fdi.dataset.finetime', 'utcobj': 'fdi.dataset.finetime', 'History': 'fdi.dataset.history', 'BaseProduct': 'fdi.dataset.baseproduct', 'Product': 'fdi.dataset.product', 'BrowseProduct': 'fdi.dataset.browseproduct', 'TP': 'fdi.dataset.testproducts', 'TP_0X': 'fdi.dataset.testproducts', 'TB': 'fdi.dataset.testproducts', 'TC': 'fdi.dataset.testproducts', 'TCC': 'fdi.dataset.testproducts', 'TM': 'fdi.dataset.testproducts', 'SP': 'fdi.dataset.testproducts', 'DemoProduct': 'fdi.dataset.testproducts', 'Vector': 'fdi.dataset.datatypes', 'Vector2D': 'fdi.dataset.datatypes', 'Vector3D': 'fdi.dataset.datatypes', 'Quaternion': 'fdi.dataset.datatypes', 'AbstractParameter': 'fdi.dataset.metadata', 'Parameter': 'fdi.dataset.metadata', 'MetaData': 'fdi.dataset.metadata', 'NumericParameter': 'fdi.dataset.numericparameter', 'BooleanParameter': 'fdi.dataset.numericparameter', 'DateParameter': 'fdi.dataset.dateparameter', 'StringParameter': 'fdi.dataset.stringparameter', 'ArrayDataset': 'fdi.dataset.arraydataset', 'Column': 'fdi.dataset.arraydataset', 'MediaWrapper': 'fdi.dataset.mediawrapper', 'GenericDataset': 'fdi.dataset.dataset', 'CompositeDataset': 'fdi.dataset.dataset', 'TableDataset': 'fdi.dataset.tabledataset', 'IndexedTableDataset': 'fdi.dataset.tabledataset', 'UnstructuredDataset': 'fdi.dataset.unstructureddataset', 'ReadOnlyDict': 'fdi.dataset.readonlydict', 'AbstractContext': 'fdi.pal.context', 'Context': 'fdi.pal.context', 'MapContext': 'fdi.pal.context', 'RefContainer': 'fdi.pal.context', 'ContextRuleException': 'fdi.pal.context', 'Urn': 'fdi.pal.urn', 'ProductRef': 'fdi.pal.productref', 'AbstractQuery': 'fdi.pal.query', 'MetaQuery': 'fdi.pal.query', 'StorageQuery': 'fdi.pal.query'}, ChainMap({'__name__': 'fdi.dataset.classes', '__doc__': None, '__package__': 'fdi.dataset', '__loader__': <_frozen_importlib_external.SourceFileLoader object>, '__spec__': ModuleSpec(name='fdi.dataset.classes', loader=<_frozen_importlib_external.SourceFileLoader object>, origin='/home/docs/checkouts/readthedocs.org/user_builds/fdi/envs/latest/lib/python3.8/site-packages/fdi/dataset/classes.py'), '__file__': '/home/docs/checkouts/readthedocs.org/user_builds/fdi/envs/latest/lib/python3.8/site-packages/fdi/dataset/classes.py', '__cached__': '/home/docs/checkouts/readthedocs.org/user_builds/fdi/envs/latest/lib/python3.8/site-packages/fdi/dataset/__pycache__/classes.cpython-38.pyc', '__builtins__': {'__name__': 'builtins', '__doc__': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", '__package__': '', '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__spec__': ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>), '__build_class__': <built-in function __build_class__>, '__import__': <built-in function __import__>, 'abs': <built-in function abs>, 'all': <built-in function all>, 'any': <built-in function any>, 'ascii': <built-in function ascii>, 'bin': <built-in function bin>, 'breakpoint': <built-in function breakpoint>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'compile': <built-in function compile>, 'delattr': <built-in function delattr>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'eval': <built-in function eval>, 'exec': <built-in function exec>, 'format': <built-in function format>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <built-in function input>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'len': <built-in function len>, 'locals': <built-in function locals>, 'max': <built-in function max>, 'min': <built-in function min>, 'next': <built-in function next>, 'oct': <built-in function oct>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'print': <built-in function print>, 'repr': <built-in function repr>, 'round': <built-in function round>, 'setattr': <built-in function setattr>, 'sorted': <built-in function sorted>, 'sum': <built-in function sum>, 'vars': <built-in function vars>, 'None': None, 'Ellipsis': Ellipsis, 'NotImplemented': NotImplemented, 'False': False, 'True': True, 'bool': <class 'bool'>, 'memoryview': <class 'memoryview'>, 'bytearray': <class 'bytearray'>, 'bytes': <class 'bytes'>, 'classmethod': <class 'classmethod'>, 'complex': <class 'complex'>, 'dict': <class 'dict'>, 'enumerate': <class 'enumerate'>, 'filter': <class 'filter'>, 'float': <class 'float'>, 'frozenset': <class 'frozenset'>, 'property': <class 'property'>, 'int': <class 'int'>, 'list': <class 'list'>, 'map': <class 'map'>, 'object': <class 'object'>, 'range': <class 'range'>, 'reversed': <class 'reversed'>, 'set': <class 'set'>, 'slice': <class 'slice'>, 'staticmethod': <class 'staticmethod'>, 'str': <class 'str'>, 'super': <class 'super'>, 'tuple': <class 'tuple'>, 'type': <class 'type'>, 'zip': <class 'zip'>, '__debug__': True, 'BaseException': <class 'BaseException'>, 'Exception': <class 'Exception'>, 'TypeError': <class 'TypeError'>, 'StopAsyncIteration': <class 'StopAsyncIteration'>, 'StopIteration': <class 'StopIteration'>, 'GeneratorExit': <class 'GeneratorExit'>, 'SystemExit': <class 'SystemExit'>, 'KeyboardInterrupt': <class 'KeyboardInterrupt'>, 'ImportError': <class 'ImportError'>, 'ModuleNotFoundError': <class 'ModuleNotFoundError'>, 'OSError': <class 'OSError'>, 'EnvironmentError': <class 'OSError'>, 'IOError': <class 'OSError'>, 'EOFError': <class 'EOFError'>, 'RuntimeError': <class 'RuntimeError'>, 'RecursionError': <class 'RecursionError'>, 'NotImplementedError': <class 'NotImplementedError'>, 'NameError': <class 'NameError'>, 'UnboundLocalError': <class 'UnboundLocalError'>, 'AttributeError': <class 'AttributeError'>, 'SyntaxError': <class 'SyntaxError'>, 'IndentationError': <class 'IndentationError'>, 'TabError': <class 'TabError'>, 'LookupError': <class 'LookupError'>, 'IndexError': <class 'IndexError'>, 'KeyError': <class 'KeyError'>, 'ValueError': <class 'ValueError'>, 'UnicodeError': <class 'UnicodeError'>, 'UnicodeEncodeError': <class 'UnicodeEncodeError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'UnicodeTranslateError': <class 'UnicodeTranslateError'>, 'AssertionError': <class 'AssertionError'>, 'ArithmeticError': <class 'ArithmeticError'>, 'FloatingPointError': <class 'FloatingPointError'>, 'OverflowError': <class 'OverflowError'>, 'ZeroDivisionError': <class 'ZeroDivisionError'>, 'SystemError': <class 'SystemError'>, 'ReferenceError': <class 'ReferenceError'>, 'MemoryError': <class 'MemoryError'>, 'BufferError': <class 'BufferError'>, 'Warning': <class 'Warning'>, 'UserWarning': <class 'UserWarning'>, 'DeprecationWarning': <class 'DeprecationWarning'>, 'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>, 'SyntaxWarning': <class 'SyntaxWarning'>, 'RuntimeWarning': <class 'RuntimeWarning'>, 'FutureWarning': <class 'FutureWarning'>, 'ImportWarning': <class 'ImportWarning'>, 'UnicodeWarning': <class 'UnicodeWarning'>, 'BytesWarning': <class 'BytesWarning'>, 'ResourceWarning': <class 'ResourceWarning'>, 'ConnectionError': <class 'ConnectionError'>, 'BlockingIOError': <class 'BlockingIOError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, 'ConnectionRefusedError': <class 'ConnectionRefusedError'>, 'ConnectionResetError': <class 'ConnectionResetError'>, 'FileExistsError': <class 'FileExistsError'>, 'FileNotFoundError': <class 'FileNotFoundError'>, 'IsADirectoryError': <class 'IsADirectoryError'>, 'NotADirectoryError': <class 'NotADirectoryError'>, 'InterruptedError': <class 'InterruptedError'>, 'PermissionError': <class 'PermissionError'>, 'ProcessLookupError': <class 'ProcessLookupError'>, 'TimeoutError': <class 'TimeoutError'>, 'open': <built-in function open>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'copyright': Copyright (c) 2001-2020 Python Software Foundation. All Rights Reserved.  Copyright (c) 2000 BeOpen.com. All Rights Reserved.  Copyright (c) 1995-2001 Corporation for National Research Initiatives. All Rights Reserved.  Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved., 'credits':     Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands     for supporting Python development.  See www.python.org for more information., 'license': Type license() to see the full license text, 'help': Type help() for interactive help, or help(object) for help about object.}, 'trbk': <function trbk>, 'SelectiveMetaFinder': <class 'fdi.utils.moduleloader.SelectiveMetaFinder'>, 'installSelectiveMetaFinder': <function installSelectiveMetaFinder>, 'Load_Failed': <object object>, 'NameSpace_meta': <class 'fdi.dataset.namespace.NameSpace_meta'>, 'builtins': <module 'builtins' (built-in)>, 'ChainMap': <class 'collections.ChainMap'>, 'sys': <module 'sys' (built-in)>, 'logging': <module 'logging' from '/home/docs/.pyenv/versions/3.8.6/lib/python3.8/logging/__init__.py'>, 'copy': <module 'copy' from '/home/docs/checkouts/readthedocs.org/user_builds/fdi/envs/latest/lib/python3.8/copy.py'>, 'importlib': <module 'importlib' from '/home/docs/checkouts/readthedocs.org/user_builds/fdi/envs/latest/lib/python3.8/importlib/__init__.py'>, 'lru_cache': <function lru_cache>, 'PY3': True, 'logger': <Logger fdi.dataset.classes (WARNING)>, 'Modules_Classes': {'fdi.dataset.deserialize': ['deserialize'], 'fdi.dataset.listener': ['ListenerSet'], 'fdi.dataset.serializable': ['Serializable'], 'fdi.dataset.eq': ['DeepEqual'], 'fdi.dataset.odict': ['ODict'], 'fdi.dataset.finetime': ['FineTime', 'FineTime1', 'utcobj'], 'fdi.dataset.history': ['History'], 'fdi.dataset.baseproduct': ['BaseProduct'], 'fdi.dataset.product': ['Product'], 'fdi.dataset.browseproduct': ['BrowseProduct'], 'fdi.dataset.testproducts': ['TP', 'TP_0X', 'TB', 'TC', 'TCC', 'TM', 'SP', 'DemoProduct'], 'fdi.dataset.datatypes': ['Vector', 'Vector2D', 'Vector3D', 'Quaternion'], 'fdi.dataset.metadata': ['AbstractParameter', 'Parameter', 'MetaData'], 'fdi.dataset.numericparameter': ['NumericParameter', 'BooleanParameter'], 'fdi.dataset.dateparameter': ['DateParameter'], 'fdi.dataset.stringparameter': ['StringParameter'], 'fdi.dataset.arraydataset': ['ArrayDataset', 'Column'], 'fdi.dataset.mediawrapper': ['MediaWrapper'], 'fdi.dataset.dataset': ['GenericDataset', 'CompositeDataset'], 'fdi.dataset.tabledataset': ['TableDataset', 'IndexedTableDataset'], 'fdi.dataset.unstructureddataset': ['UnstructuredDataset'], 'fdi.dataset.readonlydict': ['ReadOnlyDict'], 'fdi.pal.context': ['AbstractContext', 'Context', 'MapContext', 'RefContainer', 'ContextRuleException'], 'fdi.pal.urn': ['Urn'], 'fdi.pal.productref': ['ProductRef'], 'fdi.pal.query': ['AbstractQuery', 'MetaQuery', 'StorageQuery']}, 'Class_Module_Map': {'deserialize': 'fdi.dataset.deserialize', 'ListenerSet': 'fdi.dataset.listener', 'Serializable': 'fdi.dataset.serializable', 'DeepEqual': 'fdi.dataset.eq', 'ODict': 'fdi.dataset.odict', 'FineTime': 'fdi.dataset.finetime', 'FineTime1': 'fdi.dataset.finetime', 'utcobj': 'fdi.dataset.finetime', 'History': 'fdi.dataset.history', 'BaseProduct': 'fdi.dataset.baseproduct', 'Product': 'fdi.dataset.product', 'BrowseProduct': 'fdi.dataset.browseproduct', 'TP': 'fdi.dataset.testproducts', 'TP_0X': 'fdi.dataset.testproducts', 'TB': 'fdi.dataset.testproducts', 'TC': 'fdi.dataset.testproducts', 'TCC': 'fdi.dataset.testproducts', 'TM': 'fdi.dataset.testproducts', 'SP': 'fdi.dataset.testproducts', 'DemoProduct': 'fdi.dataset.testproducts', 'Vector': 'fdi.dataset.datatypes', 'Vector2D': 'fdi.dataset.datatypes', 'Vector3D': 'fdi.dataset.datatypes', 'Quaternion': 'fdi.dataset.datatypes', 'AbstractParameter': 'fdi.dataset.metadata', 'Parameter': 'fdi.dataset.metadata', 'MetaData': 'fdi.dataset.metadata', 'NumericParameter': 'fdi.dataset.numericparameter', 'BooleanParameter': 'fdi.dataset.numericparameter', 'DateParameter': 'fdi.dataset.dateparameter', 'StringParameter': 'fdi.dataset.stringparameter', 'ArrayDataset': 'fdi.dataset.arraydataset', 'Column': 'fdi.dataset.arraydataset', 'MediaWrapper': 'fdi.dataset.mediawrapper', 'GenericDataset': 'fdi.dataset.dataset', 'CompositeDataset': 'fdi.dataset.dataset', 'TableDataset': 'fdi.dataset.tabledataset', 'IndexedTableDataset': 'fdi.dataset.tabledataset', 'UnstructuredDataset': 'fdi.dataset.unstructureddataset', 'ReadOnlyDict': 'fdi.dataset.readonlydict', 'AbstractContext': 'fdi.pal.context', 'Context': 'fdi.pal.context', 'MapContext': 'fdi.pal.context', 'RefContainer': 'fdi.pal.context', 'ContextRuleException': 'fdi.pal.context', 'Urn': 'fdi.pal.urn', 'ProductRef': 'fdi.pal.productref', 'AbstractQuery': 'fdi.pal.query', 'MetaQuery': 'fdi.pal.query', 'StorageQuery': 'fdi.pal.query'}, 'importModuleClasses': <function importModuleClasses>, 'load': <function load>, '_bltn': {'abs': <built-in function abs>, 'all': <built-in function all>, 'any': <built-in function any>, 'ascii': <built-in function ascii>, 'bin': <built-in function bin>, 'breakpoint': <built-in function breakpoint>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'compile': <built-in function compile>, 'delattr': <built-in function delattr>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'eval': <built-in function eval>, 'exec': <built-in function exec>, 'format': <built-in function format>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <built-in function input>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'len': <built-in function len>, 'locals': <built-in function locals>, 'max': <built-in function max>, 'min': <built-in function min>, 'next': <built-in function next>, 'oct': <built-in function oct>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'print': <built-in function print>, 'repr': <built-in function repr>, 'round': <built-in function round>, 'setattr': <built-in function setattr>, 'sorted': <built-in function sorted>, 'sum': <built-in function sum>, 'vars': <built-in function vars>, 'None': None, 'Ellipsis': Ellipsis, 'NotImplemented': NotImplemented, 'False': False, 'True': True, 'bool': <class 'bool'>, 'memoryview': <class 'memoryview'>, 'bytearray': <class 'bytearray'>, 'bytes': <class 'bytes'>, 'classmethod': <class 'classmethod'>, 'complex': <class 'complex'>, 'dict': <class 'dict'>, 'enumerate': <class 'enumerate'>, 'filter': <class 'filter'>, 'float': <class 'float'>, 'frozenset': <class 'frozenset'>, 'property': <class 'property'>, 'int': <class 'int'>, 'list': <class 'list'>, 'map': <class 'map'>, 'object': <class 'object'>, 'range': <class 'range'>, 'reversed': <class 'reversed'>, 'set': <class 'set'>, 'slice': <class 'slice'>, 'staticmethod': <class 'staticmethod'>, 'str': <class 'str'>, 'super': <class 'super'>, 'tuple': <class 'tuple'>, 'type': <class 'type'>, 'zip': <class 'zip'>, 'BaseException': <class 'BaseException'>, 'Exception': <class 'Exception'>, 'TypeError': <class 'TypeError'>, 'StopAsyncIteration': <class 'StopAsyncIteration'>, 'StopIteration': <class 'StopIteration'>, 'GeneratorExit': <class 'GeneratorExit'>, 'SystemExit': <class 'SystemExit'>, 'KeyboardInterrupt': <class 'KeyboardInterrupt'>, 'ImportError': <class 'ImportError'>, 'ModuleNotFoundError': <class 'ModuleNotFoundError'>, 'OSError': <class 'OSError'>, 'EnvironmentError': <class 'OSError'>, 'IOError': <class 'OSError'>, 'EOFError': <class 'EOFError'>, 'RuntimeError': <class 'RuntimeError'>, 'RecursionError': <class 'RecursionError'>, 'NotImplementedError': <class 'NotImplementedError'>, 'NameError': <class 'NameError'>, 'UnboundLocalError': <class 'UnboundLocalError'>, 'AttributeError': <class 'AttributeError'>, 'SyntaxError': <class 'SyntaxError'>, 'IndentationError': <class 'IndentationError'>, 'TabError': <class 'TabError'>, 'LookupError': <class 'LookupError'>, 'IndexError': <class 'IndexError'>, 'KeyError': <class 'KeyError'>, 'ValueError': <class 'ValueError'>, 'UnicodeError': <class 'UnicodeError'>, 'UnicodeEncodeError': <class 'UnicodeEncodeError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'UnicodeTranslateError': <class 'UnicodeTranslateError'>, 'AssertionError': <class 'AssertionError'>, 'ArithmeticError': <class 'ArithmeticError'>, 'FloatingPointError': <class 'FloatingPointError'>, 'OverflowError': <class 'OverflowError'>, 'ZeroDivisionError': <class 'ZeroDivisionError'>, 'SystemError': <class 'SystemError'>, 'ReferenceError': <class 'ReferenceError'>, 'MemoryError': <class 'MemoryError'>, 'BufferError': <class 'BufferError'>, 'Warning': <class 'Warning'>, 'UserWarning': <class 'UserWarning'>, 'DeprecationWarning': <class 'DeprecationWarning'>, 'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>, 'SyntaxWarning': <class 'SyntaxWarning'>, 'RuntimeWarning': <class 'RuntimeWarning'>, 'FutureWarning': <class 'FutureWarning'>, 'ImportWarning': <class 'ImportWarning'>, 'UnicodeWarning': <class 'UnicodeWarning'>, 'BytesWarning': <class 'BytesWarning'>, 'ResourceWarning': <class 'ResourceWarning'>, 'ConnectionError': <class 'ConnectionError'>, 'BlockingIOError': <class 'BlockingIOError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, 'ConnectionRefusedError': <class 'ConnectionRefusedError'>, 'ConnectionResetError': <class 'ConnectionResetError'>, 'FileExistsError': <class 'FileExistsError'>, 'FileNotFoundError': <class 'FileNotFoundError'>, 'IsADirectoryError': <class 'IsADirectoryError'>, 'NotADirectoryError': <class 'NotADirectoryError'>, 'InterruptedError': <class 'InterruptedError'>, 'PermissionError': <class 'PermissionError'>, 'ProcessLookupError': <class 'ProcessLookupError'>, 'TimeoutError': <class 'TimeoutError'>, 'open': <built-in function open>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'copyright': Copyright (c) 2001-2020 Python Software Foundation. All Rights Reserved.  Copyright (c) 2000 BeOpen.com. All Rights Reserved.  Copyright (c) 1995-2001 Corporation for National Research Initiatives. All Rights Reserved.  Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved., 'credits':     Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands     for supporting Python development.  See www.python.org for more information., 'license': Type license() to see the full license text, 'help': Type help() for interactive help, or help(object) for help about object.}}, {'abs': <built-in function abs>, 'all': <built-in function all>, 'any': <built-in function any>, 'ascii': <built-in function ascii>, 'bin': <built-in function bin>, 'breakpoint': <built-in function breakpoint>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'compile': <built-in function compile>, 'delattr': <built-in function delattr>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'eval': <built-in function eval>, 'exec': <built-in function exec>, 'format': <built-in function format>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <built-in function input>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'len': <built-in function len>, 'locals': <built-in function locals>, 'max': <built-in function max>, 'min': <built-in function min>, 'next': <built-in function next>, 'oct': <built-in function oct>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'print': <built-in function print>, 'repr': <built-in function repr>, 'round': <built-in function round>, 'setattr': <built-in function setattr>, 'sorted': <built-in function sorted>, 'sum': <built-in function sum>, 'vars': <built-in function vars>, 'None': None, 'Ellipsis': Ellipsis, 'NotImplemented': NotImplemented, 'False': False, 'True': True, 'bool': <class 'bool'>, 'memoryview': <class 'memoryview'>, 'bytearray': <class 'bytearray'>, 'bytes': <class 'bytes'>, 'classmethod': <class 'classmethod'>, 'complex': <class 'complex'>, 'dict': <class 'dict'>, 'enumerate': <class 'enumerate'>, 'filter': <class 'filter'>, 'float': <class 'float'>, 'frozenset': <class 'frozenset'>, 'property': <class 'property'>, 'int': <class 'int'>, 'list': <class 'list'>, 'map': <class 'map'>, 'object': <class 'object'>, 'range': <class 'range'>, 'reversed': <class 'reversed'>, 'set': <class 'set'>, 'slice': <class 'slice'>, 'staticmethod': <class 'staticmethod'>, 'str': <class 'str'>, 'super': <class 'super'>, 'tuple': <class 'tuple'>, 'type': <class 'type'>, 'zip': <class 'zip'>, 'BaseException': <class 'BaseException'>, 'Exception': <class 'Exception'>, 'TypeError': <class 'TypeError'>, 'StopAsyncIteration': <class 'StopAsyncIteration'>, 'StopIteration': <class 'StopIteration'>, 'GeneratorExit': <class 'GeneratorExit'>, 'SystemExit': <class 'SystemExit'>, 'KeyboardInterrupt': <class 'KeyboardInterrupt'>, 'ImportError': <class 'ImportError'>, 'ModuleNotFoundError': <class 'ModuleNotFoundError'>, 'OSError': <class 'OSError'>, 'EnvironmentError': <class 'OSError'>, 'IOError': <class 'OSError'>, 'EOFError': <class 'EOFError'>, 'RuntimeError': <class 'RuntimeError'>, 'RecursionError': <class 'RecursionError'>, 'NotImplementedError': <class 'NotImplementedError'>, 'NameError': <class 'NameError'>, 'UnboundLocalError': <class 'UnboundLocalError'>, 'AttributeError': <class 'AttributeError'>, 'SyntaxError': <class 'SyntaxError'>, 'IndentationError': <class 'IndentationError'>, 'TabError': <class 'TabError'>, 'LookupError': <class 'LookupError'>, 'IndexError': <class 'IndexError'>, 'KeyError': <class 'KeyError'>, 'ValueError': <class 'ValueError'>, 'UnicodeError': <class 'UnicodeError'>, 'UnicodeEncodeError': <class 'UnicodeEncodeError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'UnicodeTranslateError': <class 'UnicodeTranslateError'>, 'AssertionError': <class 'AssertionError'>, 'ArithmeticError': <class 'ArithmeticError'>, 'FloatingPointError': <class 'FloatingPointError'>, 'OverflowError': <class 'OverflowError'>, 'ZeroDivisionError': <class 'ZeroDivisionError'>, 'SystemError': <class 'SystemError'>, 'ReferenceError': <class 'ReferenceError'>, 'MemoryError': <class 'MemoryError'>, 'BufferError': <class 'BufferError'>, 'Warning': <class 'Warning'>, 'UserWarning': <class 'UserWarning'>, 'DeprecationWarning': <class 'DeprecationWarning'>, 'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>, 'SyntaxWarning': <class 'SyntaxWarning'>, 'RuntimeWarning': <class 'RuntimeWarning'>, 'FutureWarning': <class 'FutureWarning'>, 'ImportWarning': <class 'ImportWarning'>, 'UnicodeWarning': <class 'UnicodeWarning'>, 'BytesWarning': <class 'BytesWarning'>, 'ResourceWarning': <class 'ResourceWarning'>, 'ConnectionError': <class 'ConnectionError'>, 'BlockingIOError': <class 'BlockingIOError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, 'ConnectionRefusedError': <class 'ConnectionRefusedError'>, 'ConnectionResetError': <class 'ConnectionResetError'>, 'FileExistsError': <class 'FileExistsError'>, 'FileNotFoundError': <class 'FileNotFoundError'>, 'IsADirectoryError': <class 'IsADirectoryError'>, 'NotADirectoryError': <class 'NotADirectoryError'>, 'InterruptedError': <class 'InterruptedError'>, 'PermissionError': <class 'PermissionError'>, 'ProcessLookupError': <class 'ProcessLookupError'>, 'TimeoutError': <class 'TimeoutError'>, 'open': <built-in function open>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'copyright': Copyright (c) 2001-2020 Python Software Foundation. All Rights Reserved.  Copyright (c) 2000 BeOpen.com. All Rights Reserved.  Copyright (c) 1995-2001 Corporation for National Research Initiatives. All Rights Reserved.  Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved., 'credits':     Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands     for supporting Python development.  See www.python.org for more information., 'license': Type license() to see the full license text, 'help': Type help() for interactive help, or help(object) for help about object.}))
fdi.dataset.classes.importModuleClasses(scope=None, mapping=None, exclude=None, ignore_error=False, verbose=False)[source]

Return of a set of deserializable classes in initial map, which is maintained by hand.

Do nothing if the classes mapping is already made so repeated calls will not cost more time.

Parameters:
  • scope (NoneType, string, list) – if is a string, take as a class name; (not implemented: If is None, import all classes in initial map; if a list, a list of class names.)

  • mapping (mapping) – A mapping to get module names with class names. For a given key, if mapping returns a class object, the object will be the value returned for the key; if mapping returns a string, take it as a fully qualified module name and load its member classes; if is a list, take it as a list of module names.

  • exclude (list) – A list of class names (without ‘.’) that are not to be imported. Default is empty.

  • ignore_error (boolean) – Importing errors will be logged but otherwise ignored. Default is False.

Returns:

Key and load-result pairs. load-result is .namespace.Load_Failed if loading of the key was not successful.

Return type:

dict

fdi.dataset.classes.load(key, mapping, remove=True, exclude=None, ignore_error=False, verbose=False)[source]
fdi.dataset.classes.logger = <Logger fdi.dataset.classes (WARNING)>

this has to be in a different file where other interface classes are defined to avoid circular dependency (such as , Serializable.

Type:

Note

fdi.dataset.collectionsMockUp module

class fdi.dataset.collectionsMockUp.ContainerMockUp[source]

Bases: object

class fdi.dataset.collectionsMockUp.MappingMockUp[source]

Bases: object

class fdi.dataset.collectionsMockUp.SequenceMockUp[source]

Bases: object

fdi.dataset.composite module

class fdi.dataset.composite.Composite(data=None, **kwds)[source]

Bases: DataContainer, Serializable, MutableMapping

A container of named Datasets.

This container can hold zero or more datasets, each of them stored against a unique name. The order of adding datasets to this Composite is important, that is: the keySet() method will return a set of labels of the datasets in the sequence as they were added. Note that replacing a dataset with the same name, will keep the order.

DeepEqual must stay to the left of MutableMapping so its __eq__ will get to run. Serializable becomes a parent for having __setstate__.

Data:

default None will init with a dict.

__init__(data=None, **kwds)[source]
containsKey(name)[source]

Returns true if this map contains a mapping for the specified name.

get(name, default=Invalid)[source]

Returns the dataset to which this composite maps the specified name.

If the attrbute does not exist and default unspecified, raise a KeyError.

Parameters:

default: assigne to None or anything for missing name.

getDatasetNames()

Returns a list view of the keys contained in this composite.

getDefault()[source]

Convenience method that returns the first dataset belonging to this composite.

getSets()[source]

Provide access to the Map < String, Dataset > . mh: api from CompositeDataset

isEmpty()[source]

Returns true if this map contains no key - value mappings.

keySet()[source]

Returns a list view of the keys contained in this composite.

remove(name)[source]

Removes the mapping for this name from this composite. mh: returns None if name is None or item does not exist.

set(name, dataset)[source]

Associates the specified dataset with the specified key in this map(optional operation). If the map previously contained a mapping for this key, the old dataset is replaced by the specified dataset. this composite does not permit null or empty keys.

size()[source]

Returns the number of key - value mappings in this map.

string(level=0, matprint=None, trans=True, **kwds)
toString(level=0, matprint=None, trans=True, **kwds)[source]
txt(level=0, matprint=None, trans=True, **kwds)
class fdi.dataset.composite.UserDictAdapter(data=None, *args, **kwds)[source]

Bases: UserDict

Adapter class to make UserDict cooperative to multiple inheritance and take data keyword arg.

REf. https://rhettinger.wordpress.com/2011/05/26/super-considered-super/

Parameters:

data: initialize UserDict.

__init__(data=None, *args, **kwds)[source]
Parameters:

data: initialize UserDict.

fdi.dataset.copyable module

class fdi.dataset.copyable.Copyable(**kwds)[source]

Bases: object

Interface for objects that can make a copy of themselves.

__init__(**kwds)[source]
copy()[source]

Makes a deep copy of itself.

fdi.dataset.dataset module

class fdi.dataset.dataset.CompositeDataset(**kwds)[source]

Bases: MetaDataListener, AbstractComposite

An CompositeDataset is a Dataset that contains zero or more named Datasets. It allows to build arbitrary complex dataset structures.

It also defines the iteration ordering of its children, which is the order in which the children were inserted into this dataset.

Parameter

__init__(**kwds)[source]

Parameter

class fdi.dataset.dataset.Dataset(**kwds)[source]

Bases: Attributable, DataContainer, Serializable, MetaDataListener

Attributable and annotatable information data container that can be be part of a Product.

developer notes: The intent is that developers do not derive from this interface

directly. Instead, they should inherit from one of the generic datasets that this package provides:

mh: GenericDataset, UnstructuredDataset ArrayDataset. TableDataset or CompositeDataset.

Parameter

__init__(**kwds)[source]

Parameter

accept(visitor)[source]

Hook for adding functionality to object through visitor pattern. Parameter ———

string(level=0, tablefmt='grid', tablefmt1='simple', tablefmt2='psql', param_widths=None, width=0, matprint=None, trans=True, heavy=True, center=-1, **kwds)

matprint: an external matrix print function trans: print 2D matrix transposed. default is True. Parameter ———

toString(level=0, tablefmt='grid', tablefmt1='simple', tablefmt2='psql', param_widths=None, width=0, matprint=None, trans=True, heavy=True, center=-1, **kwds)[source]

matprint: an external matrix print function trans: print 2D matrix transposed. default is True. Parameter ———

txt(level=0, tablefmt='grid', tablefmt1='simple', tablefmt2='psql', param_widths=None, width=0, matprint=None, trans=True, heavy=True, center=-1, **kwds)

matprint: an external matrix print function trans: print 2D matrix transposed. default is True. Parameter ———

class fdi.dataset.dataset.GenericDataset(**kwds)[source]

Bases: Dataset, Typed, DataWrapper

mh: Contains one typed data item with a unit and a typecode.

__init__(**kwds)[source]
fdi.dataset.dataset.make_title_meta_l0(self, level=0, heavy=True, center=0, html=False, **kwds)[source]

make toString title and metadata.

Heavy:

use bold symbols for separaters.

Center:

0 for no centering; -1 for centering with metadata table; other for str.center(<center>.

fdi.dataset.datatypes module

fdi.dataset.datatypes.DataTypes = {'': 'None', 'array': 'array.array', 'baseProduct': 'BaseProduct', 'binary': 'int', 'boolean': 'bool', 'byte': 'int', 'complex': 'complex', 'finetime': 'FineTime', 'finetime1': 'FineTime1', 'float': 'float', 'hex': 'int', 'integer': 'int', 'list': 'list', 'mapContext': 'MapContext', 'product': 'Product', 'quaternion': 'Quaternion', 'short': 'int', 'string': 'str', 'tuple': 'tuple', 'vector': 'Vector', 'vector2d': 'Vector2D', 'vector3d': 'Vector3D'}

Allowed data (Parameter and Dataset) types and the corresponding classe names. The keys are mnemonics for humans; the values are type(x).__name__.

fdi.dataset.datatypes.ENDIAN = 'little'

Endianess of products generated.

class fdi.dataset.datatypes.Quaternion(components=None, **kwds)[source]

Bases: Vector

Quaternion with 4-component data.

invoked with no argument results in a vector of [0, 0, 0, 0] components

__init__(components=None, **kwds)[source]

invoked with no argument results in a vector of [0, 0, 0, 0] components

class fdi.dataset.datatypes.Vector(components=None, **kwds)[source]

Bases: Quantifiable, Serializable, DeepcmpEqual

N dimensional vector.

If description, type etc meta data is needed, use a Parameter.

A Vector can compare with a value whose type is in DataTypes, the quantity being used is the magnitude.

invoked with no argument results in a vector of [0, 0, 0] components.

__init__(components=None, **kwds)[source]

invoked with no argument results in a vector of [0, 0, 0] components.

property components

for property getter

getComponents()[source]

Returns the actual components that is allowed for the components of this vector.

setComponents(components)[source]

Replaces the current components of this vector.

string(level=0, **kwds)
toString(level=0, **kwds)[source]
txt(level=0, **kwds)
class fdi.dataset.datatypes.Vector2D(components=None, **kwds)[source]

Bases: Vector

Vector with 2-component data

invoked with no argument results in a vector of [0, 0] components

__init__(components=None, **kwds)[source]

invoked with no argument results in a vector of [0, 0] components

class fdi.dataset.datatypes.Vector3D(components=None, **kwds)[source]

Bases: Vector

Vector with 3-component data

invoked with no argument results in a vector of [0, 0, 0]] components

__init__(components=None, **kwds)[source]

invoked with no argument results in a vector of [0, 0, 0]] components

fdi.dataset.datatypes.cast(val, typ_, namespace=None)[source]

Casts the input value to type specified.

For example ‘binary’ type ‘0x9’ is casted to int 9.

Parameters:
  • val (multiple) – value to be casted.

  • typ_ (string) – “human name” of datatypes.DataTypeNames. e.g. integer, vector2d, ‘list’.

  • namespace (dict) – namespace to look up classes. default is Classes.mapping.

Returns:

Casted value.

Return type:

multiple

fdi.dataset.datatypes.get_typecodes()[source]
fdi.dataset.datatypes.numpytype_to_typecode(x)[source]

fdi.dataset.datawrapper module

class fdi.dataset.datawrapper.DataContainer(data=None, **kwds)[source]

Bases: Annotatable, Copyable, DeepcmpEqual, Container

A DataContainer is a composite of data and description.

mh: note that There is no metadata. Implemented partly from AbstractDataWrapper.

data: a Container. Default is None.

__init__(data=None, **kwds)[source]

data: a Container. Default is None.

property data
getData()[source]

Returns the data in this dw

Return type:

self._data or None if ‘._data’ is missing. e.g. subclass overriding setData calling getData from its setData that is called by ‘this.__init__’.

hasData()[source]

Returns whether this data wrapper has data.

Return type:

False if data does not exist or is None or empty, True if otherwise.

setData(data)[source]

Replaces the current DataData with specified argument. mh: subclasses can override this to add listener whenevery data is replaced.

class fdi.dataset.datawrapper.DataWrapper(*args, **kwds)[source]

Bases: DataContainer, Quantifiable

A DataWrapper is a composite of data, unit and description.

mh: note that all data are in the same unit. There is no metadata. Implemented from AbstractDataWrapper.

__init__(*args, **kwds)[source]
class fdi.dataset.datawrapper.DataWrapperMapper(*args, **kwds)[source]

Bases: object

Object holding a map of data wrappers.

__init__(*args, **kwds)[source]
getDataWrappers()[source]

Gives the data wrappers, mapped by name.

fdi.dataset.dateparameter module

class fdi.dataset.dateparameter.DateParameter(value=None, description='UNKNOWN', default=None, valid=None, typecode=None, **kwds)[source]

Bases: Parameter, Typecoded

has a FineTime as the value.

Set up a parameter whose value is a point in TAI time.

Value:

Typecode:

time format for the underlying FineTime object

__init__(value=None, description='UNKNOWN', default=None, valid=None, typecode=None, **kwds)[source]

Set up a parameter whose value is a point in TAI time.

Value:

Typecode:

time format for the underlying FineTime object

setDefault(default)[source]

accept any type that a FineTime does.

setValue(value)[source]

accept any type that a FineTime does, with current typecode overriding format of the underlying FineTime

class fdi.dataset.dateparameter.DateParameter1(value=None, description='UNKNOWN', default=None, valid=None, typecode=None, **kwds)[source]

Bases: DateParameter

Like DateParameter but usese FineTime1.

Set up a parameter whose value is a point in TAI time.

Value:

Typecode:

time format for the underlying FineTime object

setDefault(default)[source]

accept any type that a FineTime1 does.

setValue(value)[source]

accept any type that a FineTime1 does.

fdi.dataset.deserialize module

class fdi.dataset.deserialize.IntDecoder(*, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)[source]

Bases: JSONDecoder

adapted from https://stackoverflow.com/questions/45068797/how-to-convert-string-int-json-into-real-int-with-json-loads modified to also convert keys in dictionaries.

object_hook, if specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given dict. This can be used to provide custom deserializations (e.g. to support JSON-RPC class hinting).

object_pairs_hook, if specified will be called with the result of every JSON object decoded with an ordered list of pairs. The return value of object_pairs_hook will be used instead of the dict. This feature can be used to implement custom decoders. If object_hook is also defined, the object_pairs_hook takes priority.

parse_float, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal).

parse_int, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float).

parse_constant, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered.

If strict is false (true is the default), then control characters will be allowed inside strings. Control characters in this context are those with character codes in the 0-31 range, including '\t' (tab), '\n', '\r' and '\0'.

decode(s)[source]
class fdi.dataset.deserialize.IntDecoderOD(*, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)[source]

Bases: IntDecoder

object_hook, if specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given dict. This can be used to provide custom deserializations (e.g. to support JSON-RPC class hinting).

object_pairs_hook, if specified will be called with the result of every JSON object decoded with an ordered list of pairs. The return value of object_pairs_hook will be used instead of the dict. This feature can be used to implement custom decoders. If object_hook is also defined, the object_pairs_hook takes priority.

parse_float, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal).

parse_int, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float).

parse_constant, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered.

If strict is false (true is the default), then control characters will be allowed inside strings. Control characters in this context are those with character codes in the 0-31 range, including '\t' (tab), '\n', '\r' and '\0'.

fdi.dataset.deserialize.constructSerializable(obj, lookup=None, int_key=False, debug=False)[source]

mh: reconstruct object from the output of jason.loads(). Recursively goes into nested class instances that are not encoded by default by JSONEncoder, instantiate and fill in variables. Objects to be deserialized must have their classes loaded. _STID cannot have module names in it (e.g. dataset.Product) or locals()[classname] or globals()[classname] will not work.

Parameters:

useint: is a key in key-value pair has only digits characters the key will be substituted by int(key).

fdi.dataset.deserialize.decode_str(a0)[source]
fdi.dataset.deserialize.deserialize(js, lookup=None, debug=False, usedict=True, int_key=False, verbose=False)[source]

Create (Load) live object from string, bytes that are generated by serialization.

Parameters:
  • js (str, bytes.) – JSON string or bytes, made with json.load.

  • lookup (mapping) – A globals or locals -like mapping that gives class object if the class name is given.

  • debug (bool) – A if set True, print out step-by-step report of how a JSON document is deserialized into an object. Default False.

  • usedict (bool) – If is True dict insted of ODict will be used during deserialization. Default True.

  • init_key (bool) – If set, dictionary keys that are integers in string form, e.g. ‘1’, are casted to integers. Default False.

  • verbose (bool) – Give even more info.

Returns:

Deserialized object.

Return type:

object

fdi.dataset.deserialize.deserialize_args(all_args, not_quoted=False, first_string=True, serialize_out=False)[source]

parse the command path to get positional and keywords arguments.

  1. if not_quoted is True, split everythine to the left of first { with Serialize_Args_Sep append the part startin from the {. mark=’{’

  2. else after splitting all_args with Serialize_Args_Sep: mark=’%7B%22’ (quote(‘{‘))

Scan from left. if all_args[i] not start with mark

Conversion rules: |all_args[i]| converted to | | else | convert (case insensitive) and move on to the next segment | | string not starting with `'0x'` | quote |

  • else decode_str() if `not_quoted==False` else only substitute SAS_Avatar with Serialize_Args_Sep. Then deserialize() this segment to become `{'apiargs':list, 'foo':bar ...}`, append value of `apiargs` to the converted-list above, remove the `apiargs`-`val` pair.

  • return 200 as the reurn code followed by the converted-list and the deserialized `dict`.

All_args:

a list of path segments for the args list.

First_string:

Do not try to change the type of the first arg (assumed to be the function/method name).

fdi.dataset.deserialize.encode_str(a0)[source]

quote to remove general url offenders then use a mostly harmless str to substitute Serialize_Args_Sep.

fdi.dataset.deserialize.logger = <Logger fdi.dataset.deserialize (WARNING)>

this has to be in a different file where other interface classes are defined to avoid circular dependency (such as , Serializable.

Type:

Note

fdi.dataset.deserialize.serialize_args(*args, not_quoted=False, **kwds)[source]

Serialize all positional and keywords arguements as they would appear in a function call. Arguements are assumed to have been placed in the same order of a valid function/method call. They are scanned from left to right from args[i] i = 0, 1,… to kwds[j] j = 0, 1, …

  • Scan args from i=0. if is of args[i] is of bool, int, float types, convert with str, if str(), convert with encode_str(), if bytes or bytearray’ types, with ```0x```+`hex(), save to the convered-list, and move on to the next element.

  • else if finding a segment not of any of the above types,

** put this and the rest of `args` as the `value` in `{'apiargs':value}`, ** and append kwds key-val pairs after this pair, ** serialize the disctionary with serialize() and encode_str() ** append the result to the converted-list. ** break from the args scan loop. * if args scan loop reaches its end, if kwds is not empty, serialize it with serialize() and encode_str(), or scanning reaches the end of args. * append the result to the converted-list. * join the converted-list with Serialize_Args_Sep. * return the result string

fdi.dataset.eq module

exception fdi.dataset.eq.CircularCallError[source]

Bases: RuntimeError

fdi.dataset.eq.DeepEqual

alias of DeepcmpEqual

class fdi.dataset.eq.DeepcmpEqual(*args, **kwds)[source]

Bases: object

Equality tested by deepcmp.

Must pass args so DataWrapper in Composite can get data.

__init__(*args, **kwds)[source]

Must pass args so DataWrapper in Composite can get data.

equals(obj, **kwds)[source]

compares using deepcmp.

class fdi.dataset.eq.EqualDict(**kwds)[source]

Bases: object

mh: Can compare key-val pairs of another object with self.

False if compare with None or exceptions raised, e.g. obj that do not have items().

equals(obj, verbose=False)[source]

Paremeters

class fdi.dataset.eq.EqualODict(**kwds)[source]

Bases: object

mh: Can compare order and key-val pairs of another object with self. False if compare with None or exceptions raised, e.g. obj that do not have items()

equals(obj, verbose=False)[source]

Paremeters

class fdi.dataset.eq.StateEqual(*args, **kwds)[source]

Bases: object

Equality tested by hashed state.

Must pass args so DataWrapper in Composite can get data.

__init__(*args, **kwds)[source]

Must pass args so DataWrapper in Composite can get data.

equals(obj, **kwds)

compares hash.

hash(**kwds)[source]
fdi.dataset.eq.deepcmp(obj1, obj2, seenlist=None, verbose=False, eqcmp=False, brief=True)[source]

Recursively descends into obj1’s every component and compares with its counterpart in obj2.

Ways to test includes (in this order):

  • if they are the same object

  • type

  • `__eq__` or `__cmp__` if requested

  • state from `__getstate__()`

  • quick length

  • members if is `Mapping`, `Sequence` (

tuple, set, list, dict, OrderedDict, UserDict … ) * properties/attributes in `__dict__` * `__eq__` or `__cmp__` even if not requested

Detects cyclic references.

Returns:

  • None if finds no difference, `1` if brief is ```True`` else a string of explanation.

  • eqcmp: if True, use __eq__ or __cmp__ if the objs have them. If False only use as the last resort. default True.

fdi.dataset.eq.xhash(hash_list=None, seenlist=None, verbose=None)[source]

get the hash of a tuple of hashes of all members of given sequence.

Hash_list:

use instead of self.getstate__()

Verbose:

set to trace.

fdi.dataset.finetime module

class fdi.dataset.finetime.FineTime(date=None, format=None, **kwds)[source]

Bases: Copyable, DeepcmpEqual, Serializable

Atomic time (SI seconds) elapsed since the TAI epoch of 1 January 1958 UT2. The resolution is one microsecond and the allowable range is: epoch + /-290, 000 years approximately.

This has the following advantages, compared with the standard class:

  • It has better resolution(microseconds);

  • ime differences are correct across leap seconds

  • It is immutable unless its TAI is 0..

Initiate with a UTC date or an integer TAI.

date:

time to be set to. Acceptable types:

  • int for TAI,

  • float, double for UNIX time-stamp,

  • datetime.datetime,

  • string for ISO format date-time,

  • bytes-like classes that can get string by calling its decode(encoding=’utf-8’)

format:

ISO-8601 or some variation of it. Default is

DEFAULT_FORMAT and DEFAULT_FORMAT_SECOND.

DEFAULT_FORMAT = '%Y-%m-%dT%H:%M:%S.%f'
DEFAULT_FORMAT_SECOND = '%Y-%m-%dT%H:%M:%S'
EPOCH = datetime.datetime(1958, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)

number of TAI units in a second

RESOLUTION = 1000000

The earliest time when valid leapsecond is used.

RETURNFMT = '%s.%06d'
TIMESPEC = 'microseconds'
UTC_LOW_LIMIT = datetime.datetime(1972, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)
UTC_LOW_LIMIT_TIMESTAMP = 63072000.0

Format used when not specified.

__init__(date=None, format=None, **kwds)[source]

Initiate with a UTC date or an integer TAI.

date:

time to be set to. Acceptable types:

  • int for TAI,

  • float, double for UNIX time-stamp,

  • datetime.datetime,

  • string for ISO format date-time,

  • bytes-like classes that can get string by calling its decode(encoding=’utf-8’)

format:

ISO-8601 or some variation of it. Default is

DEFAULT_FORMAT and DEFAULT_FORMAT_SECOND.

classmethod datetimeToFineTime(dtm)[source]

DateTime to FineTime conversion.

Return given Python Datetime in FineTime to the precision of the input. Rounded to the last digit. Unit is decided by RESOLUTION.

Parameters:
  • cls (class)

  • dtm (DateTime) – Must be time-zone aware.

Returns:

converted.

Return type:

FineTime

getFormat()[source]

format cannot be a property name as it is a built so`@format.setter` is not allowed.

getTime()[source]

Returns the time related to this object.

isoutc(format='%Y-%m-%dT%H:%M:%S.%f')[source]

Returns a String representation of this objet in ISO format without timezone. sub-second set to TIMESPEC.

If tai is None return ‘’. ;format: time format. default ‘%Y-%m-%dT%H:%M:%S’ prints like 2019-02-17T12:43:04.577000

microsecondsSinceEPOCH()[source]

Return the rounded integer number of microseconds since the epoch: 1 Jan 1958.

setTime(time)[source]

Sets the time of this object.

If an integer is given, it will be taken as the TAI.

‘0’ and b’0’ are taken as TAI=0.

If a float is given, it will be taken as the time time stamp (UTC). If a datetime object or a string code is given, the timezone will be set to UTC. A FineTime instance is immutable except when TAI == 0. Violation gets a TypeError.

string(level=0, width=0, **kwds)

Returns a String representation of this object according to self.format. level: 0 prints like 2019-02-17T12:43:04.577000 TAI(…) width: if non-zero, insert newline to break simplified output into shorter lines. For level=0 it is ` #TODO `

subtract(time)[source]

Subract the specified time and return the difference in microseconds.

property time
toDate(tai=None)

Return given FineTime as a Python Datetime.

tai: if not given or given as None, return this object’s time as a Python Datetime.

toDatetime(tai=None)[source]

Return given FineTime as a Python Datetime.

tai: if not given or given as None, return this object’s time as a Python Datetime.

toString(level=0, width=0, **kwds)[source]

Returns a String representation of this object according to self.format. level: 0 prints like 2019-02-17T12:43:04.577000 TAI(…) width: if non-zero, insert newline to break simplified output into shorter lines. For level=0 it is ` #TODO `

txt(level=0, width=0, **kwds)

Returns a String representation of this object according to self.format. level: 0 prints like 2019-02-17T12:43:04.577000 TAI(…) width: if non-zero, insert newline to break simplified output into shorter lines. For level=0 it is ` #TODO `

class fdi.dataset.finetime.FineTime1(*args, **kwds)[source]

Bases: FineTime

Same as FineTime but Epoch is 2017-1-1 0 UTC and unit is millisecond

Initiate with a UTC date or an integer TAI.

date:

time to be set to. Acceptable types:

  • int for TAI,

  • float, double for UNIX time-stamp,

  • datetime.datetime,

  • string for ISO format date-time,

  • bytes-like classes that can get string by calling its decode(encoding=’utf-8’)

format:

ISO-8601 or some variation of it. Default is

DEFAULT_FORMAT and DEFAULT_FORMAT_SECOND.

EPOCH = datetime.datetime(2017, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)

number of TAI units in a second

RESOLUTION = 1000

The earliest time when valid leapsecond is used.

RETURNFMT = '%s.%03d'
TAI_AT_EPOCH = 1861920037000000
TIMESPEC = 'milliseconds'
classmethod datetimeToFineTime(dtm)[source]

DateTime to FineTime conversion.

Return given Python Datetime in FineTime to the precision of the input. Rounded to the last digit. Unit is decided by RESOLUTION.

Parameters:
  • cls (class)

  • dtm (DateTime) – Must be time-zone aware.

Returns:

converted.

Return type:

FineTime

toDatetime(tai=None)[source]

Return given FineTime as a Python Datetime.

tai: if not given or given as None, return this object’s time as a Python Datetime.

fdi.dataset.history module

class fdi.dataset.history.History(**kwds)[source]

Bases: TableDataset

Public interface to the history dataset. Contains the main methods for retrieving a script and copying the history.

Implemented as a TableDataset. Argument and context information are stored as metadata key-variable pairs in the metadata. Input data are in the table where name is the column name and references in the first cell of columns.

mh: The copy constructor is better not be implemented. Use copy() instead. Remember: not only copies the datasets, but also changes the history ID in the metadata and relevant table entries to indicate that this a new independent product of which the history may change.

__init__(**kwds)[source]

Implemented as a TableDataset. Argument and context information are stored as metadata key-variable pairs in the metadata. Input data are in the table where name is the column name and references in the first cell of columns.

mh: The copy constructor is better not be implemented. Use copy() instead. Remember: not only copies the datasets, but also changes the history ID in the metadata and relevant table entries to indicate that this a new independent product of which the history may change.

accept(visitor)[source]

Hook for adding functionality to meta data object through visitor pattern.

add_input(args=None, info=None, refs=None, **kwds)[source]

Add an entry to History records.

A general product history is made of a series of records, each added by a processing step, usually called a pipeline. The record can be added by this method to this History object..

Parameters:
  • args (dict) – A mapping of argument names and their values. Can be vars(ArgParse()). Values must be serializablee.

  • info (dict) – keywords and values in string.

  • refs (dict) – A mapping of name and reference string pairs. The Reference string is the URN, file name, OSS address, URL, or other kind of pointer. The name is for human to identify the data, the reference for recursive retrieving inputs to the data.

  • **kwds (dict) – appended to info by default.

Return type:

result

getScript()[source]

Creates a script from the history.

getTaskHistory(format='graph', node=None, use_name=True, verbose=False)[source]

Returns a human readable formatted history tree.

Parameters:
  • format (str) – Output format: graph’ (default) for `networkx.DiGraph; ‘ascii” for dump; ‘png’, ‘svg’, ‘jpg’ for graphic formats.

  • node (str) – A name that uniquely identifies the parent product.

Returns:

A graph of input data names and references.

Return type:

networkx.DiGraph

get_args_info()[source]

Get arguments and context information as a dictionary.

Return type:

dict

graph(format='png', **kwds)[source]

calling getTaskHistory with simplified parameters format, default to png.

xx__getstate__()[source]

Can be encoded with serializableEncoder

fdi.dataset.history.check_input(arg, serializable=True)[source]

Raise exception if needed when arg is not simple type or Serializable.

fdi.dataset.indexed module

class fdi.dataset.indexed.Indexed(indexPattern=None, **kwds)[source]

Bases: object

Abstract class with an index table for efficient records look-up.

indexPattern: specifies which columns to use to do look up.

__init__(indexPattern=None, **kwds)[source]

indexPattern: specifies which columns to use to do look up.

clearToc()[source]

Clears the index table of content.

getColumnsToLookup()[source]

returns an iterator that gives a number of sequences to looking up over.

Default is a tuple of the data attributes of every columns specified by indexPattern. To be overrided for different data model.

property indexPattern
property toc

returns the index table of content.

updateToc(which=None, for_records=None)[source]

Build index in format specified in indexPattern for retrieving record. which: an iterator that gives a number of sequences to looking up over. Default is getColumnsToLookup(). for_records: a list or a Slice of record (row) numbers. Those are changed records that caused updating. default is all records.

vLookUp(key, return_index=True, multiple=False)[source]

Similar to Excel VLOOKUP, return all records (rows) that match the key. key: taken as a dictionary key unless multiple is True. return_index: if True (default) return index in the array of columns. multiple: if True (default is False) loop through key as a sequence of keys and return a sequece.

fdi.dataset.invalid module

class fdi.dataset.invalid.InvalidType[source]

Bases: object

fdi.dataset.listener module

class fdi.dataset.listener.ColumnListener(**kwds)[source]

Bases: EventListener

Listener for events occuring in a Column.

Available types:

* DESCRIPTION_CHANGED
* UNIT_CHANGED
* DATA_CHANGED

Cause is always null.

__init__(**kwds)[source]
class fdi.dataset.listener.DatasetEvent(source, target, typ_, change, cause, rootCause, **kwds)[source]

Bases: Serializable

Paremeters

__init__(source, target, typ_, change, cause, rootCause, **kwds)[source]

Paremeters

string(level=0, **kwds)
toString(level=0, **kwds)[source]
txt(level=0, **kwds)
class fdi.dataset.listener.DatasetEventSender(**kwds)[source]

Bases: EventSender

Paremeters

__init__(**kwds)[source]

Paremeters

class fdi.dataset.listener.DatasetListener(**kwds)[source]

Bases: EventListener

Listener for events occuring in MetaData. Available types:

* DESCRIPTION_CHANGED, METADATA_CHANGED (all datasets)
* DATA_CHANGED, UNIT_CHANGED (ArrayDataset)
* COLUMN_ADDED, COLUMN_REMOVED, COLUMN_CHANGED, ROW_ADDED, VALUE_CHANGED (TableDataset)
* DATASET_ADDED, DATASET_REMOVED, DATASET_CHANGED (CompositeDataset)

Possible causes:

* not null (METADATA_CHANGED, COLUMN_CHANGED, DATASET_CHANGED)
* null (rest)

Warning: The listener handler must be a class attribute in order to create an object hard reference. See DatasetBaseListener.

__init__(**kwds)[source]
class fdi.dataset.listener.EventListener(*args, **kwds)[source]

Bases: Annotatable

Generic interface for listeners that will listen to anything

targetChanged(*args, **kwargs)[source]

Informs that an event has happened in a target of any type. Paremeters ———-

class fdi.dataset.listener.EventSender(**kwds)[source]

Bases: object

adapted from Peter Thatcher’s https://stackoverflow.com/questions/1092531/event-system-in-python/1096614#1096614

Parameters:

Returns

__init__(**kwds)[source]
Parameters:

Returns

addListener(listener, cls=<class 'fdi.dataset.listener.EventListener'>)[source]

Adds a listener to this. Paremeters ———-

fire(*args, **kwargs)[source]

Paremeters

getListenerCount()[source]

Paremeters

getListeners()[source]

Returns the current Listeners. Paremeters ———-

property listeners
Parameters:

Returns

removeListener(listener)[source]

Removes a listener from this. Paremeters ———-

setListeners(listeners)[source]

Replaces the current Listeners with specified argument. Paremeters ———-

class fdi.dataset.listener.ListenerSet(data=None, *args, **kwds)[source]

Bases: Serializable, DeepcmpEqual, UserList

Mutable collection of Listeners of an EvenSender.

Parameters:

data: default is None for a list.

__init__(data=None, *args, **kwds)[source]
Parameters:

data: default is None for a list.

equals(obj, verbose=False)[source]

compares with another one. :Parameters: Returns

geturns(remove=None)[source]

Returns the current urns. :Parameters: Returns

seturns(urns)[source]

Replaces the current urn with specified argument.

string(level=0, alist=False, **kwds)
Returns:

  • LIST[TUPLE(OBJ)] or STRXS

  • A list of member-repre tuples or a string of all depending on alist.

toString(level=0, alist=False, **kwds)[source]
Returns:

  • LIST[TUPLE(OBJ)] or STRXS

  • A list of member-repre tuples or a string of all depending on alist.

txt(level=0, alist=False, **kwds)
Returns:

  • LIST[TUPLE(OBJ)] or STRXS

  • A list of member-repre tuples or a string of all depending on alist.

property urns
class fdi.dataset.listener.MetaDataListener(*args, **kwds)[source]

Bases: EventListener

Listener for events occuring in MetaData. Available types:

* PARAMETER_ADDED
* PARAMETER_REMOVED
* PARAMETER_CHANGED

Possible causes: not null (for PARAMETER_CHANGED, if parameter internally changed) null (for PARAMETER_CHANGED, when set is called with a previous existing parameter, and rest)

Warning: The listener handler must be a class attribute in order to create an object hard reference. See DatasetBaseListener.

__init__(*args, **kwds)[source]
class fdi.dataset.listener.ParameterListener(**kwds)[source]

Bases: EventListener

Listener for events occuring in a Parameter. Available types:

* DESCRIPTION_CHANGED
* UNIT_CHANGED
* VALUE_CHANGED
* UNKOWN_ATTRIBUTE_CHANGED

Cause is always null.

Warning: The listener handler must be a class attribute in order to create an object hard reference. See DatasetBaseListener.

__init__(**kwds)[source]
class fdi.dataset.listener.ProductListener(**kwds)[source]

Bases: EventListener

Listener for events occuring in Product. Available types:

* METADATA_CHANGED
* DATASET_ADDED
* DATASET_REMOVED
* DATASET_CHANGED

Possible causes:

* not null (METADATA_CHANGED, DATASET_CHANGED)
* null (METADATA_CHANGED, DATASET_REMOVED, DATASET_CHANGED)

Warning: The listener handler must be a class attribute in order to create an object hard reference. See DatasetBaseListener.

__init__(**kwds)[source]

fdi.dataset.mediawrapper module

class fdi.dataset.mediawrapper.MediaWrapper(data=None, unit=None, description=None, typ_='image/png', source=None, typecode=None, version=None, zInfo=None, alwaysMeta=True, **kwds)[source]

Bases: ArrayDataset

A MediaWrapper contains raw, usually binary, data in specific format.

Initializes media data wrapped in ArrayDataset.

typ_: www style string that follows Content-Type: `. Default is `image/png.

__init__(data=None, unit=None, description=None, typ_='image/png', source=None, typecode=None, version=None, zInfo=None, alwaysMeta=True, **kwds)[source]

Initializes media data wrapped in ArrayDataset.

typ_: www style string that follows Content-Type: `. Default is `image/png.

fdi.dataset.mediawrapper_datamodel module

fdi.dataset.messagequeue module

class fdi.dataset.messagequeue.MqttRelayListener(topics=None, host=None, port=None, username=None, passwd=None, callback=None, clean_session=None, client_id=None, userdata=None, qos=1, conn=True, subs=True, **kwds)[source]

Bases: EventListener

Generic interface for sending anything heard to an MQTT message queue.

Starts a MQTT message queue and forward everything in the arguement list to the MQ serialized.

host, port, username, passwd: if any is not provided, it is looked up in `config[…].

__init__(topics=None, host=None, port=None, username=None, passwd=None, callback=None, clean_session=None, client_id=None, userdata=None, qos=1, conn=True, subs=True, **kwds)[source]

Starts a MQTT message queue and forward everything in the arguement list to the MQ serialized.

host, port, username, passwd: if any is not provided, it is looked up in `config[…].

targetChanged(*args, **kwargs)[source]

Informs that an event has happened in a target of any type.

class fdi.dataset.messagequeue.MqttRelaySender(topics=None, host=None, port=None, username=None, passwd=None, callback=None, clean_session=None, client_id=None, userdata=None, keepalive=60, qos=1, **kwds)[source]

Bases: EventSender

Gets MQTT messages and forwards to listeners.

Starts a MQTT message queue and forward everything in the arguement list to the MQ serialized.

host, port, username, passwd: if any is not provided, it is looked up in `config[…].

__init__(topics=None, host=None, port=None, username=None, passwd=None, callback=None, clean_session=None, client_id=None, userdata=None, keepalive=60, qos=1, **kwds)[source]

Starts a MQTT message queue and forward everything in the arguement list to the MQ serialized.

host, port, username, passwd: if any is not provided, it is looked up in `config[…].

fdi.dataset.messagequeue.on_connect(client, userdata, flags, rc)[source]
fdi.dataset.messagequeue.on_message(client, userdata, msg)[source]

fdi.dataset.metadata module

class fdi.dataset.metadata.AbstractParameter(value=None, description='UNKNOWN', **kwds)[source]

Bases: Annotatable, Copyable, DeepcmpEqual, DatasetEventSender, Serializable

Parameter is the interface for all named attributes in the MetaData container.

A Parameter is a variable with associated information about its description, unit, type, valid ranges, default, format code etc. Type can be numeric, string, datetime, vector.

Often a parameter shows a property. So a parameter in the metadata of a dataset or product is often called a property.

Default value=None, description=’UNKNOWN’

Constructed with no argument results in a parameter of None value and ‘UNKNOWN’ description ‘’. With a signle argument: arg -> value, ‘UNKNOWN’ as default-> description. With two positional arguments: arg1-> value, arg2-> description. Type is set according to value’s. Unsuported parameter types will get a NotImplementedError.

__init__(value=None, description='UNKNOWN', **kwds)[source]

Constructed with no argument results in a parameter of None value and ‘UNKNOWN’ description ‘’. With a signle argument: arg -> value, ‘UNKNOWN’ as default-> description. With two positional arguments: arg1-> value, arg2-> description. Type is set according to value’s. Unsuported parameter types will get a NotImplementedError.

accept(visitor)[source]

Adds functionality to classes of this type.

getValue()[source]

Gets the value of this parameter as an Object.

getValueAsString()[source]

Value as string for building the string representation of the parameter.

hash()[source]

hash and equality derived only from the value of the parameter.

because Python does not allow overriding __eq__ without setting hash to None.

setValue(value)[source]

Replaces the current value of this parameter.

string(level=0, alist=False, **kwds)

alist: returns a dictionary string representation of parameter attributes.

toString(level=0, alist=False, **kwds)[source]

alist: returns a dictionary string representation of parameter attributes.

txt(level=0, alist=False, **kwds)

alist: returns a dictionary string representation of parameter attributes.

property value

for property getter

fdi.dataset.metadata.Default_Extra_Param_Width = 10
Attribute | Defining Module | Holder Variable |
‘description’ | Annotatable | description |
typ_’ | Typed | _type |
‘unit’ | Quantifiable | ‘_unit’ |
‘typecode’ | Typecoded | ‘_typecode’ |
class fdi.dataset.metadata.MetaData(copy_=None, defaults=None, **kwds)[source]

Bases: ParameterListener, Composite, Copyable, DatasetEventSender

A container of named Parameters.

A MetaData object can have one or more parameters, each of them stored against a unique name. The order of adding parameters to this container is important, that is: the keySet() method will return a set of labels of the parameters in the sequence as they were added. Note that replacing a parameter with the same name, will keep the order.

Default_Param_Widths = {'code': 10, 'default': 15, 'description': 17, 'name': 15, 'type': 8, 'unit': 6, 'valid': 17, 'value': 18}
MaxDefWidth = 18
__init__(copy_=None, defaults=None, **kwds)[source]
accept(visitor)[source]

Hook for adding functionality to meta data object through visitor pattern.

clear()[source]

Removes all the key - parameter mappings.

remove(name)[source]

add eventhandling

set(name, newParameter)[source]

Saves the parameter and adds eventhandling.

In a parameter name, dot or other invalid characters (when the name is used as a property name) is ignored.

Raises TypeError if not given Parameter (sub) class object.

string(level=0, extra=False, param_widths=None, tablefmt='grid', tablefmt1='simple', tablefmt2='psql', **kwds)

return string representation of metada.

The order of parameters are important as the httppool API use the order when passing parameters to, e.g. txt.

Parameters:
  • level (int) – detailed-ness level. 0 is the most detailed, 2 is the least,

  • param_widths (int or dict) – Controls how the attributes of every parameter are displayed in the table cells. If is set to -1, there is no cell-width limit (e.g. fot html output). If set to >=0, all widths are set to this. For finer control set a dictionary of parameter attribute names and how many characters wide its table cell is, 0 for ommiting the attributable. Default is MetaData.Default_Param_Widths. Example: {'name': 15, 'value': 18, 'unit': 6, 'type': 8, 'valid': 17, 'default': 15, 'code': 4, 'description': 17}. default is

  • tablefmt (str) – format string in packae tabulate, for level==0.

  • tablefmt1 (string) – for level1

  • tablefmt2 (str) – format of 2D table data.

toString(level=0, extra=False, param_widths=None, tablefmt='grid', tablefmt1='simple', tablefmt2='psql', **kwds)[source]

return string representation of metada.

The order of parameters are important as the httppool API use the order when passing parameters to, e.g. txt.

Parameters:
  • level (int) – detailed-ness level. 0 is the most detailed, 2 is the least,

  • param_widths (int or dict) – Controls how the attributes of every parameter are displayed in the table cells. If is set to -1, there is no cell-width limit (e.g. fot html output). If set to >=0, all widths are set to this. For finer control set a dictionary of parameter attribute names and how many characters wide its table cell is, 0 for ommiting the attributable. Default is MetaData.Default_Param_Widths. Example: {'name': 15, 'value': 18, 'unit': 6, 'type': 8, 'valid': 17, 'default': 15, 'code': 4, 'description': 17}. default is

  • tablefmt (str) – format string in packae tabulate, for level==0.

  • tablefmt1 (string) – for level1

  • tablefmt2 (str) – format of 2D table data.

txt(level=0, extra=False, param_widths=None, tablefmt='grid', tablefmt1='simple', tablefmt2='psql', **kwds)

return string representation of metada.

The order of parameters are important as the httppool API use the order when passing parameters to, e.g. txt.

Parameters:
  • level (int) – detailed-ness level. 0 is the most detailed, 2 is the least,

  • param_widths (int or dict) – Controls how the attributes of every parameter are displayed in the table cells. If is set to -1, there is no cell-width limit (e.g. fot html output). If set to >=0, all widths are set to this. For finer control set a dictionary of parameter attribute names and how many characters wide its table cell is, 0 for ommiting the attributable. Default is MetaData.Default_Param_Widths. Example: {'name': 15, 'value': 18, 'unit': 6, 'type': 8, 'valid': 17, 'default': 15, 'code': 4, 'description': 17}. default is

  • tablefmt (str) – format string in packae tabulate, for level==0.

  • tablefmt1 (string) – for level1

  • tablefmt2 (str) – format of 2D table data.

class fdi.dataset.metadata.Parameter(value=None, description='UNKNOWN', typ_='', default=None, valid=None, **kwds)[source]

Bases: AbstractParameter, Typed

Parameter is the interface for all named attributes in the MetaData container.

It can have a value and a description.

Default arguments: typ_=’’, default=None, valid=None. value=default, description=’UNKNOWN’

invoked with no argument results in a parameter of

None value and ‘UNKNOWN’ description ‘’. typ_ DataTypes[‘’], which is None. With a signle argument: arg -> value, ‘UNKNOWN’-> description. ParameterTypes-> typ_, hex values have integer typ_.

f With two positional arguments: arg1-> value, arg2-> description. ParameterTypes[‘’]-> typ_.

With three positional arguments: arg1 casted to DataTypes[arg3]-> value, arg2-> description. arg3-> typ_. Unsuported parameter types will get a NotImplementedError. Incompatible value and typ_ will get a TypeError. Parameters ———-

ALLOWED_PARAM_DATA_TYPES = {'BaseProduct': 'baseProduct', 'FineTime': 'finetime', 'FineTime1': 'finetime1', 'MapContext': 'mapContext', 'None': '', 'NoneType': '', 'ODict': 'vector', 'OrderedDict': 'vector', 'Product': 'product', 'Quaternion': 'quaternion', 'UserDict': 'vector', 'Vector': 'vector', 'Vector2D': 'vector2d', 'Vector3D': 'vector3d', 'array': 'array', 'array.array': 'array', 'bool': 'boolean', 'complex': 'complex', 'dict': 'vector', 'float': 'float', 'int': 'integer', 'list': 'list', 'str': 'string', 'tuple': 'tuple'}
__init__(value=None, description='UNKNOWN', typ_='', default=None, valid=None, **kwds)[source]
invoked with no argument results in a parameter of

None value and ‘UNKNOWN’ description ‘’. typ_ DataTypes[‘’], which is None. With a signle argument: arg -> value, ‘UNKNOWN’-> description. ParameterTypes-> typ_, hex values have integer typ_.

f With two positional arguments: arg1-> value, arg2-> description. ParameterTypes[‘’]-> typ_.

With three positional arguments: arg1 casted to DataTypes[arg3]-> value, arg2-> description. arg3-> typ_. Unsuported parameter types will get a NotImplementedError. Incompatible value and typ_ will get a TypeError. Parameters ———-

accept(visitor)[source]

Adds functionality to classes of this type.

checked(value)[source]

Checks input value against self.type.

If value is none, returns it; else if type is not set, return value after setting type; If value’s type is a subclass of self’s type, return the value; If value’s and self’s types are both subclass of Number, returns value casted in self’s type.

property default
getDefault()[source]

Returns the default related to this object.

getValid()[source]

Returns the valid related to this object.

isValid()[source]
setDefault(default)[source]

Sets the default of this object.

Default is set directly if type is not set or default is None. If the type of default is not getType(), TypeError is raised.

setType(typ_)[source]

Replaces the current type of this parameter.

Default will be casted if not the same. Unsuported parameter types will get a NotImplementedError.

Return type:

None

setValid(valid)[source]

Sets the valid of this object.

If valid is None or empty, set as None, else save in a way so the tuple keys can be serialized with JSON. [[[rangelow, ranehi], state1], [[range2low, r..]..]..]

setValue(value)[source]

Replaces the current value of this parameter.

If value is None set it to None (#TODO: default?) If given/current type is ‘’ and arg value’s type is in DataTypes both value and type are updated to the suitable one in DataTypeNames; or else TypeError is raised. If value type is not a subclass of given/current type, or

Incompatible value and type will get a TypeError.

split(into=None)[source]

split a multiple binary bit-masked parameters according to masks.

into: dictionary mapping bit-masks to the sub-name of the parameter. return: a dictionary mapping name of new parameters to its value.

string(level=0, alist=False, **kwds)

alist: returns a dictionary string representation of parameter attributes.

toString(level=0, alist=False, **kwds)[source]

alist: returns a dictionary string representation of parameter attributes.

txt(level=0, alist=False, **kwds)

alist: returns a dictionary string representation of parameter attributes.

property valid
validate(value=Invalid)[source]

checks if a match the rule set.

value: will be checked against the ruleset. Default is self._valid. returns: (valid value, rule name) for discrete and range rules. {mask: (valid val, rule name, mask_height, mask_width), …} for binary masks rules. (INVALID, ‘Invalid’) if no matching is found. (value, ‘Default’) if rule set is empty.

fdi.dataset.metadata.guess_value(data, parameter=False, last=<class 'str'>)[source]

Returns guessed value from a string.

This is different from Attributable.value2parameter

input | output |
`'None'`,```’null’`,`’nul’``` any case | None |
integer | int() |
float | float() |
`'True'`, `'False`` | True, False |
string starting with `'0x'` | hex() |
else | run `last`(data) |
Return type:

Parameter

fdi.dataset.metadata.make_jsonable(valid)[source]
fdi.dataset.metadata.parameterDataClasses(tt)[source]

maps machine type names to class objects

fdi.dataset.metadataholder module

class fdi.dataset.metadataholder.MetaDataHolder(meta=None, **kwds)[source]

Bases: object

Object holding meta data.

Adds MetaData to the class. with defaults set to self.zInfo[‘metadata’].

__init__(meta=None, **kwds)[source]

Adds MetaData to the class. with defaults set to self.zInfo[‘metadata’].

getMeta()[source]

Returns the current MetaData container of this object. Cannot become a python property because setMeta is in Attributable

hasMeta()[source]

whether the metadata holder is present. During initialization subclass of MetaDataHolder may need to know if the metadata holder has been put in place with is method.

setMeta(meta)[source]

fdi.dataset.namespace module

class fdi.dataset.namespace.Lazy_Loading_ChainMap(*args, extensions=None, load=None, **kwds)[source]

Bases: ChainMap

A mapping the populates its main storage as needed from source and extension maps.

Implementated with a ChainMap of a cache, a initial, and an arbitrary number of extension maps.

The name (the key) is searched in the cache and, if not found, in other maps on the chain. the load function is used to do the loading.

Initialize a ChainMap by setting maps to the given mappings. If no mappings are provided, a single empty dictionary is used.

add_ns(ns=None, order=0)[source]

Add new name space in the list of internal ones.

Parameters:
  • order (int) – The number of maps to look up before this one

  • is . If negative, `-n` means the n-th from the last.

  • E.g. `order=-1` means to become the last one.

  • ns (mapping) – Namespace map to be looked up.

cache

for the loaded key-vals.

exclude

list A list of keys to avoid loading. Default None.

Type:

exclude

ignore_error

boolean Do not throw exception when error happens during loading. Log, set Load_Failed, and Move on.

Type:

ignore_error

initial

This mapping stores name-content pairs that are used to build the main map (the cache). It is dict-wrapped sources. Example: module_name-classe_names, schema store, configs.

reload()[source]

Update the initial map with sources, empty other maps.

Returns:

self.

Return type:

ChainMap

update(c=None, exclude=None, verbose=False, extension=None, ignore_error=False)[source]

Updates the mapping.

Parameters:
  • c (mapping) – to be used to update with. Subclasses that need to

  • load must format key and values as required.

  • exclude (boolean) – Ignore these keys when updating.

  • extension (mapping) – add c as a new sources map.

Returns:

dict

Return type:

The mapping.

fdi.dataset.namespace.Load_Failed = <object object>

unique object to mark this failure condition.

class fdi.dataset.namespace.NameSpace_meta(clsname, bases, attrs, sources=None, extensions=None, load=None, **kwds)[source]

Bases: type

metaclass for name-spaces such as class white list and schemas.

Ref ‘classproperty’. # https://stackoverflow.com/a/1800999

Internal map is initialized with sources.

The internal map is initialized with a default

and a list of extension maps which can be collection of key-value pairs. These maps are put into the sources map. However these maps are only the information needed to populate the main map, the target map of namespace.

The target namespace is also represented by a collection of key-value pairs but each of them reside in a cache map, and are loaded into the cache map by the load function lazily when the key is used. The default refloader just copies the reference of the values in the sources map by the same name.

When looking up a key, the cache maps will be searched left to right.

This architecture allows expensive values to be associated with names gradually in a cache in a pay-as-you-need manner.

Examples

For an app package with many classes:

Import user classes in a python file for example projectclasses.py:

clz_map = {

‘MyClass1’: ‘mypackage.mymodule’, ‘MyClass2’: ‘mypackage.mymodule’

}

# from another module defining a dict of # Class_name: Class_obj pairs

try:

from mypackage.mymodule import pairs

except (ImportError, ModuleNotFoundError) as e:

logger.info(e) raise

from fdi.dataset.namespace import NameSpace_meta

def loader():

class PC(metaclass=NameSpace_meta,

sources=[Reverse_Modules_Classes, pairs, clz_map], load=loader ):

pass

prjcls = PC.mapping

new_instance = prjcls[‘MyClass1’]

Define new classes and update PC:

class Myclass():

PC.update({‘foo’: MyClass})

and use:

``new_instance = PC.mapping['foo']``
Parameters:
  • clsname (str) – Name of the class being defined(Event in this example)

  • bases (tuple) – Base classes of the constructed class, empty tuple in this case

  • attrs (dict) – Dict containing methods and fields defined in the class

  • sources (list) – A list of maps containing the core/platform/framework/primary package namespace and plug-in/application package name spaces.

  • extensions (list) – A list of key-value maps to extend the cache.

  • load (function) – classmethod to load a key from initial of the internal map.

  • kwds (dict) – member key-val pairs: k will be added to instance-classes’ class attributes namespace, initiated to val

Returns:

new class

Return type:

cls

clear()[source]

Empty the internal mapping including maps[1:].

sources map is not wiped.

reload()[source]

re-import classes in the map.

sources = [{}]

name-content list from the main package and for plug-in/app.

update(*args, **kwds)[source]

Updates the mapping.

Parameters:
  • c (Mapping to be used to update the main map with. Subclasses that need to)

  • load must format key and values as required.

Returns:

dict

Return type:

The mapping.

fdi.dataset.namespace.refloader(key, mapping, remove=True, exclude=None, ignore_error=False)[source]
Generates key-value pair out of a map containing name-content

pairs, by referencing.

Subclasses should override this function unless this name space contains the same kind of items in default

key: str

name in the key-value pair.

mappingdict

a map containing name-content pairs (such as

default, initial). remove : bool

if set, remove this pair from the source after loading.

excludelist

A list of keys to avoid loading. Default None.

ignore_errorboolean

Do not throw exception when error happens during loading. Log, set Load_Failed, and Move on.

dict:

key and load-result pairs. load-result is Load_Failed if loading of the key was not successful.

fdi.dataset.ndprint module

fdi.dataset.ndprint.ndprint(data, trans=True, mdim=None, maxElem=9223372036854775807, tablefmt3='plain', **kwds)[source]
makes a formated string of an N-dimensional array for printing.

The fastest changing index is the innerest list. E.g. A 2 by 3 matrix is [[1,2],[3,4],[5,6]] written as:

1 2 3 4 5 6

But if the matrix is a table, the cells in a column change the fastest,

and the columns are written vertically. So to print a matrix as a table, whose columns are the innerest list, set trans = True (default) then the matrix needs to be printed transposed:

1 3 5 2 4 6

tablefmt3:

control 2d array printing. Default ‘plain’.

dim:

Max dimension of the data. If given None guess will be made. This helps to disambiguit if there are iterables in the elements. DEfault `None`.

fdi.dataset.ndprint.padstr(s, w, just='left', pad=' ')[source]

fdi.dataset.numericparameter module

class fdi.dataset.numericparameter.BooleanParameter(value=None, description='UNKNOWN', default=None, valid=None, **kwds)[source]

Bases: Parameter

A Parameter that has a boolean as the value.

Set up a parameter whose value is a boolean

__init__(value=None, description='UNKNOWN', default=None, valid=None, **kwds)[source]

Set up a parameter whose value is a boolean

setDefault(default)[source]

accept any type that bool Vector does.

setValue(value)[source]

accept any type that bool does.

class fdi.dataset.numericparameter.NumericParameter(value=None, description='UNKNOWN', typ_='', default=None, unit=None, valid=None, typecode=None, **kwds)[source]

Bases: Parameter, Quantifiable

A Parameter that has a number as the value, a unit, and a typecode.

Set up a parameter whose value is a or a list of numbers.

typ_: type of the parameter value.

__init__(value=None, description='UNKNOWN', typ_='', default=None, unit=None, valid=None, typecode=None, **kwds)[source]

Set up a parameter whose value is a or a list of numbers.

typ_: type of the parameter value.

setDefault(default)[source]

accept any type that a Vector does.

‘Accept sequence of only 0 to 4 elements for NumericParameter and Vectors.’)

setValue(value)[source]

accept any type that a Vector does.

fdi.dataset.odict module

class fdi.dataset.odict.ODict(*args, **kwds)[source]

Bases: UserDict, Serializable, DeepcmpEqual

Ordered dict that is not a subclass of dict and with a better __str__.

__init__(*args, **kwds)[source]
get(name)[source]

Raise a KeyError to change the default behavior of colections.Mapping to quietly return a None when a key is not found in the dict.

hash()[source]
string(level=0, keyval=None, **kwds)
level:

default=0,

keyval:

default=`None`. If set to a string, ODict class name is not shown and a label of given string is shown with each key as ‘label key:

‘.
tablefmt:

=’rst’, tablefmt1=’simple’, tablefmt2=’simple’, matprint=None, trans=True, heavy=True

toString(level=0, keyval=None, **kwds)[source]
level:

default=0,

keyval:

default=`None`. If set to a string, ODict class name is not shown and a label of given string is shown with each key as ‘label key:

‘.
tablefmt:

=’rst’, tablefmt1=’simple’, tablefmt2=’simple’, matprint=None, trans=True, heavy=True

txt(level=0, keyval=None, **kwds)
level:

default=0,

keyval:

default=`None`. If set to a string, ODict class name is not shown and a label of given string is shown with each key as ‘label key:

‘.
tablefmt:

=’rst’, tablefmt1=’simple’, tablefmt2=’simple’, matprint=None, trans=True, heavy=True

fdi.dataset.product module

class fdi.dataset.product.Product(description='UNKNOWN', typ_='Product', level='ALL', creator='UNKNOWN', creationDate=FineTime(1958-01-01T00:00:00.000000), rootCause='UNKNOWN', version='0.8', FORMATV='1.6.0.10', startDate=FineTime(1958-01-01T00:00:00.000000), endDate=FineTime(1958-01-01T00:00:00.000000), instrument='UNKNOWN', modelName='UNKNOWN', mission='_AGS', zInfo=None, **kwds)[source]

Bases: BaseProduct

Product class schema 1.6 inheriting [‘BaseProduct’].

Automatically generated from fdi/dataset/resources/Product.yml on 2022-10-14 23:26:41.059005.

Description: Project level product

Generally a Product (inheriting BaseProduct) has project-wide attributes and can be extended to define a plethora of specialized products.

Initializes instances with more metadata as attributes, set to default values.

Put description keyword argument here to allow e.g. BaseProduct(“foo”) and description=’foo’

__init__(description='UNKNOWN', typ_='Product', level='ALL', creator='UNKNOWN', creationDate=FineTime(1958-01-01T00:00:00.000000), rootCause='UNKNOWN', version='0.8', FORMATV='1.6.0.10', startDate=FineTime(1958-01-01T00:00:00.000000), endDate=FineTime(1958-01-01T00:00:00.000000), instrument='UNKNOWN', modelName='UNKNOWN', mission='_AGS', zInfo=None, **kwds)[source]

Initializes instances with more metadata as attributes, set to default values.

Put description keyword argument here to allow e.g. BaseProduct(“foo”) and description=’foo’

property endDate
property instrument
property mission
property modelName
property startDate

fdi.dataset.quantifiable module

class fdi.dataset.quantifiable.Quantifiable(unit=None, typecode=None, **kwds)[source]

Bases: Typecoded

A Quantifiable object is a numeric object that has a unit. $ x.unit = ELECTRON_VOLTS $ print x.unit eV [1.60218E-19 J]

Has a unit and a typecode (as in array.array.typecodes).

__init__(unit=None, typecode=None, **kwds)[source]

Has a unit and a typecode (as in array.array.typecodes).

getUnit()[source]

Returns the unit related to this object.

setUnit(unit)[source]

Sets the unit of this object.

property unit

fdi.dataset.readonlydict module

fdi.dataset.readonlydict.ReadOnlyDict

alias of frozendict

class fdi.dataset.readonlydict.bReadOnlyDict[source]

Bases: dict

Dictionary that is read-only and returns all values of dict type to ReadOnlyDict type so they, too, cannot be modified.

Based on https://stackoverflow.com/a/61700719/13472124

clear(*args, **kwargs)
pop(*args, **kwargs)
popitem(*args, **kwargs)
setdefault(*args, **kwargs)
update(*args, **kwargs)
class fdi.dataset.readonlydict.frozendict(*args, **kw)[source]

Bases: dict

Extended version of frozent dict.

This extended version of the code above will also “freeze” dictionaries and lists stored as values of the dictionary. If dictionaries/lists are found among the values, they will be handled recursively.

Oren Tirosh, Ero Carrera, Søren Løvborg

https://code.activestate.com/recipes/414283/

__init__(*args, **kw)[source]
property clear
property pop
property popitem
property setdefault
property update
fdi.dataset.readonlydict.make_readonly(d, excluded=None)[source]

Recursively make values of Mapping type at all levels read-only.

fdi.dataset.schemas module

from https://stackoverflow.com/a/70797664 reubano

fdi.dataset.schemas.FDI_SCHEMA_DIR = '/home/docs/checkouts/readthedocs.org/user_builds/fdi/envs/latest/lib/python3.8/site-packages/fdi/schemas'

The directory where the schema definition files are stored.

class fdi.dataset.schemas.Schemas[source]

Bases: object

mapping = Lazy_Loading_ChainMap({}, {})
class fdi.dataset.schemas.Schmas(**kwds)[source]

Bases: ChainMap

Initialize a ChainMap by setting maps to the given mappings. If no mappings are provided, a single empty dictionary is used.

fdi.dataset.schemas.getValidator(schema, schemas=None, schema_store=None, base_schema=None, verbose=False)[source]

Returns a jsonschema validator that knows where to find given schemas.

Schema:

the schema this validator is made for.

Schemas:

A map of schema id and schema objects. default is all schemas found in `schema_store`. If it has ‘$schema’ and ‘$id’ as keys, it will be the lone schema to be validated against by the returned validator.

Schema_store:

get schemas here if `schemas` is `None`. default is FDI_SCHEMA_STORE.

Base_schema:

A reference schema object providing BaseURI. Default is schema_store[FDI_SCHEMA_BASE], whereas the schema_store is made with FDI_SCHEMA_STORE and schemas.

fdi.dataset.schemas.makeSchemaStore(schema_dir=None, verbose=False)[source]

make a mapping of schema id and schema obj loaded from the given directory.

Parameters:
  • schema_dir (str) – Name of a directory containing schema definitions in JSON files

  • and subdirectories. If is `None` set to `FDI_SCHEMA_DIR`.

  • verbose (bool) – Say more if set.

Returns:

file paths vs. schema objects

Return type:

dict

Raises:

# raise ValueError

fdi.dataset.schemas.schema_dir_loader(key, mapping, remove=True, exclude=None, ignore_error=False, verbose=False)[source]

load all schemas in the given directory and its subdirs.

fdi.dataset.schemas.validateJson(data, validator)[source]

validates a JSON object.

Data:

a JSON object or a _file_full_path that ends with ‘json’ or ‘jsn’.

fdi.dataset.serializable module

fdi.dataset.serializable.GZIP = False

Use `gzip` (and `Bae64` if needed) to compress.

fdi.dataset.serializable.SCHEMA = False

Output JSONschema instead of JSON erialization.

class fdi.dataset.serializable.Serializable(*args, **kwds)[source]

Bases: object

mh: Can be serialized. Has a _STID instance property to show its class information.

__init__(*args, **kwds)[source]
fetch(paths, exe=['is'], not_quoted=True)[source]
fits(*args, **kwds)[source]

Get a FITS representation.

html(extra=False, param_widths=-1, **kwds)[source]

Get a HTML representation.

jsonPath(expr, val='simple', sep='/', indent=None, *args, **kwds)[source]
schema()[source]

Get schema definition using the FDI standard schema set in FDI_SCHEMA_STORE. Subclassing to add more schemas.

serializable()[source]

Can be encoded with serializableEncoder.

Returns:

The state variables plus the Serialization Type ID with `_STID` as uts key.

Return type:

dict

serialized(indent=None)[source]
tree(*args, **kwds)[source]

Get a directory-tree-like representation.

yaml(*args, **kwds)[source]

Get a YAML representation.

class fdi.dataset.serializable.SerializableEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: JSONEncoder

can encode parameter and product etc such that they can be recovered with deserialize(). Python 3 treats string and unicode as unicode, encoded with utf-8, byte blocks as bytes, encoded with utf-8. Python 2 treats string as str and unicode as unicode, encoded with utf-8, byte blocks as str, encoded with utf-8

Constructor for JSONEncoder, with sensible defaults.

If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, float or None. If skipkeys is True, such items are simply skipped.

If ensure_ascii is true, the output is guaranteed to be str objects with all incoming non-ASCII characters escaped. If ensure_ascii is false, the output can contain non-ASCII characters.

If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an OverflowError). Otherwise, no such check takes place.

If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats.

If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis.

If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation.

If specified, separators should be an (item_separator, key_separator) tuple. The default is (’, ‘, ‘: ‘) if indent is None and (‘,’, ‘: ‘) otherwise. To get the most compact JSON representation, you should specify (‘,’, ‘:’) to eliminate whitespace.

If specified, default is a function that gets called for objects that can’t otherwise be serialized. It should return a JSON encodable version of the object or raise a TypeError.

default(obj)[source]
class fdi.dataset.serializable.SerializableEncoderAll(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: JSONEncoder

can encode parameter and product etc such that they can be recovered with deserialize(). Python 3 treats string and unicode as unicode, encoded with utf-8, byte blocks as bytes, encoded with utf-8. Python 2 treats string as str and unicode as unicode, encoded with utf-8, byte blocks as str, encoded with utf-8

Constructor for JSONEncoder, with sensible defaults.

If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, float or None. If skipkeys is True, such items are simply skipped.

If ensure_ascii is true, the output is guaranteed to be str objects with all incoming non-ASCII characters escaped. If ensure_ascii is false, the output can contain non-ASCII characters.

If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an OverflowError). Otherwise, no such check takes place.

If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats.

If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis.

If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation.

If specified, separators should be an (item_separator, key_separator) tuple. The default is (’, ‘, ‘: ‘) if indent is None and (‘,’, ‘: ‘) otherwise. To get the most compact JSON representation, you should specify (‘,’, ‘:’) to eliminate whitespace.

If specified, default is a function that gets called for objects that can’t otherwise be serialized. It should return a JSON encodable version of the object or raise a TypeError.

base = (<class 'str'>, <class 'int'>, <class 'float'>, <class 'bool'>, <class 'NoneType'>)
default(obj)[source]
iterencode(obj, **kwds)[source]
fdi.dataset.serializable.get_schema_with_classname(cls_name, store=None)[source]
fdi.dataset.serializable.serialize(o, cls=None, **kwds)[source]

return JSON using special encoder SerializableEncoder

Parameterts

fdi.dataset.shaped module

class fdi.dataset.shaped.Shaped(**kwds)[source]

Bases: object

An object of specifiable kinds.

This class is for parameters, not for products/datasets to make ‘shape’ MDP.

Has a shape.

__init__(**kwds)[source]

Has a shape.

updateShape(**kwds)[source]

fdi.dataset.stringparameter module

class fdi.dataset.stringparameter.StringParameter(value=None, description='UNKNOWN', default=None, valid=None, typecode='B', **kwds)[source]

Bases: Parameter, Typecoded

has a unicode string as the value, a typecode for length and char.

invoked with no argument results in a parameter of

None value and ‘UNKNOWN’ description ‘’. typ_ DataTypes[‘’], which is None. With a signle argument: arg -> value, ‘UNKNOWN’-> description. ParameterTypes-> typ_, hex values have integer typ_.

f With two positional arguments: arg1-> value, arg2-> description. ParameterTypes[‘’]-> typ_.

With three positional arguments: arg1 casted to DataTypes[arg3]-> value, arg2-> description. arg3-> typ_. Unsuported parameter types will get a NotImplementedError. Incompatible value and typ_ will get a TypeError. Parameters ———-

fdi.dataset.tabledataset module

class fdi.dataset.tabledataset.IndexedTableDataset(**kwds)[source]

Bases: Indexed, TableDataset

TableDataset with an index table for efficient row look-up.

__init__(**kwds)[source]
getColumnsToLookup()[source]

returns an iterator that gives a number of sequences to looking up over.

hashx()[source]
setData(data)[source]

sets name-column pairs from data and updates index if needed

vLookUp(key, return_index=True, multiple=False)[source]

Similar to Excel VLOOKUP, return all records (rows) that match the key. key: taken as a dictionary key unless multiple is True. return_index: if True (default) return index in the array of columns. multiple: if True (default is False) loop through key as a sequence of keys and return a sequece.

class fdi.dataset.tabledataset.TableDataset(data=None, description=None, typ_=None, version=None, zInfo=None, alwaysMeta=True, **kwds)[source]

Bases: CompositeDataset, TableModel, Shaped

Special dataset that contains a single Array Data object. A TableDataset is a tabular collection of Columns. It is optimized to work on array data.. The column-wise approach is convenient in many cases. For example, one has an event list, and each algorithm is adding a new field to the events (i.e. a new column, for example a quality mask).

Although mechanisms are provided to grow the table row-wise, one should use these with care especially in performance driven environments as this orthogonal approach (adding rows rather than adding columns) is expensive.

General Note:

For reasons of flexibility, memory consumption and performance, this class is not checking whether all columns are of the same length: this is the responsibility of the user/developer. See also the library documentation for more information about this.

Note on column names:

If a column is added without specifying a name, the name ColumnX is created, where X denotes the index of that column. Column name duplicity is not allowed.

Developers:

See “Writing special datasets or products” at the developer’s documentation also.

Please see also this selection example.

__init__(data=None, description=None, typ_=None, version=None, zInfo=None, alwaysMeta=True, **kwds)[source]
addColumn(name, column, col_des=True)[source]

Adds the specified column to this table, and attaches a name to it.

If the name is null, a dummy name “column”+column_count+1 is created, such that it can be accessed by getColumn(str).

If column name exists the corresponding column is substituted.

Parameters: name - column name. column - column to be added. col_des - if True (default) and if column description is ‘UNKNOWN’ or None, set to column name.

addRow(row, rows=False)[source]

Adds the specified map as a new row to this table.

row: row is a dict with names as keys and row data as values. rows: append each element in row if the row data is a list.

property columnCount
getColumn(key)[source]

Returns the particular column, or a list of columns.

key: ref getColumnMap()

  • int/str: return the int-th/named column;

  • Slice object, list of columns of sliced column indices;

  • list of integers/strings: return a list of columns corresponding to the given column index/name, or where key is True. Example a.getColumn(Slice(3,,)), [2, 4], ['time', ``energy'].

  • list of booleans: return a list of columns where key is True. Example [True, False...].

getColumnMap(key=None)[source]

Returns a dict of column-names as the keys and the column(s) as the values.

key: return the following as the value for each key-value pair:

  • int: name-value where value is the int-th column.

  • Slice object, a list of name-columns from slicing the column index. Example a.getColumn(Slice(3,,));

  • Sequence of integers/strings: they are used as the column index/name to select the columns.

  • Sequence of booleans: columns where the corresponding boolean is True are chosen.

Default is to return all columns.

getRow(rowIndex)[source]

Returns a list containing the objects located in a particular row, or a list of rows.

rowIndex: ref getRowMap()

  • int: return the int-th row in a list of elements;

  • Slice object, list of integers, list of booleans: return a list of rows each represented by a tuple. Example a.getRow(Slice(3,,)), [2,4], [True, False...].

getRowMap(rowIndex)[source]

Returns a dict of column-names as the keys and the objects located at a particular row(s) as the values.

rowIndex: return the following as the value for each key-value pair:

  • int: the int-th row’s elements;

  • Slice object, a list of rows from slicing the column. Example a.getRow(Slice(3,,));

  • list of integers: they are used as the row index to select the rows.

  • list of booleans: rows where the corresponding boolean is True are chosen.

indexOf(key)[source]

Returns the index of specified column.

if the key is a Column, it looks for equal references (same column objects), not for equal values. If the key is a string, Returns the index of specified Column name.

items()[source]

for k,v in tabledataset.items()

keys()

Returns the column names.

property list
removeColumn(key)[source]

Removes the columns specified by key.

ref. getColumnMap on key usage.

removeRow(rowIndex)[source]

Removes a row with specified index from this table.

rowIndex: int or a Slice object. Example a.removeRow(Slice(3,,)). return: removed row data.

property rowCount
select(selection)[source]

Select a number of rows from this table dataset and return a new TableDataset object containing only the selected rows.

selection: to form a new Tabledataset with ref getRowMap()

setColumn(key, value)[source]

Replaces a column in this table with specified name to specified column if key is a string and exists, or if the key is an integer in 0 to the number of columns, insert at column-index=key, with the name ‘column’+key, else add a new coolumn.

setColumnCount(columnCount)[source]

cannot do this.

setData(data)[source]

sets name-column pairs from data.

Valid formd include: {str:Column, …} or [(str, [num, …], str)] or [(str, Column), …] or [[num …], [num …], …]

[{‘name’:str,’column’:Column}] form is deprecated.

Existing data will be discarded except when the provided data is a list of lists, where existing column names and units will remain but data replaced, and extra data items will form new columns named ‘column’+index (index counting from 1) with unit None.

setRowCount(rowCount)[source]

cannot do this.

string(level=0, extra=False, param_widths=None, tablefmt='grid', tablefmt1='simple', tablefmt2='plain', width=0, matprint=None, trans=True, heavy=True, center=-1, **kwds)

tablefmt2: format of 2D data, others see MetaData.toString.

toString(level=0, extra=False, param_widths=None, tablefmt='grid', tablefmt1='simple', tablefmt2='plain', width=0, matprint=None, trans=True, heavy=True, center=-1, **kwds)[source]

tablefmt2: format of 2D data, others see MetaData.toString.

txt(level=0, extra=False, param_widths=None, tablefmt='grid', tablefmt1='simple', tablefmt2='plain', width=0, matprint=None, trans=True, heavy=True, center=-1, **kwds)

tablefmt2: format of 2D data, others see MetaData.toString.

class fdi.dataset.tabledataset.TableModel(**kwds)[source]

Bases: object

to interrogate a tabular data model

__init__(**kwds)[source]
getColumnClass(columnIndex)[source]

Returns the class for the first cell values in the column.

getColumnCount()[source]

Returns the number of columns in the model.

getColumnName(columnIndex)[source]

Returns the name of the column at columnIndex.

returns a set of columns if key is a slice.

getColumnNames()[source]

Returns the column names.

getRowCount()[source]

Returns the number of rows in the model.

getValueAt(rowIndex, columnIndex)[source]

Returns the value for the cell at columnIndex and rowIndex.

isCellEditable(rowIndex, columnIndex)[source]

Returns true if the cell at rowIndex and columnIndex is editable.

setValueAt(value, rowIndex, columnIndex)[source]

Sets the value in the cell at columnIndex and rowIndex to Value.

fdi.dataset.tabledataset.maybe2rows(header_names, units, col_width, sep='.', one_row=False, linebreak='\n')[source]

makes one-row or two-row column headers

Sep:

a string of separator characters to split header into two fragments. a header only uses the first matching char from left. Grouping does not distinguish which sep-char was used to split a header. Example: ‘.’ (default), ‘._/’

One_row:

Force one row but add line breaks at sep

fdi.dataset.tabledataset_datamodel module

fdi.dataset.testproducts module

class fdi.dataset.testproducts.DemoProduct(*args, **kwds)[source]

Bases: MapContext

class fdi.dataset.testproducts.SP(description='UNKNOWN', typ_='SP', creator='UNKNOWN', version='9', creationDate=FineTime(1958-01-01T00:00:00.000000), rootCause='UNKNOWN', startDate=FineTime(1958-01-01T00:00:00.000000), endDate=FineTime(1958-01-01T00:00:00.000000), instrument='UNKNOWN', modelName='UNKNOWN', mission='_AGS', zInfo=None, **kwds)[source]

Bases: Product

A subclass of Product for tests.

Initializes instances with more metadata as attributes, set to default values.

Put description keyword argument here to allow e.g. BaseProduct(“foo”) and description=’foo’

class fdi.dataset.testproducts.TB(*args, **kwds)[source]

Bases: BaseProduct

class fdi.dataset.testproducts.TC(*args, **kwds)[source]

Bases: Context

class fdi.dataset.testproducts.TCC(*args, **kwds)[source]

Bases: TC

class fdi.dataset.testproducts.TM(*args, **kwds)[source]

Bases: MapContext

class fdi.dataset.testproducts.TP(*args, **kwds)[source]

Bases: Product

Initializes instances with more metadata as attributes, set to default values.

Put description keyword argument here to allow e.g. BaseProduct(“foo”) and description=’foo’

class fdi.dataset.testproducts.TP_0X(*args, **kwds)[source]

Bases: TP

Initializes instances with more metadata as attributes, set to default values.

Put description keyword argument here to allow e.g. BaseProduct(“foo”) and description=’foo’

fdi.dataset.testproducts.get_demo_product(desc='')[source]

A complex context product as a reference for testing and demo.

|__ meta                                          <MetaData>
|__ description <string>
|__ type <string>
|__ level <string>
|__ creator <string>
|__ creationDate <finetime>
|__ rootCause <string>
|__ version <string>
|__ FORMATV <string>
|__ speed <vector>
__ listeners <ListenerSet>

|__ measurements <CompositeDataset> | |__ meta <MetaData> | | __ listeners <ListenerSet> | |__ Time_Energy_Pos <TableDataset> (5, 20) | | |__ meta <MetaData> | | | |__ description <string> | | | |__ shape <tuple> | | | |__ type <string> | | | |__ version <string> | | | |__ FORMATV <string> | | | __ listeners <ListenerSet> | | |__ Time <Column> (20,) | | |__ Energy <Column> (20,) | | |__ Error <Column> (20,) | | |__ y <Column> (20,) | | __ z <Column> (20,) | |__ calibration <ArrayDataset> (11, 11) | __ dset <str> |__ Environment Temperature <ArrayDataset> (7,) |__ Browse <image/png> (5976,) |__ refs <RefContainer> | |__ a_reference <ProductRef> | __ a_different_name <ProductRef> |__ history <History> | |__ PARAM_HISTORY <str> | |__ TASK_HISTORY <str> | __ meta <MetaData> | __ listeners <ListenerSet> __ listeners <ListenerSet>

fdi.dataset.testproducts.makeCal2D(width=11, height=11)[source]

fdi.dataset.typecoded module

class fdi.dataset.typecoded.Typecoded(typecode=None, **kwds)[source]

Bases: object

Has internal store type specified as TypeCode. ref doc of drray.Array.

Has a typecode.

Typecode is defined in array.array

__init__(typecode=None, **kwds)[source]

Has a typecode.

Typecode is defined in array.array

getTypecode()[source]

Returns the typecode related to this object.

setTypecode(typecode)[source]

Sets the typecode of this object.

property typecode

fdi.dataset.typed module

class fdi.dataset.typed.Typed(typ_=None, **kwds)[source]

Bases: object

An object of specifiable kinds.

This class is for parameters, not for products/datasets to make ‘type’ MDP.

Has a type.

__init__(typ_=None, **kwds)[source]

Has a type.

getType()[source]

Returns the actual type that is allowed for the value of this Parameter.

setType(typ_)[source]

Replaces the current type of this parameter.

property type

for property getter

fdi.dataset.unstructureddataset module

class fdi.dataset.unstructureddataset.UnstructuredDataset(data=None, description=None, typ_=None, doctype=None, version=None, zInfo=None, alwaysMeta=True, **kwds)[source]

Bases: Dataset, Copyable

Container for data without pre-defined structure or organization..

MetaDataListener must stay to the left of AbstractComposite.

For xmltodict xml_attribs default to `False`.

Accepts keyword args to xmltodict, e.g. xml_attribs, attr_prefix and cdata_key.

__init__(data=None, description=None, typ_=None, doctype=None, version=None, zInfo=None, alwaysMeta=True, **kwds)[source]

Accepts keyword args to xmltodict, e.g. xml_attribs, attr_prefix and cdata_key.

getData()[source]

Optimized for _data being initialized to be _data by DataWrapper.

make_meta(print=False, **kwds)[source]
put(data, doctype=None, **kwds)[source]

Put data in the dataset.

Depending on doctype: * Default is None for arbitrarily nested Pyton data structure. * Use ‘json’ to have the input string loaded by json.loads, * ‘xml’ by xmltodict.parse.

fdi.dataset.unstructureddataset_datamodel module

fdi.dataset.vattribute module

fdi.dataset.yaml2python module

fdi.dataset.yaml2python.dependency_sort(descriptors)[source]

sort the descriptors so that everyone’s parents are to his right.

fdi.dataset.yaml2python.descriptor_mro_cmp(nc1, nc2, des)[source]

find if nc1 is a subclasss of nc1.

cn1str

classname

cn2str

classname

Returns:

  • int – Returns -1 if class by the name of cn2 is a parent that of cn1 or its parent,

  • 0 if c1 and c2 are the same class; 1 for c1 being superclasses or no relation. This is to be used by cmp_to_key so besides having to return a negative number if mro(nc1) < mro(nc2), it cannot return None for invalid situations.

fdi.dataset.yaml2python.get_Python(val, indents, demo, onlyInclude, debug=False)[source]

make Model and init__() code strings from given data.

fdi.dataset.yaml2python.get_projectclasses(clp, exclude=None, verbose=False)[source]

return a Classes object that is going to give {class-name:class-type} from a file at gieven location.

Parameters:
  • clp: path of the mapping file.

  • rerun, exclude: from Classes

Return type:

The classes.Classes object.

fdi.dataset.yaml2python.inherit_from_parents(parentNames, attrs, datasets, schema, seen)[source]

inherit metadata and datasets from parents.

Attrs:

metadata descriptor of the child

Datasets:

datasets descriptor of the child

Seen:

a dict holding class names that the py file is going to import

fdi.dataset.yaml2python.make_init_code(dt, pval)[source]

python instanciation source code.

will be like “default: FineTime1(0)” in ‘def __init__(self…’

fdi.dataset.yaml2python.mro_cmp(cn1, cn2)[source]

compare two classes by their MRO relative positions.

Parameters:
  • cn1 (str) – classname

  • cn2 (str) – classname

Returns:

  • int – Returns -1 if class by the name of cn2 is a parent that of cn1,

  • 0 if c1 and c2 are the same class; 1 for c1 being superclasses or no relation.

fdi.dataset.yaml2python.no_Parents_Parents(pn)[source]

return a subset of class names such that no member is any other’s parent.

Parameters:

pn: list of class names.

Return type:

list of non-parents.

fdi.dataset.yaml2python.output(nm, d, fins, version, dry_run=False, verbose=False)[source]
fdi.dataset.yaml2python.params(val, indents, demo, onlyInclude, debug=False)[source]

generates python strng for val, a parameter with a set of attributes

val: as in `name:val` ``` nam:

data_type: string description: Description of this parent_dataset default: UNKNOWN valid: ‘’

``` see get_Python

fdi.dataset.yaml2python.read_yaml(ypath, version=None, verbose=False)[source]

read YAML files in ypath.

Returns:

nm is stem of file name. desc is descriptor, key being yaml[name]

Return type:

tuple

fdi.dataset.yaml2python.remove_Parent(a, b)[source]

Returns the one who is the other one’s parent. :Parameters: * a: a class name

  • b: a class name

Return type:

classname if found or None.

fdi.dataset.yaml2python.sq(s)[source]

add quote mark to string, depending on if ‘ or ” in the string.

fdi.dataset.yaml2python.yaml_upgrade(descriptors, fins, ypath, version, dry_run=False, verbose=False)[source]
Parameters:
  • descriptors: a list of nested dicts describing the data model.

  • version: current version. not that in the yaml to be modified.