Round slots proportion instead of ceiling-ing them
parent
60a6016e73
commit
4247f28e04
|
@ -22,7 +22,7 @@ from __future__ import annotations
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from math import floor, ceil
|
from math import floor
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
|
|
||||||
|
@ -243,7 +243,9 @@ class Allocator(BaseModel):
|
||||||
# return (size or abs_pp_size) / alloc.units_limit
|
# return (size or abs_pp_size) / alloc.units_limit
|
||||||
prop = abs_pp_size / self.units_limit
|
prop = abs_pp_size / self.units_limit
|
||||||
|
|
||||||
return ceil(prop * self.slots)
|
# TODO: REALLY need a way to show partial slots..
|
||||||
|
# for now we round at the midway point between slots
|
||||||
|
return round(prop * self.slots)
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|
Loading…
Reference in New Issue