Skip to content

Commit

Permalink
Remove unused 'unique' option from load-collection combine methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
pp-mo committed Feb 20, 2025
1 parent 7abd9ee commit ac3137c
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions lib/iris/loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,17 @@ def add(self, cube):
if sub_cube is not None:
self.cubes.append(sub_cube)

def combined(self, unique=False):
def combined(self):
"""Return a new :class:`_CubeFilter` by combining the list of cubes.
Combines the list of cubes with :func:`~iris._combine_load_cubes`.
Parameters
----------
unique : bool, default=False
If True, raises `iris.exceptions.DuplicateDataError` if
duplicate cubes are detected.
"""
from iris._combine import _combine_load_cubes

return _CubeFilter(
self.constraint,
_combine_load_cubes(self.cubes, merge_require_unique=unique),
_combine_load_cubes(self.cubes),
)


Expand Down Expand Up @@ -110,19 +104,13 @@ def cubes(self):
result.extend(pair.cubes)
return result

def combined(self, unique=False):
def combined(self):
"""Return a new :class:`_CubeFilterCollection` by combining all the cube lists of this collection.
Combines each list of cubes using :func:`~iris._combine_load_cubes`.
Parameters
----------
unique : bool, default=False
If True, raises `iris.exceptions.DuplicateDataError` if
duplicate cubes are detected.
"""
return _CubeFilterCollection([pair.combined(unique) for pair in self.pairs])
return _CubeFilterCollection([pair.combined() for pair in self.pairs])


def _load_collection(uris, constraints=None, callback=None):
Expand Down Expand Up @@ -203,7 +191,7 @@ def load_cube(uris, constraint=None, callback=None):
if len(constraints) != 1:
raise ValueError("only a single constraint is allowed")

cubes = _load_collection(uris, constraints, callback).combined(unique=False).cubes()
cubes = _load_collection(uris, constraints, callback).combined().cubes()

try:
# NOTE: this call currently retained to preserve the legacy exceptions
Expand Down

0 comments on commit ac3137c

Please sign in to comment.