Refactor the record module
rpreen opened this issue · comments
Richard Preen commented
The current implementation of the record.py
module works, but is a bit hacky.
- There should probably be a dedicated
filenames: list[str]
attribute that holds the serialized filenames and a separatedata
attribute that points to the object (e.g.,DataFrame
) especially as we add more output types - instead of what we have at the moment which is anoutput
attribute that points to the object until it's serialized and then points to the filenames. This also creates a bunch of issues when performing static type checking. - Serialization is performed in the
to_dict()
function becauseto_dict()
is used for wrapping theRecord
into a format for printing as well as serializing when probablyto_dict()
should be just for dictionary conversion. That is, theRecord
class probably should implement aprint()
method. - etc.