Skip to content

Commit

Permalink
Source code formatting change in optuna/storages/_rdb/models.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aisha-partha committed May 22, 2024
1 parent 1dca3ec commit 9b073d6
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions optuna/storages/_rdb/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,7 @@ def find_or_raise_by_id(

@classmethod
def count(
cls,
session: orm.Session,
study: StudyModel | None = None,
state: TrialState | None = None,
cls, session: orm.Session, study: StudyModel | None = None, state: TrialState | None = None
) -> int:
trial_count = session.query(func.count(cls.trial_id))
if study is not None:
Expand Down Expand Up @@ -427,10 +424,7 @@ class TrialValueType(enum.Enum):
)

@classmethod
def value_to_stored_repr(
cls,
value: float,
) -> tuple[float | None, TrialValueType]:
def value_to_stored_repr(cls, value: float) -> tuple[float | None, TrialValueType]:
if value == float("inf"):
return (None, cls.TrialValueType.INF_POS)
elif value == float("-inf"):
Expand Down Expand Up @@ -494,8 +488,7 @@ class TrialIntermediateValueType(enum.Enum):

@classmethod
def intermediate_value_to_stored_repr(
cls,
value: float,
cls, value: float
) -> tuple[float | None, TrialIntermediateValueType]:
if math.isnan(value):
return (None, cls.TrialIntermediateValueType.NAN)
Expand Down

0 comments on commit 9b073d6

Please sign in to comment.