Skip to content

Conversation

oscargus
Copy link
Contributor

References to other Issues or PRs

Related to #22654

Brief description of what is fixed or changed

Covariance, Expectation, Probability and Variance now have dedicated LaTex and pretty printing.
image
image

Other comments

Also changed so that a random domain prints using the \in symbol rather than the text in.

Added some rudimentary ASCII pretty-printing option for Differential (d), WedgeProduct (/\), and TensorProduct (.*). The last is a bit doubtful, but probably better than an error...

Release Notes

  • printing
    • Dedicated LaTeX and pretty printing for Covariance, Expectation, Probability and Variance.

@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
    • Dedicated LaTeX and pretty printing for Covariance, Expectation, Probability and Variance. (#22661 by @oscargus)

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. -->

Related to #22654 

#### Brief description of what is fixed or changed
`Covariance`, `Expectation`, `Probability` and `Variance` now have dedicated LaTex and pretty printing.
![image](https://user-images.githubusercontent.com/8114497/145788669-61a5c6d1-2bf7-40ed-bdc1-d57a7da0ada0.png)
![image](https://user-images.githubusercontent.com/8114497/145788709-f1505c41-568c-4e93-a309-70345bd2ae38.png)

#### Other comments
Also changed so that a random domain prints using the `\in` symbol rather than the text `in`.

Added some rudimentary ASCII pretty-printing option for `Differential` (`d`), `WedgeProduct` (`/\`), and `TensorProduct` (`.*`). The last is a bit doubtful, but probably better than an error...

#### 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
   * Dedicated LaTeX and pretty printing for `Covariance`, `Expectation`, `Probability` and `Variance`.
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@oscarbenjamin
Copy link
Collaborator

See here for the test failure: #22657 (comment)

@oscarbenjamin
Copy link
Collaborator

Looks good to me

@bjodah
Copy link
Member

bjodah commented Dec 15, 2021

I think "E" should be written either using \operatorname or simply {\rm E} since it's not a variable here, would you agree?

@oscargus
Copy link
Contributor Author

I think "E" should be written either using \operatorname or simply {\rm E} since it's not a variable here, would you agree?

Yes, you are correct. I also changed P. Used \operatorname (\rm is TeX and should not be used, ever, as far as I understand it).

@github-actions
Copy link

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]       [ffbc9cf2]
+      7.41±0.2ms       12.1±0.3ms     1.64  matrices.TimeMatrixPower.time_Case1
-      5.05±0.09s          414±7ms     0.08  polygon.PolygonArbitraryPoint.time_bench01
+     3.89±0.03ms       7.92±0.3ms     2.03  solve.TimeMatrixOperations.time_det(4, 2)
+      3.95±0.2ms       7.26±0.3ms     1.84  solve.TimeMatrixOperations.time_det_bareiss(4, 2)
+      37.8±0.8ms         60.7±3ms     1.61  solve.TimeMatrixPositiveDefinite.time_A_is_positive_definite
+      38.1±0.7ms         61.0±2ms     1.60  solve.TimeMatrixPositiveDefinite.time_A_sym_is_positive_definite
+         549±5ms         892±40ms     1.62  solve.TimeMatrixSolve.time_solve('GE')
+        483±10ms         757±20ms     1.57  solve.TimeMatrixSolve.time_solve_sym('GE')
+        43.3±2ms         91.6±3ms     2.11  solve.TimeMatrixSolvePyDySlow.time_linsolve(1)
+      41.9±0.3ms         93.4±4ms     2.23  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
Copy link
Contributor Author

Merging this and restarting the ones that builds on it.

@oscargus oscargus merged commit 9b9d016 into sympy:master Dec 18, 2021
@oscargus oscargus deleted the statsprinting branch December 18, 2021 21:39
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.

4 participants