-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Tensor module: refactory to allow mixing PartialDerivative and TensAdd #18224
Conversation
✅ Hi, I am the SymPy bot (v149). 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.6. Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
I don't know this part of the codebase well but the PR looks fine to me. I notice that you have introduced type annotations in the comments. Is that the recommended way to use mypy? |
I got them from mypy's documentation: I didn't try @oscarbenjamin I have also changed the metaclass of |
I think there are certainly other places where it could be useful. It would be better if maybe For Expr this is tricky because it has way too many methods. Which would you expect a subclass to provide? If you do More generally I wonder about the |
Yes, definitely. All subclasses of
Maybe we can simply move
The purpose of the new-style assumptions was getting rid of the metaclasses, IIRC. |
Codecov Report
@@ Coverage Diff @@
## master #18224 +/- ##
=============================================
+ Coverage 74.938% 74.954% +0.016%
=============================================
Files 642 642
Lines 167166 167222 +56
Branches 39340 39347 +7
=============================================
+ Hits 125271 125341 +70
+ Misses 36362 36334 -28
- Partials 5533 5547 +14 |
I don't know that there is any agreed plan for new vs old assumptions any more. It seems to me that the new assumptions can not replace the old because they are built on top of the core. I think that
We could do but the question is what would be the equivalent of Oh wait: Do you just mean that |
I think there's a fundamental design issue: assumptions should not be bound to a class, they should apply to any expression. The current API You cannot go on with a metaclass, assumptions should really be separate from |
Yes, now you are free to use The only question is whether subclassing |
If you push that as a change here we can see the result of running the benchmarks on Travis |
Do you think you can trust Travis? I got the feeling that their CPUs are quite different every time you run the tests. |
It compares master with the PR in the same job and seems to be comparable. You can see the benchmarks for this PR here: You can also run the benchmarks yourself. I'm not sure why the metaclass would give a significant slow-down. I presume the additional processing happens once per-class rather than once per-instance so it would be a small slowdown on import. |
@oscarbenjamin let's see how this compares to #18228 |
Merging this PR as the other one is slowing down SymPy. |
References to other Issues or PRs
Brief description of what is fixed or changed
Other comments
Release Notes