Source code for asdf.tags.core.constant

from ...types import AsdfType


class Constant:
    def __init__(self, value):
        self._value = value

    @property
    def value(self):
        return self._value


[docs]class ConstantType(AsdfType): name = "core/constant" version = "1.0.0" types = [Constant]
[docs] @classmethod def from_tree(cls, node, ctx): return Constant(node)
[docs] @classmethod def to_tree(cls, data, ctx): return data.value