Source code for asdf_astropy.converters.time.time_delta

from asdf.extension import Converter


[docs] class TimeDeltaConverter(Converter): tags = ("tag:astropy.org:astropy/time/timedelta-*",) types = ("astropy.time.core.TimeDelta",)
[docs] def to_yaml_tree(self, obj, tag, ctx): return obj.info._represent_as_dict()
[docs] def from_yaml_tree(self, node, tag, ctx): from astropy.time.core import TimeDelta return TimeDelta.info._construct_from_dict(node)