Skip to content
Open

N/A #822

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions vizier/_src/pythia/local_policy_supporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ class InRamPolicySupporter(policy_supporter.PolicySupporter):
study_guid: str = attr.ib(init=True, kw_only=True, default='', converter=str)
_trials: dict[int, vz.Trial] = attr.ib(init=False, factory=dict)

def __str__(self) -> str:
return (
f'InRamPolicySupporter(study_guid={self.study_guid},'
f' num_trials={len(self.trials)})'
)

@property
def trials(self) -> Sequence[vz.Trial]:
return list(self._trials.values())
Expand Down
2 changes: 1 addition & 1 deletion vizier/_src/pythia/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def early_stop(self, request: EarlyStopRequest) -> EarlyStopDecisions:

@property
def name(self) -> str:
"""Returns the policy name."""
"""Returns the policy name. For monitoring purposes only."""
# Derived classes should override this implementation.
return __class__.__name__

Expand Down
2 changes: 2 additions & 0 deletions vizier/_src/pythia/policy_supporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def GetStudyConfig(self, study_guid: str) -> vz.ProblemStatement:
$study_guid refers to a nonexistent or inaccessible study.
"""

# TODO: Should take `TrialFilter` as input, instead of
# its fields listed as keyword arguments.
@abc.abstractmethod
def GetTrials(
self,
Expand Down