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

Round before formatting #181

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

asmacdo
Copy link
Member

@asmacdo asmacdo commented Sep 20, 2024

If we don't do the rounding prior to formatting, the summary_format (being a format string, not an f-string) is not smart enough to handle floats OR None (or str 'unknown'). So instead we need to handle that first.

Fixes: #172
Fixes: #171

If we don't do the rounding prior to formatting, the summary_format
(being a format string, not an f-string) is not smart enough to handle
floats OR None (or str 'unknown'). So instead we need to handle that
first.

Fixes: con#172
Fixes: con#171
@asmacdo asmacdo added the semver-minor Increment the minor version when merged label Sep 20, 2024
Copy link

codecov bot commented Sep 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.03%. Comparing base (2b12679) to head (b79229a).
Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #181      +/-   ##
==========================================
+ Coverage   94.92%   95.03%   +0.10%     
==========================================
  Files           2        2              
  Lines         473      483      +10     
  Branches       73       75       +2     
==========================================
+ Hits          449      459      +10     
  Misses         12       12              
  Partials       12       12              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "./.update-readme-help.py",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
@yarikoptic
Copy link
Member

Frankly I don't like this as it spreads aspects of formatting now from format specification into the code. as for "unknown" I already gave a nice solution to again allow it to be float or None (not sure some ad-hoc string) and then being nicely formatted: then you keep value nicely pythonic Optional[float] and format it the way you like it. that is my 1c. and I gave already a dollar of those I think so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-minor Increment the minor version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to make <summary_format> still flexible for user Do format % for CPU in summary sensibly/uniformly
2 participants