Usage
Identifying a dataset
Reading datasets
Base.read
— Functionread(filename::AbstractString, DataCollection; writer::Union{Function, Nothing})
Read the entire contents of a file as a DataCollection
.
The default value of writer is self -> write(filename, self)
.
read(io::IO, DataCollection; path::Union{String, Nothing}=nothing, mod::Module=Base.Main)
Read the entirety of io
, as a DataCollection
.
read(dataset::DataSet, as::Type)
read(dataset::DataSet) # as default type
Obtain information from dataset
in the form of as
, with the appropriate loader and storage provider automatically determined.
This executes this component of the overall data flow:
╭────loader─────╮
╵ ▼
Storage ◀────▶ Data Information
The loader and storage provider are selected by identifying the highest priority loader that can be satisfied by a storage provider. What this looks like in practice is illustrated in the diagram below.
read(dataset, Matrix) ⟶ ::Matrix ◀╮
╭───╯ ╰────────────▷┬───╯
╔═════╸dataset╺══════════════════╗ │
║ STORAGE LOADERS ║ │
║ (⟶ File)─┬─╮ (File ⟶ String) ║ │
║ (⟶ IO) ┊ ╰─(File ⟶ Matrix)─┬─╫──╯
║ (⟶ File)┄╯ (IO ⟶ String) ┊ ║
║ (IO ⟶ Matrix)╌╌╌╯ ║
╚════════════════════════════════╝
─ the load path used
┄ an option not taken
TODO explain further
Writing datasets
Base.write
— Functionwrite(dataset::DataSet, info::Any)
TODO write docstring
Accessing the raw data
Base.open
— Functionopen(dataset::DataSet, as::Type; write::Bool=false)
Obtain the data of dataset
in the form of as
, with the appropriate storage provider automatically selected.
A write
flag is also provided, to help the driver pick a more appropriate form of as
.
This executes this component of the overall data flow:
╭────loader─────╮
╵ ▼
Storage ◀────▶ Data Information