From 049d594c19b956302063886a0ec1656bd4d762db Mon Sep 17 00:00:00 2001 From: MstrPikachu <31784486+MstrPikachu@users.noreply.github.com> Date: Mon, 13 Dec 2021 01:34:56 -0500 Subject: [PATCH] Add representation invariants to utils.py --- src/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/utils.py b/src/utils.py index 2c0a498..4ee4bec 100644 --- a/src/utils.py +++ b/src/utils.py @@ -118,6 +118,9 @@ class Reporter: Attributes: - report: The string of the report - file: Where the report is stored + + Representation Invariants: + - self.file != '' """ report: str file: str @@ -360,6 +363,10 @@ def divide_zeros(numerator: list[float], denominator: list[float]) -> list[float class EnhancedJSONEncoder(json.JSONEncoder): + """ + An improvement to the json.JSONEncoder class, which supports: + encoding for dataclasses, encoding for datetime, and sets + """ def default(self, o): # Support encoding dataclasses