Skip to content

Commit

Permalink
Add a base config schema that provides quantities support
Browse files Browse the repository at this point in the history
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 <luca-frequenz@llucax.com>
  • Loading branch information
llucax committed Dec 10, 2024
1 parent cd08feb commit fbe18de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies = [
# (plugins.mkdocstrings.handlers.python.import)
"frequenz-client-microgrid >= 0.6.0, < 0.7.0",
"frequenz-channels >= 1.4.0, < 2.0.0",
"frequenz-quantities >= 1.0.0rc3, < 2.0.0",
"frequenz-quantities[marshmallow] >= 1.0.0, < 2.0.0",
"networkx >= 2.8, < 4",
"numpy >= 1.26.4, < 2",
"typing_extensions >= 4.6.1, < 5",
Expand Down
10 changes: 10 additions & 0 deletions src/frequenz/sdk/config/_base_schema.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# License: MIT
# Copyright © 2024 Frequenz Energy-as-a-Service GmbH

"""Base schema for configuration classes."""

from frequenz.quantities.experimental.marshmallow import QuantitySchema


class BaseConfigSchema(QuantitySchema):
"""A base schema for configuration classes."""

0 comments on commit fbe18de

Please sign in to comment.