adsabs/ADSimportpipeline — pull request #45 by jonnybazookatone (2014-09-07 15:54:42+00:00)
Title: Removing globals and NumPy implementation

Hi. When we spoke at the interview, you mentioned that the ADSimportpipeline would be one of the tasks to be carried out. I had a quick look around and noticed that you had some global definitions lying around and some mathematics that may work better with NumPy.

I moved the Hungarian Algorithm into it's own class, removing the need for global definitions. It is now standalone and can be easily moved and re-used elsewhere if required. It passes the standard unit tests you have setup (0.007 seconds vs. 0.006 seconds).

I also re-wrote some of it into a more NumPy way. The normal unittest is about 3 times slower with the numpy way (0.023 seconds vs 0.007 seconds). However, the NumPy version scales much better for larger data, i.e., for 500 extra fields, it takes 50 times longer for the NumPy class, but 100 times longer for the Pythonic class. I've left the class in the code, but it is only useful if your use case requires a large number of fields to be processed to make it worth implementing.

Jonny