Skip to content

ProcessingInputCollection deserialization classmethod #145

@greglucas

Description

@greglucas

This is more of a question / design discussion and very minor and doesn't need to be addressed, just something that I noticed so figured I would write it down.

It looks like we are creating an empty class and then calling desserialize on that. That seemed odd to me at first glance and I was wondering if it would instead be more appropriate as a classmethod?

my_instance = ProcessingInputCollection()
my_instance.deserialize(input_json)

to instead be:

my_instance = ProcessingInputCollection.deserialize(input_json)

(or it could be called from_json() for example)

I tried making this update, but there is a test for calling deserialize multiple times and expecting that to update the instance inplace. I wasn't sure whether that was needed or not, and if an alternative would be to always serialize/deserialize between a single object and then we could add an __add__ method if we wanted to combine collections together. But, I wasn't sure when we need to add collections together.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions