simphony / simphony-metadata

[LEGACY] This repository contains the metadata definitions used in SimPhoNy project.
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

The generator should consider shape of a CUDS entity along with its CUBA type #32

Closed mehdisadeghi closed 7 years ago

mehdisadeghi commented 8 years ago

Consider definition of the Box:

  BOX:
    definition: A simple hexahedron box object
    parent: CUBA.BOUNDARY
    CUBA.VECTOR:
      shape: (3, 3)
      default: [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
      scope: CUBA.USER

and the VECTOR:

  VECTOR:
    definition: A vector in 3D geometric space
    shape: [3]
    type: double

The shape of the box should be (3) but at the moment generator does not accept this value; because the given value for default has dimension of (3, 3).

The generator needs a patch to consider both shapes defined in the higher level CUDS structure along with the shape of the CUBA type at the same time.

I think we have to add the shape defined in BOX to the shape defined in the cuba.yaml file for VECTOR and then validate the value for default against it. Therefore, a shape of (3) for BASIS.CUBA.VECTOR would imply a real shape of (3, 3) for it.

This issue was first discussed here.

stefanoborini commented 7 years ago

This is fixed in the 0.5.0.dev0 simphony-common generator