Skip to content

Commit ce2e8bc

Browse files
committed
Add support for "model" repositories
Model repositories hold SDK machine learning models. For now it is just a placeholder and uses the default config. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 60c186a commit ce2e8bc

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ api = [
4848
]
4949
app = []
5050
lib = []
51+
model = []
5152
dev-docs-gen = [
5253
"mike == 1.1.2",
5354
"mkdocs-gen-files == 0.4.0",

src/frequenz/repo/config/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- api: gRPC APIs
1212
- app: SDK applications
1313
- lib: General purpose Python libraries
14+
- model: SDK machine learning models
1415
1516
# Common
1617
@@ -34,8 +35,8 @@
3435
nox.configure(nox.default.lib_config)
3536
```
3637
37-
Again, make sure to pick the correct default configuration based on the type of
38-
your project (`actor_config`, `api_config`, `app_config`, `lib_config`).
38+
Again, make sure to pick the correct default configuration based on the type of your
39+
project (`actor_config`, `api_config`, `app_config`, `lib_config`, `model_config`).
3940
4041
If you need to modify the configuration, you can copy one of the default
4142
configurations by using the

src/frequenz/repo/config/_core.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ class RepositoryType(enum.Enum):
2020

2121
LIB = "lib"
2222
"""General purpose library repository."""
23+
24+
MODEL = "model"
25+
"""SDK machine learning model repository."""

src/frequenz/repo/config/nox/default.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
repositories defined by
88
[`frequenz.repo.config.RepositoryType`][frequenz.repo.config.RepositoryType].
99
10-
The `actor_config`, `api_config`, `app_config`, and `lib_config` variables are the
11-
default configurations for libraries, APIs, actors and applications, respectively. The
12-
`common_config` variable is the default configuration for all types of repositories.
10+
The `actor_config`, `api_config`, `app_config`, `lib_config`, and `model_config`
11+
variables are the default configurations for libraries, APIs, actors and applications,
12+
respectively. The `common_config` variable is the default configuration for all types of
13+
repositories.
1314
14-
The `actor_command_options`, `api_command_options`, `app_command_options`, and
15-
`lib_command_options` variables are the default command-line options for the same types
16-
of repositories, and the `common_command_options` variable is the default command-line
17-
options for all types of repositories.
15+
The `actor_command_options`, `api_command_options`, `app_command_options`,
16+
`lib_command_options`, and `model_command_options` variables are the default
17+
command-line options for the same types of repositories, and the
18+
`common_command_options` variable is the default command-line options for all types of
19+
repositories.
1820
1921
They can be modified before being passed to
2022
[`nox.configure()`][frequenz.repo.config.nox.configure] by using the
@@ -109,3 +111,9 @@
109111

110112
lib_config: _config.Config = common_config.copy()
111113
"""Default configuration for libraries."""
114+
115+
model_command_options: _config.CommandsOptions = common_command_options.copy()
116+
"""Default command-line options for models."""
117+
118+
model_config: _config.Config = common_config.copy()
119+
"""Default configuration for models."""

tests/test_core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def test_repository_type_doesnt_have_new_types() -> None:
1515
"api",
1616
"app",
1717
"lib",
18+
"model",
1819
}
1920
defined = {t.value for t in RepositoryType}
2021
assert defined == expected, utils.MSG_UNEXPECTED_REPO_TYPES

0 commit comments

Comments
 (0)