Closed zaidmahmood closed 9 months ago
Github is now showing my code review. Pasting it here:
uid_int = state.a[uid].item()
self.system.TDS.Teye[uid_int, uid_int] = instance.v[uid]
This will fail when uid is an array of more than one element. In that case, uid_int will be a list of multiple elements. Teye[uid_int, uid_int] will be a copy of the square sparse matrix, which cannot be assigned a list (instance.v[uid]).
I guess what you will need is a list comprehension or a for loop. @zaidmahmood
The new change does not account for an np.ndarray
type of input. Also, the program should fail explicitly if the input does not match any of the conditions, i.e., in addition to if-elif
, we need an else
.
I added new tests for the change. The test failed due to another unrelated issue. Please take a look at the file changes.
Fixed an issue where mass matrix was not being updated in set() call.