ioam/topographica — pull request #580 by jlstevens (2014-08-12 19:46:44+00:00)
Title: Refactored submodel system to use ModelSpecs

This PR fixes some annoyances with the submodel system:

* ``topo.sim.model.V1`` does not refer to a declarative ``SheetSpec`` 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 have ``model.V1`` and ``model.sheets.V1`` on the same object.

* The subclasses of ``Model`` were a mix of declarative objects (e.g. ``model.sheets`` and ``model.projections``) and the decorated methods used to create those objects. In contrast, ``SheetSpec`` and ``ProjectionSpec`` 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 a ``Model`` definition class. Just like ``SheetSpec`` and ``ProjectionSpec`` 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).