-
Notifications
You must be signed in to change notification settings - Fork 0
fix(postgres): Store capacities with finer prefix #85
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
Conversation
Benchmark ResultsBenchmark resultsBenchmark vs base branch |
devsjc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good other than potentially some more test cases. I think there's probably still a discussion to be had around whether it's worth using NUMERIC/BIGINT here - if this is something we're likely to rub up against a lot; I don't think it would be too big of a hit since we're not doing much calculation with this value in the database anyway.
| {500000, 5000, 2, false}, | ||
| {32767000, 32767, 3, false}, | ||
| {32768000, 33, 6, false}, // Needs rounding, should go to 33 MW | ||
| {33000000, 33, 6, false}, | ||
| {1000000000000, 1000, 9, false}, // 1TW | ||
| {32768000, 3277, 4, false}, // Needs rounding, should go to 33.77 MW (4.s.f.) | ||
| {33000000, 3300, 4, false}, | ||
| {1000000000000, 10000, 8, false}, // 1TW | ||
| {12345678000, 12346, 6, false}, // 12 GW | ||
| {20233169, 20233, 3, false}, | ||
| {1398373, 13984, 2, false}, // 1.3 MW | ||
| {444234720, 4442, 5, false}, // 444.2 MW (4.s.f.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth adding in those cases you were seeing that caused this ticket in the first place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bottom three are, unless ive missed one
|
I'm going to close this in favour of #92 |
Update capacityToValueMultiplier to use 10's not 10^3's. This means we can get atleast 4.s.f.
I needed to remove a constraint in the sql code too
Example:
Before 32768 would get rounded to 33 x 10^3, and now it goes rounded to 3277 x 10^1
This helps fix #71
make lintwith your changes locally?make genwith your changes locally?make testwith your changes locally?