pygae / galgebra

Symbolic Geometric Algebra/Calculus package for SymPy :crystal_ball:
https://galgebra.rtfd.io/
BSD 3-Clause "New" or "Revised" License
233 stars 62 forks source link

Do not make any __str__ or __repr__ output latex #376

Closed eric-wieser closed 4 years ago

eric-wieser commented 4 years ago

This follows on from #371, and also hitting Sdop, Pdop, Lt, and Mlt.

This then moves all the duplicated code to printer.py. As a result of this change, only one line of code outside of printer.py uses GaLatexPrinter.latex_flg, and it only does so as a workaround:

https://github.com/pygae/galgebra/blob/0366454409fb0ba5c6c9f3509ec886685ad52fdc/galgebra/mv.py#L91-L94

Note that if __str__ is not defined, it defaults to __repr__ - so we can save some lines by only defining the latter.

codecov[bot] commented 4 years ago

Codecov Report

Merging #376 into master will decrease coverage by 0.04%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #376      +/-   ##
==========================================
- Coverage   77.29%   77.25%   -0.05%     
==========================================
  Files          16       16              
  Lines        4348     4313      -35     
==========================================
- Hits         3361     3332      -29     
+ Misses        987      981       -6     
Impacted Files Coverage Δ
galgebra/dop.py 89.74% <100.00%> (+0.39%) :arrow_up:
galgebra/lt.py 57.61% <100.00%> (+0.11%) :arrow_up:
galgebra/mv.py 75.90% <100.00%> (-0.31%) :arrow_down:
galgebra/printer.py 77.27% <100.00%> (-0.08%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 08a624e...0366454. Read the comment docs.