From fca691ad2792bd636dc3d6f9503bb406c52ba0ae Mon Sep 17 00:00:00 2001 From: belthlemar Date: Tue, 17 Sep 2024 14:38:59 +0200 Subject: [PATCH] add little comment to explain utility functions --- antarest/core/serialization/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/antarest/core/serialization/utils.py b/antarest/core/serialization/utils.py index cb4326b5ab..2181026f41 100644 --- a/antarest/core/serialization/utils.py +++ b/antarest/core/serialization/utils.py @@ -15,7 +15,11 @@ ADAPTER: pydantic.TypeAdapter[t.Any] = pydantic.TypeAdapter( type=t.Any, config=pydantic.config.ConfigDict(ser_json_inf_nan="constants") -) +) # ser_json_inf_nan="constants" means infinity and NaN values will be serialized as `Infinity` and `NaN`. + + +# These utility functions allow to serialize with pydantic instead of using the built-in python "json" library. +# Since pydantic v2 is written in RUST it's way faster. def from_json(data: t.Union[str, bytes, bytearray]) -> t.Dict[str, t.Any]: