The common.py
module#
Summary#
Contains strings to define elemental property fields. |
|
Contains strings to define nodal property fields. |
|
Contains strings to define face property fields. |
|
Contains strings to define configuration options. |
|
Contains Python definition labels. |
|
Custom progress bar implementation based on tqdm. |
|
Return the superclass name for a key if not found initially. |
The |
|
The |
|
Contains data identifying shell layers. |
Return a mapping of enums and corresponding python or dpf types. |
|
Return dpf types mapped to internal object keywords. |
|
Return dpf type mapped to special dpf constructors. |
|
Return a mapping of derived class names to their corresponding Python classes. |
|
Record a new derived class in the mapping of class names to their corresponding Python classes. |
|
Create a server instance of a given type. |
Description#
Common.
Module detail#
- common.types_enum_to_types()#
Return a mapping of enums and corresponding python or dpf types.
- Returns:
Mapping of enum to the corresponding type.
- Return type:
dict
- common.type_to_internal_object_keyword()#
Return dpf types mapped to internal object keywords.
- Returns:
Custom dictionary that returns superclass name for a key if not found initially.
- Return type:
- common.type_to_special_dpf_constructors()#
Return dpf type mapped to special dpf constructors.
- common.derived_class_name_to_type() Dict[str, type] #
Return a mapping of derived class names to their corresponding Python classes.
- Returns:
A dictionary mapping derived class names (str) to their corresponding Python class objects.
- Return type:
dict[str, type]
- common.record_derived_class(class_name: str, py_class: type, overwrite: bool = False)#
Record a new derived class in the mapping of class names to their corresponding Python classes.
This function updates the global dictionary that maps derived class names (str) to their corresponding Python class objects (type). If the provided class name already exists in the dictionary, it will either overwrite the existing mapping or leave it unchanged based on the overwrite flag.
- Parameters:
class_name (str) – The name of the derived class to be recorded.
py_class (type) – The Python class type corresponding to the derived class.
overwrite (bool, optional) – A flag indicating whether to overwrite an existing entry for the class_name. If True, the entry will be overwritten. If False (default), the entry will not be overwritten if it already exists.
- common.create_dpf_instance(type, internal_obj, server)#
Create a server instance of a given type.