Posts

Showing posts from 2008

Generating tests in Python unittest

There are many applications where you want to apply a code to a variety of data sets, and verify that you get the correct output. In this context, what you want is a test generator, which can dynamically create tests, based on the set of data sets that are available for testing. Unfortunately, this does not appear to be a feature of unittest . The closest I have seen to this, is the support for test generators in the nose package, which extends unittest to provide test discovery mechanisms. However, that test generation feature is somewhat limited; it only applies to test functions that are Python generators, and not to similar class methods. The following example shows how to directly insert new test methods into a unittest.TestCase class : # # A simple example for generating tests in the Python unittest framework # import glob import unittest # # Defining the class that will contain the new tests # class TestCases(unittest.TestCase): pass # # A generic function that performs a te

Constraint Programming

Nick Berger pointed me to the Global Constraint Catalog , a collection of constraints that are can be used for constraint programming formulations.  This looks like a nice reference!

New Journal: Mathematical Programming Computation

I have recently joined the editorial board of the new journal Mathematical Programming Computation , which publishes original research articles that are at the intersection of math programming and computing. This journal reflects the growing role of computation in operations research, where real-world applications often require the application of complex software packages to analyze mathematical models. This journal will include articles that report on innovative software, comparative tests, modeling environments, libraries of data, and/or applications. A main feature of the journal is the inclusion of accompanying software and data with submitted manuscripts. The journal's review process includes the evaluation and testing of the accompanying software. Where possible, the review will aim for verification of reported computational results. Topics covered in Mathematical Programming Computation include linear programming, convex optimization, nonlinear optimization, stochastic opti

Online Video Tutorials

By necessity, I have become quite adept at digging through webspace with search engines like google to figure out "how to do X". But occasionally, it is difficult to get a sense of whether something is easy from written instructions. For example, I recently tried to install PyQT, a Python interface to the popular QT application interface library, and here's the error that I got when trying to use nmake to build the SIP library (which PyQT uses): C:\Python25\sip-4.7.6\sip-4.7.6\siplib>nmake Microsoft (R) Program Maintenance Utility Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved. cl -c -nologo -Zm200 -O2 -MD -W0 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -I. -IC:\Python25\include -Fo @C:\DOCUME~1\wehart\LOCALS~1\Temp\nm271.tmp NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\bin\cl.EXE"' : return code '0xc0000135' Stop. I had more than a little difficulty figuring out what the ret

Why Python?

In the past year, I have increasingly been using Python to develop a variety of OR-related scientific software. In particular, the Coopr library has been a major focus of this software development. Recently, I have written a paper that will appear in the proceedings of the INFORMS Computing Society Conference 2009 : W. Hart, Python Optimization Modeling Objects (Pyomo) , Proc. INFORMS Computing Society Conference, 2009, (to appear). In this paper, I describe Pyomo, an open-source tool for modeling optimization applications in Python. A key goal of Pyomo is to provide an open-source math programming modeling capability. Although open-source optimization solvers are widely available in packages like COIN-OR , surprisingly few open-source tools have been developed to model optimization applications. Pyomo has been developed in Python because it is a well-used modern programming language that provides a robust foundation for developing and applying scientific software. In this paper, I

INFORMS ICS Meeting

If you are interested in the intersection of operations research and computing, then the INFORMS ICS Meeting will be of interest to you! I am organizing a session on open-source software for operations research. Contact me if you are interested in giving a presentation!

Why open-source software?

Much of my work involves the development of open-source software. Recently, I have been challenged to justify this in several different projects. I recently stumbled across Dave Wheeler's paper , which provides a nice quantitative analysis of the advantages of open-source software.

Testing ScribeFire

I'm going to try using ScribeFire to generate these posts. This seems highly recommended. Also, I can work with it offline, which is a definite plus for me!

Starting to blog...?

OK, this is really my second blogging experience. I'm currently the 'blogger in residence' for the INFORMS Computing Society . Though I'm still trying to figure out what that means, I blogged the last INFORMS Annual Meeting . So, why this blog? I do a lot of software development at Sandia National Laboratories, mostly focused on scientific computing and optimization. The more I work with open-source projects, the more I realize that I should archive some of my 'lessons learned'. Although I like to publish papers, a blog is a better way to informally share information!