Please note: this project is inactive since early 2006

 
2.4.4.1 Model's version

A special property, version, should be set in every PyModel, and it should be equal to PyModel.Model.VERSION, currently '0.1' (a string value).

Its purpose is to track changes in the PyModel mechanisms, especially to warn you when some defaults have changed. When this happens, the file MIGRATION shipped along with the source distribution, and located in the top-level directory of the distribution, this file will contain details about the changes, such as: the defaults that should be checked, how to update your existing PyModels, etc.

How does this work? When a PyModel is interpreted, its version is checked; if they do not correspond, you will get an exception PyModel.IncompatibleVersionError (a subclass of RuntimeError).

We highly recommend that you use the literate string value of version and that you do not directly assign PyModel.Model.VERSION to it; you'll supply it as a property, like in:

>>> model=PyModel.Model('ModelName')
>>> model.version='0.1'

or:

>>> model=PyModel.Model('<ModelName>', version='0.1')

This way, you are sure that you'll be warned when the default behaviour of PyModels changes.

Comments are welcome: Sebastien Bigaret / Modeling Home Page
Hosted by:SourceForge.net Logo