Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Teye #485

Merged
merged 8 commits into from Sep 27, 2023
Merged

Fixed Teye #485

merged 8 commits into from Sep 27, 2023

Conversation

zaidmahmood
Copy link
Contributor

Fixed an issue where mass matrix was not being updated in set() call.

@cuihantao
Copy link
Collaborator

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

@cuihantao
Copy link
Collaborator

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.

@cuihantao
Copy link
Collaborator

I added new tests for the change. The test failed due to another unrelated issue. Please take a look at the file changes.

@cuihantao cuihantao merged commit 095ae59 into CURENT:develop Sep 27, 2023
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants