Skip to content

Commit 07b23fe

Browse files
committed
Streamline MappingAdapter.adapt()
1 parent 8f86b6b commit 07b23fe

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

message_ix_models/util/common.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,7 @@ def adapt(self, qty: "TQuantity") -> "TQuantity":
156156
result = qty
157157
coords = qty.coords
158158

159-
for dim, labels in self.maps.items():
160-
if dim not in qty.dims:
161-
continue
162-
159+
for dim, labels in filter(lambda dl: dl[0] in qty.dims, self.maps.items()):
163160
dim_coords = set(coords[dim].data)
164161

165162
# Check for coords in the data that are missing from `maps`.

0 commit comments

Comments
 (0)