InstituteforDiseaseModeling / covasim

COVID-19 Agent-based Simulator (Covasim): a model for exploring coronavirus dynamics and interventions
https://covasim.org
MIT License
250 stars 223 forks source link

apply aggregates to data #319

Closed CelinaAssal closed 2 years ago

CelinaAssal commented 3 years ago

Problem

Currently, load_household_data.py has code without being sorted into methods or classes, having nothing tying it together to allow it to be treated as a single unit.

Solution

A solution to this is applying aggregates. This allows for clarity in domain driven design. Additionally, it allows for invariants to be applied and maintained to closely related objects, rather than having it applied to each object individually.

How?

This was done by adding root Household. As this is our root, we can treat the methods within it as a single unit when it comes to things such as invariants.

Please Note**** that these changes are part of a school project.

cliffckerr commented 2 years ago

Thanks for the PR -- we're not considering major architectural changes currently, but we appreciate the contribution to open-source software!