zcollection.create_collection#
- zcollection.create_collection(axis, ds, partition_handler, partition_base_dir, **kwargs)[source]#
Create a collection.
- Parameters:
axis (str) – The axis to use for the collection.
partition_handler (Partitioning) – The partitioning handler to use.
partition_base_dir (str) – The base directory to use for the partitions.
**kwargs – Additional parameters are passed through to the constructor of the class
Collection
.
- Return type:
Example
>>> import xarray as xr >>> import zcollection >>> data = xr.Dataset({ ... "a": xr.DataArray([1, 2, 3]), ... "b": xr.DataArray([4, 5, 6]) ... }) >>> collection = zcollection.create_collection( ... "a", data, ... zcollection.partitioning.Sequence(("a", )), ... "/tmp/my_collection")
- Returns:
The collection.
- Raises:
ValueError – If the base directory already exists.
- Parameters:
axis (str) –
partition_handler (Partitioning) –
partition_base_dir (str) –
- Return type: