Skip to content

refactor(collection)!: rename DatasetCollection.create_cube to from_dataset #954

Description

@MAfarrag

Context

DatasetCollection's in-memory template factory was named create_cube, which (a) uses the outdated "cube" term for a
class now called DatasetCollection, and (b) sits apart from the from_* reader family (from_files, from_stac,
from_zarr, from_point, from_archive). Its first parameter was the generic src.

Problem / Current Behaviour

DatasetCollection.create_cube(src, time_length) is inconsistent with every other constructor and easy to confuse with
Dataset.create (a different classmethod).

Affected locations

File Symbol Notes
src/pyramids/dataset/collection.py DatasetCollection.create_cube rename to from_dataset; src -> dataset
tests, docs/pyramids.drawio, tutorials call sites update to the new name

Proposed Solution

DatasetCollection.from_dataset(dataset: Dataset, time_length: int) -> DatasetCollection

Hard rename (no deprecation alias); Dataset.create is untouched.

Out of Scope

Any behavioural change to the in-memory scaffold; only the name/param.

Effort Estimate

Size: XS — mechanical rename + call-site sweep.

Definition of Done

  • create_cube renamed to from_dataset, src -> dataset
  • all call sites (src, tests, docs, drawio) updated
  • existing tests pass

Implemented in PR #951.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions