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
Refactor domainmatrix.py to sympy.polys.matrices package #20759
Conversation
Refactor domainmatrix.py into a package sympy.polys.matrices
Add basic docstrings for each of the modules in sympy.polys.matrices just to give some explanation of what each module is for and the classes that they define.
✅ Hi, I am the SymPy bot (v161). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.8. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
🟠Hi, I am the SymPy bot (v161). I've noticed that some of your commits add or delete files. Since this is sometimes done unintentionally, I wanted to alert you about it. This is an experimental feature of SymPy Bot. If you have any feedback on it, please comment at sympy/sympy-bot#75. The following commits add new files:
The following commits delete files:
If these files were added/deleted on purpose, you can ignore this message. |
@sylee957 does this look okay to you? I'm building on this to add |
sympy/polys/matrices/__init__.py
Outdated
|
||
The main export from this package is the DomainMatrix class which is a | ||
lower-level implementation of matrices based on the polys Domains. This | ||
implentation is typically a lot faster than sympy's standard Matrix class but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implementation
Fix typo in docstring.
return not self.__eq__(other) | ||
|
||
@classmethod | ||
def zeros(cls, shape, domain): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about making this an instance method. That might suffice for internal use in most cases. There could also be a class method with another name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could do. I wouldn't want to do that in this PR because it's just for the refactoring so any nontrivial changes should be separate.
Do you mean that if it was an instance method then it could use the shape/domain from the instance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That is probably what we would usually want.
Can this be merged? All this does is move the code around to reorganise things ready for future expansion. There is plenty of work to be done on this code but I don't want to mix up the changes that just move the files around with the actual code changes. |
Thanks @sylee957! |
References to other Issues or PRs
Previous work on this is in #20621, #19882, #18844
Brief description of what is fixed or changed
Refactor domainmatrix.py by making a sympy.polys.matrices package and splitting it up into several files. This code is expected to grow and will need to be better organised.
Other comments
Release Notes
sympy.polys.domainmatrix
tosympy.polys.matrices
and should now be imported asfrom sympy.polys.matrices import DomainMatrix
.