Closed jlstevens closed 10 years ago
Makes sense. A few comments:
attrs
need to be an AttrTree
? A simple dict would eliminate the need to use upper-case names, which are a bit awkward.Ok great!
I'll make this commit directly to keep the commit logs clean, making sure to include a reference to this PR. I also agree that attrs
doesn't need to be an AttrTree
- I will switch it to a regular dictionary in a later commit.
EDIT1: Applied these changes to master in commit e0db6188
EDIT2: Switched attrs
from AttrTree
to dictionary in commit 3fd64fa
This PR fixes some annoyances with the submodel system:
topo.sim.model.V1
does not refer to a declarativeSheetSpec
object - instead this points to a method called 'V1'. Although important for defining the model class, this isn't particularly useful to the user once the model object has been created. It is confusing to havemodel.V1
andmodel.sheets.V1
on the same object.Model
were a mix of declarative objects (e.g.model.sheets
andmodel.projections
) and the decorated methods used to create those objects. In contrast,SheetSpec
andProjectionSpec
existed as distinct declarative objects (which can be called to be instantiated).The solution proposed here is to introduce a
ModelSpec
which is the declarative counterpart to aModel
definition class. Just likeSheetSpec
andProjectionSpec
it can be called to instantiate the corresponding model. This helps make a clearer distinction between the model definition (code), the model specification (lightweight, declarative object) and simulation components (memory hungry objects).