Suppressing Python Warnings

Posted on November 17th, 2011

Every so often you run into a situation where a piece of code will knowingly raise a warning that you might want to hide from the end user. Good example of this would be a deprecation warning.

Luckily Python provides a handy context manager that can help you catch and filter various warnings.
Here’s a quick example of how to go about doing just that:

# Import warnings module
import warnings

# Initialize context manager
with warnings.catch_warnings ():
    # Suppress warnings
    warnings.simplefilter ('ignore')

    # Put your warning prone code here

Hope this is useful!


No Comments »


Source control

Posted on April 7th, 2009

Whether you’re and artist working on a model or a technical director writing a script you undoubtedly have to diligently make sure to save incrementally and back up your work to give you a peace of mind that your work is secure against corruption or user error. While manually backing up your data can be sufficient for a single file project it can quickly become unmanageable and unreliable if the scope of your task begins to grow.

 

Recently I found myself struggling to keep track of revisions I made to several python libraries as I was iterating on a custom plug-in. I wanted to be able to save a working version of my plug-in after every major modification. Naturally I began to look into version control systems like SVN.

 

Thankfully a friend and a colleague of mine, Kevin Hayes, pointed me in a direction of Perforce. I have been using the Perforce software for several years now at work but never considered it as an option for personal use. As Kevin pointed out Perforce Software is kind enough to provide a fully featured version of Perforce for personal use. While it is limited to two users and five workspaces it is more than enough to keep track of your personal work at home.

 

The installation of the Perforce client is really straight forward. I set up my depot database on my portable hard drive which basically gives me a portable server. With the five client workspaces you could set up your local depot on multiple computers and sync those with the ‘server’ as desired.

 

You can find more information about Perforce on their website:
http://www.perforce.com/perforce/demo/testdrive.html

 

It’s been a real time saver for me recently so give it a try if you get a chance.

 

Cheers.


No Comments »


Welcome!

Posted on December 12th, 2008

Welcome to my personal website showcasing my latest artwork as well as development and research projects. I plan to update it regularly with discussions on various topics that I run across during my daily work as well as anything else I find useful to share with cg community. Hopefully this will be a good resource for anyone interested in 3d as well as for those who would like to know more about me and what I do professionally.

 

Thank you and enjoy your stay.


No Comments »