Skip to content

Conversation

wermos
Copy link
Contributor

@wermos wermos commented Aug 17, 2023

References to other Issues or PRs

#25515

Brief description of what is fixed or changed

I fixed a small inconsistency that was pointed out here by @sylee957. I also refactored the Transformer code out into its own file, to make the design more modular.

I also made the parse_latex_lark function visible from sympy.parsing.latex.

Other comments

Release Notes

  • parsing
    • parse_latex_lark is now visible from sympy.parsing.latex.

@sympy-bot
Copy link

sympy-bot commented Aug 17, 2023

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

  • parsing
    • parse_latex_lark is now visible from sympy.parsing.latex. (#25535 by @wermos)

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

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

#### Brief description of what is fixed or changed

I fixed a small inconsistency that was pointed out [here](https://github.com/sympy/sympy/pull/25515#issuecomment-1680375204) by @sylee957. I also refactored the Transformer code out into its own file, to make the design more modular.

I also made the `parse_latex_lark` function visible from `sympy.parsing.latex`.

#### Other comments


#### 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. Formerly, `log(-x)` incorrectly gave `-log(x)`.

* physics.units
  * Corrected a semantical error in the conversion between volt and statvolt which
    reported the volt as being larger than the statvolt.

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 -->
* parsing
  * `parse_latex_lark` is now visible from `sympy.parsing.latex`.
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@sympy-bot
Copy link

sympy-bot commented Aug 17, 2023

🟠

Hi, I am the SymPy bot. I've noticed that some of your commits add or delete files. Since this is sometimes done unintentionally, I wanted to alert you about it.

This is an experimental feature of SymPy Bot. If you have any feedback on it, please comment at sympy/sympy-bot#75.

The following commits add new files:

  • e67dec8:
    • sympy/parsing/latex/lark/transformer.py

If these files were added/deleted on purpose, you can ignore this message.

@wermos
Copy link
Contributor Author

wermos commented Aug 17, 2023

cc @Upabjojr for review.

@wermos
Copy link
Contributor Author

wermos commented Aug 17, 2023

@sylee957 Do you have any idea about how to solve this import issue?

@wermos
Copy link
Contributor Author

wermos commented Aug 18, 2023

I think I've managed to solve both the import issues, so all the tests should pass this time.

@wermos wermos changed the title Refactored Transformer code and fixed a minor inconsistency [GSoC] Refactored Transformer code and fixed a minor inconsistency Aug 18, 2023
@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
     [8059df73]       [73484029]
     <sympy-1.12^0>                 
-         106±4ms       67.9±0.5ms     0.64  integrate.TimeIntegrationRisch02.time_doit_risch(10)
-      8.51±0.2ms       4.78±0.1ms     0.56  logic.LogicSuite.time_load_file
-     2.66±0.04ms         752±20μs     0.28  polys.TimePREM_LinearDenseQuadraticGCD.time_op(3, 'sparse')
-      12.6±0.1ms       2.32±0.1ms     0.18  polys.TimePREM_LinearDenseQuadraticGCD.time_op(5, 'sparse')
-         431±7μs         92.3±1μs     0.21  polys.TimePREM_QuadraticNonMonicGCD.time_op(1, 'sparse')
-      6.25±0.4ms          417±6μs     0.07  polys.TimePREM_QuadraticNonMonicGCD.time_op(3, 'sparse')
-      13.6±0.4ms      1.22±0.05ms     0.09  polys.TimePREM_QuadraticNonMonicGCD.time_op(5, 'sparse')
-      7.42±0.2ms      4.51±0.08ms     0.61  polys.TimeSUBRESULTANTS_LinearDenseQuadraticGCD.time_op(2, 'sparse')
-      33.4±0.3ms       13.5±0.2ms     0.40  polys.TimeSUBRESULTANTS_LinearDenseQuadraticGCD.time_op(3, 'sparse')
-      8.00±0.2ms      1.39±0.02ms     0.17  polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(1, 'sparse')
-      18.1±0.1ms       10.7±0.3ms     0.59  polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(2, 'sparse')
-         256±2ms         81.4±3ms     0.32  polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(3, 'sparse')
-      8.34±0.4ms         650±10μs     0.08  polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(3, 'sparse')
-      35.3±0.7ms         994±30μs     0.03  polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(5, 'sparse')
-        718±10μs          257±9μs     0.36  polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(1, 'sparse')
-      8.20±0.1ms          259±3μs     0.03  polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(3, 'sparse')
-      21.2±0.4ms          270±6μs     0.01  polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(5, 'sparse')
-        216±20μs          122±3μs     0.57  solve.TimeMatrixOperations.time_rref(3, 0)
-         396±9μs          143±2μs     0.36  solve.TimeMatrixOperations.time_rref(4, 0)
-      38.5±0.7ms       16.5±0.3ms     0.43  solve.TimeSolveLinSys189x49.time_solve_lin_sys

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

@wermos
Copy link
Contributor Author

wermos commented Aug 18, 2023

This PR is good to go now.

@sylee957 sylee957 enabled auto-merge August 26, 2023 18:10
@sylee957 sylee957 merged commit a0673de into sympy:master Aug 26, 2023
@wermos wermos deleted the latex-parser-int branch September 2, 2023 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants