Chains

DataAxesFormats.Chains Module

View a chain of Daf data as a single data set. This allows creating a small Daf data set that contains extra (or overriding) data on top of a larger read-only data set. In particular this allows creating several such incompatible extra data sets (e.g., different groupings of cells to metacells), without having to duplicate the common (read only) data.

DataAxesFormats.Chains.chain_reader Function
chain_reader(dafs::AbstractVector{<:DafReader}; name::Maybe{AbstractString} = nothing)::DafReader

Create a read-only chain wrapper of DafReader s, presenting them as a single DafReader . When accessing the content, the exposed value is that provided by the last data set that contains the data, that is, later data sets can override earlier data sets. However, if an axis exists in more than one data set in the chain, then its entries must be identical. This isn't typically created manually; instead call chain_reader .

Note

While this verifies the axes are consistent at the time of creating the chain, it's no defense against modifying the chained data after the fact, creating inconsistent axes. Don't do that .

DataAxesFormats.Chains.chain_writer Function
chain_writer(dafs::AbstractVector{<:DafReader}; name::Maybe{AbstractString} = nothing)::DafWriter

Create a chain wrapper for a chain of DafReader data, presenting them as a single DafWriter . This acts similarly to chain_reader , but requires the final entry in the chain to be a DafWriter . Any modifications or additions to the chain are directed only at this final writer.

Note

Deletions are only allowed for data that exists only in the final writer. That is, it is impossible to delete from a chain something that exists in any of the readers; it is only possible to override it.

DataAxesFormats.Chains.ReadOnlyChain Type
struct ReadOnlyChain <: DafReadOnly ... end

A wrapper for a chain of DafReader data, presenting them as a single DafReadOnly . When accessing the content, the exposed value is that provided by the last data set that contains the data, that is, later data sets can override earlier data sets. However, if an axis exists in more than one data set in the chain, then its entries must be identical. This isn't typically created manually; instead call chain_reader .

DataAxesFormats.Chains.WriteChain Type
struct WriteChain <: DafWriter ... end

A wrapper for a chain of DafReader data, with a final DafWriter , presenting them as a single DafWriter . When accessing the content, the exposed value is that provided by the last data set that contains the data, that is, later data sets can override earlier data sets (where the writer has the final word). However, if an axis exists in more than one data set in the chain, then its entries must be identical. This isn't typically created manually; instead call chain_reader .

Any modifications or additions to the chain are directed at the final writer. Deletions are only allowed for data that exists only in this writer. That is, it is impossible to delete from a chain something that exists in any of the readers; it is only possible to override it.

DataAxesFormats.Chains.complete_chain! Function
complete_chain!(;
    base_daf::DafReader,
    new_daf::DafWriter,
    name::Maybe{AbstractString} = nothing,
    axes::Maybe{ViewAxes} = nothing,
    data::Maybe{ViewData} = nothing
)::DafWriter

Immediately after creating an empty disk based new_daf , chain it with a disk based base_daf and return the new chain. If axes and/or data are specified, the new_daf will be chained on top of a viewer of the base_daf .

This will set the base_daf_repository scalar property of the new_daf to point at the base_daf , and if view axes or data were specified, the base_daf_view as well. It should be therefore possible to recreate the chain by calling complete_daf in the future.

By default, the stored base path in the new_daf will be the relative path to the base_daf , for the common case where a group of repositories is stored under a common root. This allows this root to be renamed or moved somewhere else and still allow complete_daf to work. If absolute is set, then the stored base path will be the absolute path of the base_daf .

Index