Esempio n. 1
0
 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'])
Esempio n. 2
0
 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.')
Esempio n. 3
0
 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'])