implemented derivation of gradient weights via rotation
derive gradient weights of other direction with already calculated weights of one direction via rotation and apply them to a field.
Merge request reports
Activity
For the 2D case in the as_matrix function the result is converted from a MutableDenseNDimArray to a MutableDenseMatrix to keep the compatibility in the test cases since MutableDenseMatrix can not be used for 3D cases. I am not sure whether it is better to change the datatype to MutableDenseNDimArray in general. Working with both types might lead to inconsistency problems somewhere sometime.
code snippet where the datatype is changed in derivation.py:
result = sp.MutableDenseNDimArray([0] * number_of_elements, shape) if dim == 2: for direction, weight in zip(self.stencil, self.weights): result[max_offset - direction[1], max_offset + direction[0]] = weight result = result.tomatrix()
We could rename the function you implemented to
as_array
. This function could consistently return aDenseNDimArray
. The oldas_matrix
function can be deprecated then by using a deprecation warning.All tests should then also use the new
as_array
function.added 1 commit
- 248a5e0d - implemented derivation of gradient weights via rotation
mentioned in commit dc8453b3
mentioned in issue #8 (closed)