stefanpauliuk/pySUT — pull request #1 by cmutel (2014-10-26 07:39:59+00:00)
Title: Add setup.py and cleanup code, i.e. make things a bit more pythonic

I think there is more cleanup to do, but this makes things a bit nicer (IMHO).

Note that this code is not python 3 specific - it works fine in 2.7, except for one test:

emerson:pySUT cmutel$ nosetests-2.7
...F....
======================================================================
FAIL: Test simple balances of SUT
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/cmutel/Code/pySUT/pysut/tests/known_results.py", line 225, in test_SUT_balances
mySUT.compare_IndustrialUseAndSupply(), IndSupply_Use, 9)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/testing/utils.py", line 842, in assert_array_almost_equal
precision=decimal)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/testing/utils.py", line 665, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Arrays are not almost equal to 9 decimals

(mismatch 80.0%)
x: array([0, 0, 0, 1, 0])
y: array([ 0.666666667, 0.428571429, 0.5 , 1. , 0.375 ])