Skip to content

Commit c0ac520

Browse files
committed
op
1 parent abfadb5 commit c0ac520

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

petab/v1/calculate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Functions performing various calculations."""
22

33
import numbers
4+
import operator
45
from functools import reduce
56

67
import numpy as np
@@ -364,7 +365,7 @@ def calculate_llh_for_table(
364365
(simulation_df[col] == row[col]) | petab.is_empty(row[col])
365366
for col in compared_cols
366367
]
367-
mask = reduce(lambda x, y: x & y, masks)
368+
mask = reduce(operator.and_, masks)
368369

369370
simulation = simulation_df.loc[mask][SIMULATION].iloc[0]
370371

petab/v2/calculate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Functions performing various calculations."""
22

33
import numbers
4+
import operator
45
from functools import reduce
56

67
import numpy as np
@@ -121,7 +122,7 @@ def calculate_residuals_for_table(
121122
(simulation_df[col] == row[col]) | is_empty(row[col])
122123
for col in compared_cols
123124
]
124-
mask = reduce(lambda x, y: x & y, masks)
125+
mask = reduce(operator.and_, masks)
125126
if mask.sum() == 0:
126127
raise ValueError(
127128
f"Could not find simulation for measurement {row}."

0 commit comments

Comments
 (0)