Skip to content

Commit

Permalink
PropertyLayer: Remove unnecessary check in aggregate_property
Browse files Browse the repository at this point in the history
Whether it's a Lambda function or NumPy ufunc, they can be called the same way.
  • Loading branch information
EwoutH committed Dec 4, 2023
1 parent 5f34480 commit 7b9310c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions mesa/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,14 +661,7 @@ def aggregate_property(self, operation):
Args:
operation: A function to apply. Can be a lambda function or a NumPy ufunc.
"""

# Check if the operation is a lambda function or a NumPy ufunc
if is_lambda_function(operation):
# Lambda function case
return operation(self.data)
else:
# NumPy ufunc case
return operation(self.data)
return operation(self.data)


class _PropertyGrid(_Grid):
Expand Down

0 comments on commit 7b9310c

Please sign in to comment.