def from_tree_transform(cls, node, ctx): if cls.version < AsdfVersion('1.4.0'): # The 'dimensions' property was added in 1.4.0, # previously all values were 1D. return functional_models.Const1D(node['value']) elif node['dimensions'] == 1: return functional_models.Const1D(node['value']) elif node['dimensions'] == 2: return functional_models.Const2D(node['value'])
def from_tree_transform(cls, node, ctx): if cls.version < AsdfVersion('1.4.0'): # The 'dimensions' property was added in 1.4.0, # previously all values were 1D. return functional_models.Const1D(node['value']) elif node['dimensions'] == 1: return functional_models.Const1D(node['value']) elif node['dimensions'] == 2: return functional_models.Const2D(node['value']) else: raise TypeError('Only 1D and 2D constant models are supported.')
def from_tree_transform(cls, node, ctx): if node['dimensions'] == 1: return functional_models.Const1D(node['value']) elif node['dimensions'] == 2: return functional_models.Const2D(node['value'])