WRApplication
External kratos "application" for multiscale time integration.
python_scripts.registry_utils Namespace Reference

Functions

def RegisterClass (type cls, str parent_path="", typing.Optional[str] class_name=None)
 Create a new item in the global registry for the provided class. More...
 
None RecursivelyRegisterClass (type cls, str parent_path)
 Add the provided class and its derived classes recursively to the RuntimeRegistry. More...
 
"dict[str,typing.Any]" GetRegistryEntry (str registered_path)
 
typing.Any GetRegisteredClass (str registered_path)
 
typing.Any RegisteredClassFactory (str registered_path, *args, **kwargs)
 Instantiate a class registered in RuntimeRegistry. More...
 
bool IsRegisteredPath (str path)
 Check whether the provided path exists in RuntimeRegistry. More...
 
None ImportAndRegister (str import_path, str registry_path)
 Import a class from a module and add it to RuntimeRegistry. More...
 

Detailed Description

Author
Máté Kelemen

Function Documentation

◆ GetRegisteredClass()

typing.Any python_scripts.registry_utils.GetRegisteredClass ( str  registered_path)

◆ GetRegistryEntry()

"dict[str,typing.Any]" python_scripts.registry_utils.GetRegistryEntry ( str  registered_path)

◆ ImportAndRegister()

None python_scripts.registry_utils.ImportAndRegister ( str  import_path,
str  registry_path 
)

Import a class from a module and add it to RuntimeRegistry.

Parameters
import_pathfull module path of the class to be imported.
registry_pathpath in the registry to add the imported class.

At least one level of module resolution is expected, meaning that import_path must contain at least one '.'.

◆ IsRegisteredPath()

bool python_scripts.registry_utils.IsRegisteredPath ( str  path)

Check whether the provided path exists in RuntimeRegistry.

◆ RecursivelyRegisterClass()

None python_scripts.registry_utils.RecursivelyRegisterClass ( type  cls,
str  parent_path 
)

Add the provided class and its derived classes recursively to the RuntimeRegistry.

◆ RegisterClass()

def python_scripts.registry_utils.RegisterClass ( type  cls,
str   parent_path = "",
typing.Optional[str]   class_name = None 
)

Create a new item in the global registry for the provided class.

The newly registered item is the following dict:

{
"type" : cls
}

◆ RegisteredClassFactory()

typing.Any python_scripts.registry_utils.RegisteredClassFactory ( str  registered_path,
args,
**  kwargs 
)

Instantiate a class registered in RuntimeRegistry.