WRApplication
External kratos "application" for multiscale time integration.
Loading...
Searching...
No Matches
python_scripts.registry_utils Namespace Reference

Functions

 RegisterClass (type cls, str parent_path="", typing.Optional[str] class_name=None)
 Create a new item in the global registry for the provided class.
 
None RecursivelyRegisterClass (type cls, str parent_path)
 Add the provided class and its derived classes recursively to the RuntimeRegistry.
 
"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.
 
bool IsRegisteredPath (str path)
 Check whether the provided path exists in RuntimeRegistry.
 
None ImportAndRegister (str import_path, str registry_path)
 Import a class from a module and add it to RuntimeRegistry.
 

Detailed Description

Author
Máté Kelemen

Function Documentation

◆ GetRegisteredClass()

typing.Any GetRegisteredClass ( str  registered_path)

◆ GetRegistryEntry()

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

◆ ImportAndRegister()

None 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 IsRegisteredPath ( str  path)

Check whether the provided path exists in RuntimeRegistry.

◆ RecursivelyRegisterClass()

None RecursivelyRegisterClass ( type  cls,
str  parent_path 
)

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

◆ RegisterClass()

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 RegisteredClassFactory ( str  registered_path,
args,
**  kwargs 
)

Instantiate a class registered in RuntimeRegistry.