From 83e49c569c2b53a7068f42df616ed8ee695a0fb8 Mon Sep 17 00:00:00 2001 From: Bryn Keller Date: Mon, 2 May 2016 11:50:31 -0700 Subject: Added readme section on installation, removed code that blocked execution under 2.7. Still needs work to build on desired platforms --- python/README.rst | 18 ++++++++++++++++++ python/setup.py | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/python/README.rst b/python/README.rst index 8495e5f..3fd685d 100644 --- a/python/README.rst +++ b/python/README.rst @@ -40,6 +40,24 @@ the algorithm. We provide the following choices of representation classes: * ``full_pivot_column``: The same idea as in the sparse version. However, instead of a ``std::set``, the pivot column is expanded into a bit vector of size n (the dimension of the matrix). To avoid costly initializations, the class remembers which entries have been manipulated for a pivot column and updates only those entries when another column becomes the pivot. * ``bit_tree_pivot_column`` (default representation): Similar to the ``full_pivot_column`` but the implementation is more efficient. Internally it is a bit-set with fast iteration over nonzero elements, and fast access to the maximal element. +Installation +------------ + +Suppose you have checked out the PHAT repository at location $PHAT. Then you can: + +``` +cd $PHAT/python + +pip install . +``` + +This will install PHAT for whatever Python installation your `pip` executable is associated with. +Also note that this will install dependencies (pybind11) as well. +If you already have pybind11 installed, then `python setup.py install` will most likely work too. + +Currently, the PHAT Python bindings are known to work on Mac OS X with Python 3.5. Other configurations are untested but in progress. +Please let us know if there is a platform you'd like us to support, we will do so if we can. + Sample usage ------------ diff --git a/python/setup.py b/python/setup.py index 5e71cc7..2c6d65d 100644 --- a/python/setup.py +++ b/python/setup.py @@ -2,6 +2,7 @@ from setuptools import setup, Extension, find_packages from setuptools.command.build_ext import build_ext import sys import os.path + ext_modules = [ Extension( '_phat', @@ -14,7 +15,7 @@ ext_modules = [ here = os.path.abspath(os.path.dirname(__file__)) # Get the long description from the README file -with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f: +with open(os.path.join(here, 'README.rst')) as f: long_description = f.read() class BuildExt(build_ext): -- cgit v1.2.3