Skip to content

Support Dataset Addition for PangaeaDatasets #37

@doswal

Description

@doswal

Description

Currently, PyleoTUPS supports the addition of multiple NOAADatasets using the + and += operators. To ensure consistency across the library, we need to implement similar functionality for Pangaea datasets.

This will allow users to merge or combine Pangaea data objects using intuitive Pythonic syntax, improving the developer experience and maintaining parity with the existing NOAADataset implementation.

Current Behavior

Attempting to use + or += with Pangaea objects currently results in a TypeError (or lacks the intended merging logic), whereas NOAADatasets can be combined as follows:

# Example of existing NOAA functionality
combined_noaa = dataset_a + dataset_b
dataset_a += dataset_c

Proposed Changes

Implement the following methods within the Pangaea dataset class:

  • add(self, other): Define logic to merge two Pangaea datasets and return a new instance.

  • iadd(self, other): Define logic for in-place addition/updates to an existing Pangaea instance.

Requirements

  • Consistency: The merging logic (e.g., handling of metadata, coordinates, or overlapping data) should mirror the behavior of the NOAADataset addition where applicable.
  • Validation: Ensure that only compatible Pangaea objects (or supported types) can be added together.
  • Documentation: Update the docstrings for the Pangaea class to reflect these new capabilities.
  • Tests: Add unit tests to verify:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions