Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 341c650

Browse files
committedMar 30, 2023
Avoid calling copy_provenance n(n-1) times
1 parent ee6779a commit 341c650

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎esmvalcore/preprocessor/_mask.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -508,9 +508,10 @@ def _multimodel_mask_products(products, shape):
508508
new_mask = da.ma.getmaskarray(cube.core_data())
509509
mask |= new_mask
510510
if da.any(new_mask):
511-
used_products.add(product.copy_provenance())
511+
used_products.add(product)
512512

513513
# Apply common mask and update provenance information
514+
used_products = {p.copy_provenance() for p in used_products}
514515
for product in products:
515516
for cube in product.cubes:
516517
cube.data = da.ma.masked_array(cube.core_data(), mask=mask)

0 commit comments

Comments
 (0)
Please sign in to comment.