From 79f890b28ce3a3d388ea9fb91b6f8f999c566497 Mon Sep 17 00:00:00 2001 From: MstrPikachu <31784486+MstrPikachu@users.noreply.github.com> Date: Mon, 13 Dec 2021 03:15:11 -0500 Subject: [PATCH] Add representation invariants to processing.py --- src/processing.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/processing.py b/src/processing.py index 3eab64b..70eaaea 100644 --- a/src/processing.py +++ b/src/processing.py @@ -103,6 +103,10 @@ def get_user_popularity_ranking(user: str) -> int: class UserSample: """ This is a data class storing our different samples. + + Representation Invariants: + - all(news != '' for news in self.english_news) + """ most_popular: list[ProcessedUser] random: list[ProcessedUser] @@ -219,6 +223,10 @@ class Posting(NamedTuple): """ Posting data stores the processed tweets data, and it contains info such as whether or not a tweet is covid-related + + Representation Invariants: + - popularity >= 0 + """ # Full text of the post's content covid_related: bool