CamDavidsonPilon/lifelines — pull request #111 by spacecowboy (2014-12-14 21:53:58+00:00)
Title: Make lifelines work in pure python mode

Added a pure python version of concordance index,
as a fallback option, for developers without access
to a proper compiler (Windows people). This allows for
easier contribution to the library, while still allowing
us to maintain the higher speed for users who install from
pypi.

The setup script will now try to compile the extensions, and if
it fails, it will do it again with just the python source.

You can try it by for example renaming the fortran file:

mv lifelines/_utils/_cindex.f90 lifelines/_utils/_cindex.f90.bak

and try to build:

python setup.py build

which results in the following output:
```
$ python setup.py build easier_dev deleted untracked
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "lifelines._utils._cindex" sources
f2py options: []
f2py:> build/src.linux-x86_64-3.4/lifelines/_utils/_cindexmodule.c
creating build
creating build/src.linux-x86_64-3.4
creating build/src.linux-x86_64-3.4/lifelines
creating build/src.linux-x86_64-3.4/lifelines/_utils
IOError: [Errno 2] No such file or directory: 'lifelines/_utils/_cindex.f90'. Skipping file "lifelines/_utils/_cindex.f90".
Reading fortran codes...
Post-processing...
Post-processing (stage 2)...
Building modules...
Failed to build. Trying again without native extensions.
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_py
creating build/lib
creating build/lib/lifelines
copying lifelines/generate_datasets.py -> build/lib/lifelines
copying lifelines/utils.py -> build/lib/lifelines
copying lifelines/estimation.py -> build/lib/lifelines
copying lifelines/progress_bar.py -> build/lib/lifelines
copying lifelines/plotting.py -> build/lib/lifelines
copying lifelines/__init__.py -> build/lib/lifelines
copying lifelines/statistics.py -> build/lib/lifelines
creating build/lib/lifelines/datasets
copying lifelines/datasets/__init__.py -> build/lib/lifelines/datasets
creating build/lib/lifelines/_utils
copying lifelines/_utils/cindex.py -> build/lib/lifelines/_utils
copying lifelines/_utils/__init__.py -> build/lib/lifelines/_utils
creating build/lib/lifelines/tests
copying lifelines/tests/test_utils.py -> build/lib/lifelines/tests
copying lifelines/tests/test_estimation.py -> build/lib/lifelines/tests
copying lifelines/tests/test_generate_datasets.py -> build/lib/lifelines/tests
copying lifelines/tests/__main__.py -> build/lib/lifelines/tests
copying lifelines/tests/test_plotting.py -> build/lib/lifelines/tests
copying lifelines/tests/__init__.py -> build/lib/lifelines/tests
copying lifelines/tests/test_statistics.py -> build/lib/lifelines/tests
copying lifelines/../README.md -> build/lib/lifelines/..
copying lifelines/../README.txt -> build/lib/lifelines/..
copying lifelines/../LICENSE -> build/lib/lifelines/..
copying lifelines/../MANIFEST.in -> build/lib/lifelines/..
copying lifelines/../CoxTest.ipynb -> build/lib/lifelines/..
copying lifelines/datasets/kidney_transplant.csv -> build/lib/lifelines/datasets
copying lifelines/datasets/larynx.csv -> build/lib/lifelines/datasets
copying lifelines/datasets/regression.csv -> build/lib/lifelines/datasets
copying lifelines/datasets/rossi.csv -> build/lib/lifelines/datasets
copying lifelines/datasets/lung.csv -> build/lib/lifelines/datasets
copying lifelines/datasets/gehan.dat -> build/lib/lifelines/datasets
copying lifelines/datasets/Divorces Rates.ipynb -> build/lib/lifelines/datasets
copying lifelines/datasets/divorce.dat -> build/lib/lifelines/datasets
copying lifelines/datasets/panel_test.csv -> build/lib/lifelines/datasets
copying lifelines/datasets/CuZn-LeftCensoredDataset.csv -> build/lib/lifelines/datasets
copying lifelines/datasets/dd.csv -> build/lib/lifelines/datasets
copying lifelines/datasets/psychiatric_patients.csv -> build/lib/lifelines/datasets
copying lifelines/datasets/static_test.csv -> build/lib/lifelines/datasets
copying lifelines/datasets/The Gehan Survival Data.ipynb -> build/lib/lifelines/datasets
copying lifelines/datasets/canadian_senators.csv -> build/lib/lifelines/datasets
copying lifelines/datasets/waltons_dataset.csv -> build/lib/lifelines/datasets
```