Skip to content
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

units: fixed convert_to() bug and added some tests #26612

Merged
merged 2 commits into from
May 20, 2024

Commits on May 20, 2024

  1. units: fixed convert_to() bug and added some tests

    Fixes sympy#21463
    Fixed a convert_to() function bug where the result for some inverse
    sums duplicated the expression units incorrectly.
    I found that by using the together() function, these duplicates are
    prevented when the expression is a function.
    
    Examples:
    
    - Before
    
    In [1]: convert_to(1/(beta*meter+meter), 1/meter)
    Out [1]: 1/(meter*(meter*beta + meter))
    
    - After
    
    In [2]: convert_to(1/(beta*meter+meter), 1/meter)
    Out [2]: 1/(meter*beta + meter)
    JotacBravo committed May 20, 2024
    Configuration menu
    Copy the full SHA
    312432f View commit details
    Browse the repository at this point in the history
  2. Update test_util.py

    smichr committed May 20, 2024
    Configuration menu
    Copy the full SHA
    0d85c0b View commit details
    Browse the repository at this point in the history