Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PropertyLayer: Fix handling of 'condition' callable in set_cells
Resolved an inconsistency in the set_cells method of our grid class. The method's documentation stated that the 'condition' argument should be a callable (such as a lambda function or a NumPy ufunc), but the implementation incorrectly treated 'condition' as a NumPy array. This update rectifies the implementation to align with the documented behavior. Now, the 'condition' argument is correctly called with the grid data as input, and its output (expected to be a boolean array) is used for conditional in-place updates of the grid. This change ensures that the function operates correctly when provided with callable conditions, fulfilling the intended functionality. Includes: - Calling 'condition' with self.data and using its output for conditional updates. - Adjusted error handling to check the output of the callable, ensuring it's a NumPy array with the correct shape. - Updated comments within the method for clarity.
- Loading branch information