lisa-lab/pylearn2 — pull request #442 by chandiar (2013-10-24 20:18:33+00:00)
Title: Added script to get version of python packages

I added the LibVersion class to store version of python packages. An object of this class will be able to store version of python packages in a dictionary (named versions). The keys of this dict are the name of the packages and the values associated are the version number of the packages.

Also, it has a function (named get_versions) to get a string representation of the version of the python packages like this:
numpy:1.6.1 | pylearn:a6e634b83d | pylearn2:4575c3dd6e | scipy:0.9.0 | theano:cc4fc1008e | jobman:?

Unknown packages are associated with a question mark.

The get_version.py script can also be run to get version of the python packages printed in the terminal.

I added a function in the Model abstract class to get the version of the python packages called get_versions. This function will check first if there is already a libv object (an instance of the LibVersion class); if not it will instantiate the LibVersion class. It will return the version of the python packages as a string.

Could the LibVersion instantiation be done in the Model's __init__ function? So that every class that inherits from Model can have access to LibVersion early on in their instantiation.