pysdic.Connectivity.from_dict#

classmethod Connectivity.from_dict(data, *, load_properties=True, element_type=None)[source]#

Create a connectivity from a dictionary.

The dictionary must contain the key "elements" with an array of shape \((N_e, N_{vpe})\). The properties are read from the keys "_property/{property_name}", and the element type from the optional key "element_type" (a string, or an array with one string as written by the NPZ and HDF5 serializers).

Note

The dictionary is flat (one level), as required by the NPZ format. See pysdic.core.serialization.NpzSerializerMixin.

Parameters:
  • data (Dict[str, Any]) – The dictionary to read.

  • load_properties (bool, optional (default: True)) – If False, the properties are ignored.

  • element_type (Optional[str], optional (default: None)) – The expected element type. If the dictionary also defines one, both must be the same.

Returns:

The new connectivity.

Return type:

pysdic.Connectivity