-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Compact printing of FiniteSet. Fixes #21823 #21931
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
Conversation
✅ 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.9. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
This won't work for a FiniteSet of FiniteSets: you won't be able to copy and paste the result since the internals sets will be interpreted as python sets and they are unhashable. So either the parser would have to recognize that or else the printer needs to not print its args as sets. |
Thanks @smichr. I have an ongoing fix for the loads of failures, but stopped after a while to get some feedback before spending time on fixing them all. I guess that printing the outer set as |
Benchmark results from GitHub Actions Lower numbers are good, higher numbers are bad. A ratio less than 1 Significantly changed benchmark results (PR vs master) Significantly changed benchmark results (master vs previous release) before after ratio
[ed9a550f] [63b86653]
<sympy-1.8^0>
- 1.17±0.01s 162±3ms 0.14 dsolve.TimeDsolve01.time_dsolve
- 8.88±0.04s 4.61±0.03s 0.52 integrate.TimeIntegrationRisch02.time_doit_risch(100)
- 75.6±3μs 28.3±0.8μs 0.37 matrices.TimeDiagonalEigenvals.time_eigenvals
- 89.8±4μs 58.0±5μs 0.65 matrices.TimeMatrixGetItem.time_ImmutableSparseMatrix_getitem
- 86.2±1μs 55.3±0.8μs 0.64 matrices.TimeMatrixGetItem.time_MutableSparseMatrix_getitem
+ 6.15±0.2ms 9.48±0.6ms 1.54 physics.mechanics.kane.KanesMethodMassSpringDamper.time_kanesmethod_mass_spring_damper
+ 91.5±1μs 162±40μs 1.77 solve.TimeMatrixArithmetic.time_dense_add(10, 5)
+ 11.7±0.09μs 20.9±0.9μs 1.78 solve.TimeMatrixArithmetic.time_dense_add(3, 0)
+ 14.1±0.2μs 40.6±2μs 2.88 solve.TimeMatrixArithmetic.time_dense_add(3, 5)
+ 17.6±0.1μs 27.5±2μs 1.56 solve.TimeMatrixArithmetic.time_dense_add(4, 0)
+ 37.9±0.2μs 67.2±0.6μs 1.77 solve.TimeMatrixArithmetic.time_dense_add(6, 5)
- 1.24±0.02ms 244±9μs 0.20 solve.TimeMatrixArithmetic.time_dense_multiply(10, 0)
- 48.8±0.8μs 25.7±0.8μs 0.53 solve.TimeMatrixArithmetic.time_dense_multiply(3, 0)
+ 76.8±2μs 139±10μs 1.81 solve.TimeMatrixArithmetic.time_dense_multiply(3, 5)
- 100±0.9μs 35.2±3μs 0.35 solve.TimeMatrixArithmetic.time_dense_multiply(4, 0)
- 298±6μs 86.6±10μs 0.29 solve.TimeMatrixArithmetic.time_dense_multiply(6, 0)
- 92.6±2μs 46.2±4μs 0.50 solve.TimeMatrixOperations.time_det(3, 0)
- 182±7μs 115±20μs 0.63 solve.TimeMatrixOperations.time_det(3, 2)
- 91.3±0.7μs 42.2±1μs 0.46 solve.TimeMatrixOperations.time_det_bareiss(3, 0)
- 177±1μs 104±2μs 0.59 solve.TimeMatrixOperations.time_det_bareiss(3, 2)
- 169±3μs 94.0±0.4μs 0.56 solve.TimeMatrixOperations.time_det_bareiss(3, 5)
- 91.4±1μs 42.7±1μs 0.47 solve.TimeMatrixOperations.time_det_berkowitz(3, 0)
- 203±20μs 128±7μs 0.63 solve.TimeMatrixOperations.time_det_berkowitz(3, 2)
+ 783±70μs 1.50±0.1ms 1.91 solve.TimeMatrixOperations.time_det_berkowitz(4, 0)
+ 944±10μs 2.14±0.3ms 2.26 solve.TimeMatrixOperations.time_det_berkowitz(4, 2)
+ 453±9μs 733±20μs 1.62 solve.TimeMatrixOperations.time_rank(4, 0)
+ 875±10μs 1.38±0.3ms 1.58 solve.TimeMatrixSolve.time_solve_sym('LU')
- 5.97±0.5ms 3.35±0.3ms 0.56 solve.TimeRationalSystem.time_linsolve(10)
- 3.39±0.5ms 2.22±0.01ms 0.65 solve.TimeSparseSystem.time_linsolve_eqs(30)
Full benchmark results can be found as artifacts in GitHub Actions |
Updated version with fixed tests (and added tests). |
Oh, that's a great idea. |
This gets my vote for beauty award this round! Thanks, |
References to other Issues or PRs
Closes #21823
Brief description of what is fixed or changed
FiniteSet
is now printed with{}
, see #21823.Other comments
Release Notes
FiniteSet
now prints as{...}
instead ofFiniteSet(...)
in the string printer, unless it contains aFiniteSet
.