mendevi.database.meta.Extractor

class mendevi.database.meta.Extractor(legend: str, func: Callable | str, scale: Scale)[source]

Correctly define a variable in a context.

Examples

>>> from mendevi.database.meta import Scale, Extractor
>>> Extractor("legend", "func", Scale.DISCRETE)
Extractor('legend', 'func', Scale.DISCRETE)
>>> {**_}
{'legend': 'legend', 'func': 'func', 'scale': <Scale.DISCRETE: 4>}
>>>

Create a dictlike named tuple.

property func: Callable | str

Return the function or the expression to compute the variable.

property legend: str

Return the description.

property scale: Scale

Return the kind of variable.