-
Notifications
You must be signed in to change notification settings - Fork 472
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
Conversation
Adapt PR#1841 to the new Pint formatter. Signed-off-by: Michael Tiemann <[email protected]>
Signed-off-by: Michael Tiemann <[email protected]>
Signed-off-by: Michael Tiemann <[email protected]>
CodSpeed Performance ReportMerging #1926 will not alter performanceComparing Summary
|
Remove `breakpoint`s that should have been linted out by pre-commit. Signed-off-by: Michael Tiemann <[email protected]>
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 <[email protected]>
This test creates a UnitsContainer with
The This argues for the idea that we must default sorting compound units with |
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 <[email protected]>
I don't know why that one test failed--looks like a CI hiccup. |
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 <[email protected]>
I think this is the one PR to merge (the other is obsoleted by this one). We can certainly add some more tests after merging that fleshes out how complex multi-unit dimensions should be sorted, but that will only change the inner operation of the |
Adapt PR#1841 to the new Pint formatter.
pre-commit run --all-files
with no errorsTODO: show we can override default in registry init file.