Skip to content

Commit 2baa6b8

Browse files
committed
Add a base config schema that provides quantities support
This schema is provided to use as a default, and might be extended in the future to support more commonly used fields that are not provided by marshmallow by default. To use the quantity schema we need to bump the `frequenz-quantities` dependency and add the optional `marshmallow` dependency. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 3cf8d63 commit 2baa6b8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dependencies = [
3131
# (plugins.mkdocstrings.handlers.python.import)
3232
"frequenz-client-microgrid >= 0.6.0, < 0.7.0",
3333
"frequenz-channels >= 1.4.0, < 2.0.0",
34-
"frequenz-quantities >= 1.0.0rc3, < 2.0.0",
34+
"frequenz-quantities[marshmallow] >= 1.0.0, < 2.0.0",
3535
"networkx >= 2.8, < 4",
3636
"numpy >= 1.26.4, < 2",
3737
"typing_extensions >= 4.6.1, < 5",
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# License: MIT
2+
# Copyright © 2024 Frequenz Energy-as-a-Service GmbH
3+
4+
"""Base schema for configuration classes."""
5+
6+
from frequenz.quantities.experimental.marshmallow import QuantitySchema
7+
8+
9+
class BaseConfigSchema(QuantitySchema):
10+
"""A base schema for configuration classes."""

0 commit comments

Comments
 (0)