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:
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:
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