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

77 improve matrix class #112

Merged
merged 17 commits into from
Jun 6, 2024
Merged

77 improve matrix class #112

merged 17 commits into from
Jun 6, 2024

Conversation

samvanderzwan
Copy link
Contributor

Refactored the matrix class to use

  • Sparse matrix solver
  • Numpy arrays

@samvanderzwan samvanderzwan linked an issue Apr 26, 2024 that may be closed by this pull request
Copy link
Contributor

@vanmeerkerk vanmeerkerk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Sam,

Some minor comments. I believe we should implement the numpy supported testing routines when we use arrays in tests. Also I would like you to add some more descriptive text near the sparse matrix conversion routines.

A discussion point might be the small formatting changes required when we touch classes. I would suggest to revise the class inititialization when we make small changes. What do you think?

src/simulator_core/solver/matrix/matrix.py Show resolved Hide resolved
src/simulator_core/solver/matrix/matrix.py Outdated Show resolved Hide resolved
src/simulator_core/solver/matrix/matrix.py Outdated Show resolved Hide resolved
src/simulator_core/solver/matrix/matrix.py Outdated Show resolved Hide resolved
self.add_equation(equation)
if dumb:
self.dump_matrix()
if len(equations) > self.num_unknowns:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can move this to another method something like: verify_equations? You need to call it in the solve method but it is a separate routine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

unit_test/solver/matrix/test_matrix.py Outdated Show resolved Hide resolved
unit_test/solver/matrix/test_matrix.py Show resolved Hide resolved
unit_test/solver/matrix/test_matrix.py Outdated Show resolved Hide resolved
unit_test/solver/matrix/test_matrix.py Outdated Show resolved Hide resolved
unit_test/solver/network/test_network.py Show resolved Hide resolved
Copy link
Contributor

@vanmeerkerk vanmeerkerk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Sam,

Some minor comments. I believe we should implement the numpy supported testing routines when we use arrays in tests. Also I would like you to add some more descriptive text near the sparse matrix conversion routines.

A discussion point might be the small formatting changes required when we touch classes. I would suggest to revise the class inititialization when we make small changes. What do you think?

Copy link
Contributor

@vanmeerkerk vanmeerkerk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Sam,

Some minor comments. I believe we should implement the numpy supported testing routines when we use arrays in tests. Also I would like you to add some more descriptive text near the sparse matrix conversion routines.

A discussion point might be the small formatting changes required when we touch classes. I would suggest to revise the class inititialization when we make small changes. What do you think?

@samvanderzwan
Copy link
Contributor Author

Discussed with Michiel to approve and merge

@samvanderzwan samvanderzwan merged commit 0cfae39 into main Jun 6, 2024
5 of 6 checks passed
@samvanderzwan samvanderzwan deleted the 77-improve-matrix-class branch June 6, 2024 14:46
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.

Improve matrix class
2 participants