Skip to content

Conversation

oscargus
Copy link
Contributor

References to other Issues or PRs

Builds on #22661 so that should be merged first.
Related to #22654

Brief description of what is fixed or changed

srepr for BaseVector and BaseDyadic did not return correct code (in the same way as other srepr does).

DFT and IDFT now have better LaTeX-printing.

S.Catalan is now printed as G (as per the Wiki-link provided as reference and many pther sources).

Other comments

Tests added for LaTeX-printing of all(?) NumberSymbols in S.

Release Notes

  • printing
    • S.Catalan is now printed as G in LaTeX and pretty printers.
    • Improved LaTeX-printing of DFT and IDFT.
  • vector
    • Improved srepr for BaseVector and BaseDyadic.

@sympy-bot
Copy link

sympy-bot commented Dec 13, 2021

Hi, I am the SymPy bot (v162). 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:

  • printing

  • vector

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.10.

Click here to see the pull request description that was parsed.
<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->

Builds on #22661 so that should be merged first.
Related to #22654 

#### Brief description of what is fixed or changed
`srepr` for `BaseVector` and `BaseDyadic` did not return correct code (in the same way as other `srepr` does).

`DFT` and `IDFT` now have better LaTeX-printing.

`S.Catalan` is now printed as `G` (as per the Wiki-link provided as reference and many pther sources).

#### Other comments

Tests added for LaTeX-printing of all(?) NumberSymbols in `S`.

#### Release Notes

<!-- Write the release notes for this release below between the BEGIN and END
statements. The basic format is a bulleted list with the name of the subpackage
and the release note for this PR. For example:

* solvers
  * Added a new solver for logarithmic equations.

* functions
  * Fixed a bug with log of integers.

or if no release note(s) should be included use:

NO ENTRY

See https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more
information on how to write release notes. The bot will check your release
notes automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
* printing
   * `S.Catalan` is now printed as `G` in LaTeX and pretty printers. 
   * Improved LaTeX-printing of `DFT` and `IDFT`. 
* vector
   * Improved `srepr` for `BaseVector` and `BaseDyadic`. 
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

assert pretty(Variance(X)) == r'var(X)'
assert pretty(Probability(X > 0)) == r'P(X > 0)'
Y = Normal("Y", mu, sigma)
assert pretty(Covariance(X, Y)) == 'cov(X, Y)'
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would probably capitalise Var and Cov

Copy link
Contributor Author

Choose a reason for hiding this comment

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

English Wikipedia writes cov, but I see many other sources using Cov (including Swedish Wikipedia). Easily fixed!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is changed in #22661 (this PR is built on top of that).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Since #22661 is merged current master shows:

In [5]: pretty(Covariance(X, Y))
Out[5]: 'Cov(X, Y)'

Is the intention to change that here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was under the impression that the first commit, which is merged and later overridden elsewhere, would be removed from this PR. But I must have missed how it works (or at least displays).

I'll rebase this and remove that commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, when rebasing that commit was automatically removed anyway. So not sure what would have happened if this was merged as is (and will not find out...).

@github-actions
Copy link

github-actions bot commented Dec 18, 2021

Benchmark results from GitHub Actions

Lower numbers are good, higher numbers are bad. A ratio less than 1
means a speed up and greater than 1 means a slowdown. Green lines
beginning with + are slowdowns (the PR is slower then master or
master is slower than the previous release). Red lines beginning
with - are speedups.

Significantly changed benchmark results (PR vs master)

Significantly changed benchmark results (master vs previous release)

       before           after         ratio
     [907895ac]       [ea9c2c2d]
-      4.88±0.01s          366±1ms     0.07  polygon.PolygonArbitraryPoint.time_bench01
+     3.93±0.04ms       6.73±0.1ms     1.71  solve.TimeMatrixOperations.time_det(4, 2)
+     4.03±0.09ms      6.60±0.02ms     1.64  solve.TimeMatrixOperations.time_det_bareiss(4, 2)
+      43.9±0.7ms         83.2±3ms     1.90  solve.TimeMatrixSolvePyDySlow.time_linsolve(1)
+        45.3±2ms       80.6±0.4ms     1.78  solve.TimeMatrixSolvePyDySlow.time_solve(1)

Full benchmark results can be found as artifacts in GitHub Actions
(click on checks at the top of the PR).

@oscargus oscargus force-pushed the printingimprovements2 branch from 4f5b880 to 9600016 Compare December 19, 2021 09:02
@oscarbenjamin oscarbenjamin merged commit c43550c into sympy:master Dec 19, 2021
@oscargus oscargus deleted the printingimprovements2 branch December 19, 2021 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants