zcollection.view.View#
- class zcollection.view.View(base_dir, view_ref, *, ds, filesystem=None, filters=None, synchronizer=None)[source]#
Bases:
object
View on a reference collection.
- Parameters:
base_dir (str) – Path to the directory where the view is stored.
view_ref (ViewReference) – Access properties for the reference view.
ds (meta.Dataset | None) – The dataset handled by this view.
filesystem (fsspec.AbstractFileSystem | str | None) – The file system used to access the view.
filters (collection.PartitionFilter) – The filters used to select the partitions of the reference. If not provided, all partitions are selected.
synchronizer (sync.Sync | None) – The synchronizer used to synchronize the view.
Note
Normally, you should not call this constructor directly. Instead, use
create_view
oropen_view
to create or open a view.Attributes
Configuration filename of the view.
The file system used to access the view (default local file system).
Path to the directory where the view is stored.
The reference collection of the view.
The metadata of the variables handled by the view.
The synchronizer used to synchronize the view.
The filters used to select the partitions of the reference.
Public Methods
add_variable
(variable)Add a variable to the view.
drop_variable
(varname)Drop a variable from the view.
from_config
(path, *[, filesystem, synchronizer])Open a View described by a configuration file.
Check if the view is synchronized with the underlying collection.
load
(*[, delayed, filters, indexer, ...])Load the view.
map
(func, /, *args[, delayed, filters, ...])Map a function over the partitions of the view.
map_overlap
(func, /, *args[, depth, ...])Map a function over the partitions of the view with some overlap.
partitions
([filters])Returns the list of partitions in the view.
sync
([filters])Synchronize the view with the underlying collection.
update
(func, /, *args[, depth, delayed, ...])Update a variable stored int the view.
variables
([selected_variables])Return the variables of the view.
Protected Methods
_config
(base_dir)Returns the configuration path.
_init_partitions
(filters)Initialize the partitions of the view.
Write the configuration file for the view.
Special Methods
__str__
()Return str(self).