On 02/29/2012 05:52 PM, David Mashburn wrote:
I wanted to introduce myself and first of all say thank you for the hard work you have put into sfepy. The breadth of this little program is somewhat astounding and I really think it is going to be a boon to me in my research in biomechanics.
Thank you for such kind words!
I have been looking through the code of sfepy, and I had a comment about base/base.py:
I notice that your problem definition files are loaded with import/ reload. I do something similar in my project (http://code.google.com/p/ seedwater/, https://github.com/davidmashburn/SeedWaterSegmenter) and recently switched to using the "imp" module and the load_module function: """ import imp ... fid=open(seedPointsFile,'U') Seeds = imp.load_module('Seeds',fid,'Seeds.py',('.py','U',1)) fid.close() """
If I remember right, it not only avoided messing with sys.path, but actually executed significantly faster in some circumstances. You may already know about this and/or have a reason not to use it, but I thought I would share my experiences.
Good to know, I was not aware of this module. There is no special reason we do it the current way. I will check imp.
Thanks again and look forward to using more of this great project! -David
Great, thanks for your interest! r. PS: looking forward to seeing some images on your web site...