tiledbsoma.SOMATileDBContext.__init__¶
- SOMATileDBContext.__init__(tiledb_config: dict[str, str | float] | None = None, tiledb_ctx: Any | None = None, timestamp: int | datetime | None = None, threadpool: ThreadPoolExecutor | None = None) None¶
Initializes a new SOMATileDBContext.
Either
tiledb_configortiledb_ctxmay be provided, or both may be left at their default.If a
tiledb_configis provided (in the form of adict), it is used to construct a newSOMAContext.If a `tiledb_ctx` is provided, then it uses the configuration options to construct a new
SOMAContext. Note thatSOMAContextwill create a newContextobject. Thetiledb_ctxoption is only available if the tiledb module is installed; otherwise, it will throw a``ModuleNotFoundError.If neither are provided, this will use a single shared
SOMAContextinstantiated upon first use.- Parameters:
tiledb_config – A set of TileDB configuration options to use, overriding the default configuration.
tiledb_ctx – A TileDB Context where the set of TileDB configuration options are used to override the default configuration.
timestamp –
The default timestamp for operations on SOMA objects, provided either as a
datetime.datetimeor a number of milliseconds since the Unix epoch.WARNING: This should not be set unless you are absolutely sure you want to use the same timestamp across multiple operations. If multiple writes to the same object are performed at the same timestamp, they have no defined order. In almost all cases, it is better to pass a timestamp to a single
opencall, or to simply use the default behavior.This is used when a timestamp is not provided to an
openoperation.None, the default, sets the timestamp on each rootopenoperation. That is, if youopena collection, and access individual members of the collection through indexing oradd_new, the timestamp of all of those operations will be that of the time you calledopen.If a value is passed, that timestamp is used as the timestamp to record all operations.
Set to 0xFFFFFFFFFFFFFFFF (UINT64_MAX) to get the absolute latest revision (i.e., including changes that occur “after” the current wall time) as of when each object is opened.
threadpool – A threadpool to use for concurrent operations. If not provided, a new ThreadPoolExecutor will be created with default settings.