Buckets:

download
raw
1.19 kB
from optuna.distributions import FloatDistribution
class SKDecimal(FloatDistribution):
def __init__(
self,
low: float,
high: float,
*,
step: float | None = None,
decimals: int | None = None,
name: str | None = None,
):
"""
FloatDistribution with a fixed step size.
Only one of step or decimals can be set.
:param low: lower bound
:param high: upper bound
:param step: step size (e.g. 0.001)
:param decimals: number of decimal places to round to (e.g. 3)
:param name: name of the distribution
"""
if decimals is not None and step is not None:
raise ValueError("You can only set one of decimals or step")
if decimals is None and step is None:
raise ValueError("You must set one of decimals or step")
# Convert decimals to step
self.step = step or (1 / 10**decimals if decimals else 1)
self.name = name or ""
super().__init__(
low=round(low, decimals) if decimals else low,
high=round(high, decimals) if decimals else high,
step=self.step,
)

Xet Storage Details

Size:
1.19 kB
·
Xet hash:
c4b0e8340ef9b2d8b3479963754194119e495f142e147a24e5154b462bc0ff84

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.