-
Notifications
You must be signed in to change notification settings - Fork 998
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use same test groups for benchmarking and evaluation - Add a custom enum class with initiutive methods to dynamically create test groups - Use custom enum to reduce manually creation of test groups - Update benchmark cli args to accept test group argument - Add pydantic validator to validate test group and test categories
- Loading branch information
1 parent
893c9af
commit 4d8a86c
Showing
3 changed files
with
106 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from enum import Enum | ||
|
||
|
||
class CustomEnum(Enum): | ||
@classmethod | ||
def add(cls, other): | ||
combined_members = {member.name: member.value for member in cls} | ||
combined_members.update({member.name: member.value for member in other}) | ||
return __class__(cls.__name__, combined_members) | ||
|
||
@classmethod | ||
def subtract(cls, other): | ||
remaining_members = {member.name: member.value for member in cls if member not in other} | ||
return __class__(cls.__name__, remaining_members) | ||
|
||
@classmethod | ||
def rename(cls, new_name): | ||
members = {member.name: member.value for member in cls} | ||
return __class__(new_name, members) | ||
|
||
@classmethod | ||
def update(cls, new_members): | ||
members = {member.name: member.value for member in cls} | ||
members.update(new_members) | ||
return __class__(cls.__name__, members) |