respec / HSPsquared

Hydrologic Simulation Program Python (HSPsquared)
GNU Affero General Public License v3.0
43 stars 17 forks source link

Improve Container Understandability/Usability #162

Open rburghol opened 1 month ago

rburghol commented 1 month ago

Currently, creating ModelObject handler classes involves a syntax where a container object is passed in as an argument to the class _init() method when instantiating a new object. Then, container is stored as a reference from the object itself, and since the container contains a reference to the state Dict, the new child has access to this as well. The rationale, or utility, of the existing approach is that:

However, this can make for awkward looking syntax, and creates an un-necessary recursive relationship between state and container. This could be improved by:

@austinorr

Object Interface Changes