Skip to content

Commit

Permalink
add little comment to explain utility functions
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Sep 17, 2024
1 parent 7815a80 commit fca691a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion antarest/core/serialization/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit fca691a

Please sign in to comment.