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

Dim sort #1926

Merged
merged 7 commits into from
Mar 8, 2024
Merged

Dim sort #1926

merged 7 commits into from
Mar 8, 2024

Commits on Jan 23, 2024

  1. Reimplementation of sorting units by dimensions

    Adapt PR#1841 to the new Pint formatter.
    
    Signed-off-by: Michael Tiemann <72577720+MichaelTiemannOSC@users.noreply.github.com>
    MichaelTiemannOSC committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    b1b941b View commit details
    Browse the repository at this point in the history
  2. Fix up pre-commit formatting

    Signed-off-by: Michael Tiemann <72577720+MichaelTiemannOSC@users.noreply.github.com>
    MichaelTiemannOSC committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    f6fbcc0 View commit details
    Browse the repository at this point in the history
  3. Update CHANGES

    Signed-off-by: Michael Tiemann <72577720+MichaelTiemannOSC@users.noreply.github.com>
    MichaelTiemannOSC committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    65fd12c View commit details
    Browse the repository at this point in the history
  4. Update test_issues.py

    Remove `breakpoint`s that should have been linted out by pre-commit.
    
    Signed-off-by: Michael Tiemann <72577720+MichaelTiemannOSC@users.noreply.github.com>
    MichaelTiemannOSC committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    4551586 View commit details
    Browse the repository at this point in the history
  5. Ensure called default_sort_func is not None

    It would be easier to just default to `sorted` instead of `None`, but since `None` is an option, we have to test for it anyway.
    
    Signed-off-by: Michael Tiemann <72577720+MichaelTiemannOSC@users.noreply.github.com>
    MichaelTiemannOSC committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    7b9bc34 View commit details
    Browse the repository at this point in the history
  6. Fix default_sort_func

    The default sort function needs to be able to handle a registry passed to it, so to make `sorted` the default behavior, we have to create a lambda that strips the registry parameter before calling `sorted`.
    
    Signed-off-by: Michael Tiemann <72577720+MichaelTiemannOSC@users.noreply.github.com>
    MichaelTiemannOSC committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    a47b5e9 View commit details
    Browse the repository at this point in the history
  7. Refactor sort_func into format_compound_unit

    This is a much more logical place to put it.  Note that the default formatters (plain, html, latex) all now call `formatter` with sort_func=None so that we don't accidentally use `sorted` as a default argument.  But those who call `formatter` directly for their own purposes can call with a sort_func of their choosing that will do what they want it to do.
    
    This also fixes a latent bug where we failed to call `sort_func` in one of the paths of `plain.py`.
    
    Signed-off-by: Michael Tiemann <72577720+MichaelTiemannOSC@users.noreply.github.com>
    MichaelTiemannOSC committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    32f543d View commit details
    Browse the repository at this point in the history