-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Zhiyuan Chen <[email protected]>
- Loading branch information
1 parent
2733540
commit 122c02b
Showing
2 changed files
with
70 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# CHANfiG, Easier Configuration. | ||
# Copyright (c) 2022-Present, CHANfiG Contributors | ||
|
||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the following licenses: | ||
# - The Unlicense | ||
# - GNU Affero General Public License v3.0 or later | ||
# - GNU General Public License v2.0 or later | ||
# - BSD 4-Clause "Original" or "Old" License | ||
# - MIT License | ||
# - Apache License 2.0 | ||
|
||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# See the LICENSE file for more details. | ||
|
||
|
||
from chanfig import NestedDict | ||
from enum import auto | ||
|
||
try: | ||
from enum import StrEnum | ||
except ImportError: | ||
from strenum import LowercaseStrEnum as StrEnum # type: ignore[no-redef] | ||
|
||
|
||
class Task(StrEnum): | ||
__test__ = False | ||
Regression = auto() | ||
Binary = auto() | ||
MultiClass = auto() | ||
MultiLabel = auto() | ||
|
||
|
||
class TaskConfig(NestedDict): | ||
__test__ = False | ||
task: Task = "regression" | ||
|
||
|
||
class TestDump: | ||
def test_yamls(self): | ||
config = TaskConfig() | ||
s = config.yamls() | ||
assert s == "task: regression\n" |