Collect variables and indexes to be merged from Coordinate objects.
(
list_of_coords: list[Coordinates],
)
| 419 | |
| 420 | |
| 421 | def collect_from_coordinates( |
| 422 | list_of_coords: list[Coordinates], |
| 423 | ) -> dict[Hashable, list[MergeElement]]: |
| 424 | """Collect variables and indexes to be merged from Coordinate objects.""" |
| 425 | grouped: dict[Hashable, list[MergeElement]] = defaultdict(list) |
| 426 | |
| 427 | for coords in list_of_coords: |
| 428 | variables = coords.variables |
| 429 | indexes = coords.xindexes |
| 430 | for name, variable in variables.items(): |
| 431 | grouped[name].append((variable, indexes.get(name))) |
| 432 | |
| 433 | return grouped |
| 434 | |
| 435 | |
| 436 | def merge_coordinates_without_align( |
no test coverage detected
searching dependent graphs…