In Memory Adapter Class#

class expectmine.storage.adapters.in_memory_adapter.InMemoryStoreAdapter(persistent_path: Path, working_directory: Path, **kwargs: Dict[Any, Any])[source]#

Bases: BaseStoreAdapter

Pipeline storage adapter for InMemoryStorage.

__init__(persistent_path: Path, working_directory: Path, **kwargs: Dict[Any, Any])[source]#

Creates a factory for producing scoped storages.

Parameters:
  • persistent_path (Path) – The path which the storage can use to persist data.

  • working_directory (Path) – The path which the storage can use to create temporary files in for the user or pipeline to access.

Example:

>>> BaseAdapter(Path("path1"), Path("path2"))
BaseAdapter
>>> BaseAdapter(Path("path2"))
ValueError("Storage paths can not be empty.")
Raises:
  • TypeError – If the arguments have the wrong type.

  • ValueError – If either step name or any of the paths are empty.

get_instance(step_name: str, *args: List[Any], **kwargs: Dict[Any, Any]) BaseStore[source]#

Produces a scoped instance of type BaseStorage.

Parameters:

step_name (str) – The scope of the instance

Returns:

A scoped instance of a store.

Return type:

BaseStore

Example:

>>> get_instance("Instance 1")
BaseStore
>>> get_instance("")
ValueError("Step name can not be empty.")
Raises:
  • TypeError – If the arguments have the wrong type.

  • ValueError – If step name is too long or empty.