Skip to content
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

feat: rename Pred to RunFilter which takes a RunSpec #31

Merged
merged 1 commit into from
Jan 13, 2025
Merged
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: 3 additions & 3 deletions ml_experiment/Scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LocalRunConfig(RunConfig):



Pred = Callable[[str, int, int, int], bool]
RunFilter = Callable[[RunSpec], bool]
VersionSpec = int | dict[str, int | None] | None

class Scheduler:
Expand Down Expand Up @@ -71,11 +71,11 @@ def get_all_runs(self) -> Self:
return self


def filter(self, already_exists: Pred) -> Scheduler:
def filter(self, already_exists: RunFilter) -> Scheduler:
filtered = Scheduler(self.exp_name, self.seeds, self.entry, self.version, self.base_path)

for r in self.all_runs:
if not already_exists(*r):
if not already_exists(r):
filtered.all_runs.add(r)

return filtered
Expand Down
Loading