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

Problem: mandatory keyword restriction is forced #45

Closed mehdisadeghi closed 7 years ago

mehdisadeghi commented 7 years ago

This PR disables mandatory keyword restriction on data property of CUDS classes. In order to have restriction, one must do it manually:

RestrictedDataContainer = create_data_container(Material.supported_parameters())
rdc = RestrictedDataContainer()
rdc[CUBA.NAME] = 'myname'
m1 = Material(data=rdc)
m2 = Material()
m1.data[CUBA.MASS] = 1.0 # Not allowed
m2.data[CUBA.MASS] = 1.0 #Allowed by default

Solution: disable it.

mehdisadeghi commented 7 years ago

Related PR: https://github.com/simphony/simphony-common/pull/293