From 0f14eeaa0422adf7cbcd70cb79641b028021e503 Mon Sep 17 00:00:00 2001
From: David Hendriks <davidhendriks93@gmail.com>
Date: Sat, 26 Jun 2021 00:04:03 +0100
Subject: [PATCH] Updated setup and reaadme and some distributions. Docs are
 failing so we need to fix those

---
 README.md                                     | 26 ++++++++++++-------
 binarycpython/utils/distribution_functions.py |  3 +--
 setup.py                                      |  7 ++---
 3 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/README.md b/README.md
index 6748dc191..3e3b5eff1 100644
--- a/README.md
+++ b/README.md
@@ -5,8 +5,8 @@ updated and extended for Python3 by Robert Izzard, David hendriks
 
 ## Requirements
 To run this code you need to at least have installations of:
-- Python3
-- binary_c version 2.1+
+- Python 3.6 or higher
+- binary_c version 2.1.7 or higher
 
 And the following python packages (which will get installed automatically when installing with pip):
 - numpy
@@ -16,6 +16,7 @@ And the following python packages (which will get installed automatically when i
 - pandas
 - astropy
 - matplotlib
+- py_rinterpolate
 
 ## Environment variables
 Before compilation you need to have certain environment variables:
@@ -24,6 +25,7 @@ Required:
 - `BINARY_C` should point to the root directory of your binary_c installation
 - `LD_LIBRARY_PATH` should include $BINARY_C/src and whatever directories are required to run binary_c (e.g. locations of libgsl, libmemoize, librinterpolate, etc.)
 - `LIBRARY_PATH` should include whatever directories are required to build binary_c (e.g. locations of libgsl, libmemoize, librinterpolate, etc.)
+- `GSL_DIR` should point to the root location where you installed GSL to. This root dir should contain `bin/`, `lib/` etc
 
 ## Build instructions
 First, make sure you have built binary_c (See `$BINARY_C/doc/binary_c2.pdf` section: installation for all the installation instructions for `binary_c`)) and that it functions correctly. 
@@ -36,23 +38,29 @@ pip install binarycpython
 ```
 
 ### Installation from source:
-For this it is best to set up a virtual environment for this. Activate the virtualenvironment and enter the downloaded version of the repo. 
+For this it is best to set up a virtual environment. Activate the virtualenvironment and enter the cloned version of the repo.
 
-Then run
+Then run:
 ```
-python setup.py clean && python setup.py build --force && python setup.py sdist && pip install --ignore-installed --no-dependencies -v dist/binarycpython-<version of this package>.tar.gz
+python setup.py clean && python setup.py build --force && python setup.py sdist && pip install -v dist/binarycpython-<version of this package>.tar.gz
 ```
+You can find the version of this package in setup.py.
 
 This will install this package into the virtual environment. Making changes to the sourcecode can be "installed" into the virtual env with the same command. 
 
+If this is not the first time you install the package, but rather rebuild it because you make changes in either binary_c or binarycpython, you should ignore the currently installed version, and also skip installing the dependencies again, by executing the following command:
+```
+python setup.py clean && python setup.py build --force && python setup.py sdist && pip install --ignore-installed --no-dependencies -v dist/binarycpython-<version of this package>.tar.gz
+```
+
 ## Examples
-See the examples/ directory for example script. The documentation contains example pages as well. 
+See the examples/ directory for example scripts and notebooks. The documentation contains example pages as well. 
 
 ## Usage notes
-Make sure that with every change/recompilation you make in `binary_c`, you also rebuild this package. 
+Make sure that with every change/recompilation you make in `binary_c`, you also rebuild this package. Whenever you change the sourcecode of this package, you need to reinstall it into your virtualenvironment as well
 
 ## Documentation
-Look in the doc/ directory. Within the build/html/ there is the html version of the documentation. 
+Look in the docs/ directory. Within the build/html/ there is the html version of the documentation. The 
 
 ## FAQ/Issues:
 Building issues with binary_c itself: 
@@ -67,4 +75,4 @@ When Pip install fails:
 
 Other:
 - When running jupyter notebooks, make sure you are running the jupyter installation from the same virtual environment. 
-- When the output of binary_c seems to be different than expected, you might need to rebuild this python package. Everytime binary_c is compiled, this package needs to be rebuilt too. 
\ No newline at end of file
+- When the output of binary_c seems to be different than expected, you might need to rebuild this python package. Everytime binary_c is compiled, this package needs to be rebuilt too. 
diff --git a/binarycpython/utils/distribution_functions.py b/binarycpython/utils/distribution_functions.py
index 0fb0037c6..3d0ea4ca3 100644
--- a/binarycpython/utils/distribution_functions.py
+++ b/binarycpython/utils/distribution_functions.py
@@ -420,8 +420,7 @@ def gaussian(
 def Kroupa2001(m: Union[int, float], newopts: dict = None) -> Union[int, float]:
     """
     Probability distribution function for kroupa 2001 IMF, where the default values to the
-    three_part_powerlaw are:
-        default = {"m0": 0.1, "m1": 0.5, "m2": 1, "mmax": 100, "p1": -1.3, "p2": -2.3,"p3": -2.3}
+    three_part_powerlaw are: default = {"m0": 0.1, "m1": 0.5, "m2": 1, "mmax": 100, "p1": -1.3, "p2": -2.3,"p3": -2.3}
 
     Args:
         m: mass to evaluate the distribution at
diff --git a/setup.py b/setup.py
index 3c86dc24e..1641ed09d 100644
--- a/setup.py
+++ b/setup.py
@@ -218,16 +218,13 @@ headers = ["src/includes/header.h"]
 # Override build command
 class CustomBuildCommand(distutils.command.build.build):
     def run(self):
-        # execute_make()
-
-        # print(super().run())
         # Run the original build command
         distutils.command.build.build.run(self)
 
 
 setup(
     name="binarycpython",
-    version="0.3.2",
+    version="0.4",
     description="""This is a python API for binary_c (versions {}) by David Hendriks, Rob Izzard and collaborators. Based on the initial set up by Jeff andrews.""".format(
         ",".join(REQUIRED_BINARY_C_VERSIONS),
         ",".join(REQUIRED_BINARY_C_VERSIONS),
@@ -265,7 +262,7 @@ setup(
     include_package_data=True,
     ext_modules=[BINARY_C_PYTHON_API_MODULE],  # binary_c must be loaded
     classifiers=[
-        "Development Status :: 3 - Alpha",
+        "Development Status :: 4 - Beta",
         "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
         "Intended Audience :: Developers",
         "Intended Audience :: Science/Research",
-- 
GitLab