vortex_torch.flow.loader

Functions

build_vflow(selected[, init_kwargs, user_file])

Build a vFlow instance from a previously registered class.

Exceptions

FlowInitError

Errors while validating or constructing the flow instance.

FlowLoadError

Errors while loading/exec user modules or resolving classes.

exception vortex_torch.flow.loader.FlowLoadError[source]

Bases: Exception

Errors while loading/exec user modules or resolving classes.

exception vortex_torch.flow.loader.FlowInitError[source]

Bases: Exception

Errors while validating or constructing the flow instance.

vortex_torch.flow.loader.build_vflow(selected, init_kwargs=None, user_file=None)[source]

Build a vFlow instance from a previously registered class.

Parameters:
  • selected (str) – Registration key identifying which subclass to instantiate.

  • init_kwargs (Dict[str, Any] | None) – Dict of constructor kwargs for the subclass.

  • user_file (str | None) – Optional absolute path to a user file to execute first, so that any new registrations inside it take effect.

Return type:

vFlow

Behavior:
  • If user_file is provided, it will be executed (imported) to trigger any @register(…) calls inside the file.

  • Then we fetch the class from the global registry by ‘selected’.

  • We validate constructor kwargs and instantiate the class.

Raises:
  • FlowLoadError – When file import fails or selected key is missing.

  • FlowInitError – When constructor validation/instantiation fails.

Parameters:
Return type:

vFlow