Skip to content

Commit

Permalink
Merge pull request #29 from EmoryUniversityTheoreticalBiophysics/py3
Browse files Browse the repository at this point in the history
updating to python 3
  • Loading branch information
bcdaniels authored Jun 13, 2022
2 parents d10531e + 20bdda0 commit 84f35c3
Show file tree
Hide file tree
Showing 44 changed files with 2,667 additions and 11,524 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,6 @@ wheels/
.installed.cfg
*.egg

# backup files
*.bak

38 changes: 38 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM ubuntu:latest
RUN apt-get update && apt-get -y update
FROM python:2
ARG DEBIAN_FRONTEND=noninteractive
RUN mkdir app
RUN apt-get update -y && \
apt-get install -y --no-install-recommends sudo apt-utils && \
apt-get install -y --no-install-recommends openssh-server \
python-dev python-numpy python-pip python-virtualenv python-scipy \
gcc gfortran libopenmpi-dev openmpi-bin openmpi-common openmpi-doc binutils && \
apt-get clean && apt-get purge && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /app
RUN useradd --create-home --home-dir /home/docker --shell /bin/bash docker
RUN usermod -a -G sudo docker
RUN echo "docker ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN wget http://www.open-mpi.org/software/ompi/v4.1/downloads/openmpi-4.1.1.tar.gz
RUN tar xzvf openmpi-4.1.1.tar.gz
WORKDIR openmpi-4.1.1
RUN ./configure --prefix=/usr/local/openmpi4.1.1
RUN make all
RUN make install
RUN MPI_DIR=/usr/local/openmpi4.1.1
ENV LD_LIBRARY_PATH="${MPI_DIR}/lib:${LD_LIBRARY_PATH}"
ENV PATH="/usr/local/openmpi4.1.1/bin:${PATH}"
RUN git clone https://github.com/mpi4py/mpi4py.git ./mpi4py.git
WORKDIR mpi4py.git
RUN python setup.py build --mpicc=/usr/local/openmpi4.1.1/bin/mpicc
RUN python setup.py install
WORKDIR /app
RUN apt-get -y update && apt -y install libopenmpi-dev

RUN pip install numpy
RUN pip install jupyter notebook
RUN git clone -b mpi4py-convesion https://github.com/diging/SloppyCell.git
RUN pip install -e SloppyCell/
RUN git clone -b pypar-check https://github.com/diging/SirIsaac.git
RUN pip install -e SirIsaac/
CMD ["jupyter", "notebook", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--allow-root"]
61 changes: 49 additions & 12 deletions Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ Installing SirIsaac

SirIsaac depends on the following packages:

- Python 2.6 or later (not Python 3)
- Python 3
- Scipy
- Numpy
- Matplotlib
- SloppyCell (https://github.com/GutenkunstLab/SloppyCell)

There exist several relatively simple ways to install
the first three packages above at once, including
the first four packages above at once, including

- Anaconda: http://www.anaconda.com
- Sage: http://www.sagemath.org
Expand All @@ -20,15 +21,13 @@ These systems also have the added benefit of coming
prepackaged with other useful software such as
iPython and Jupyter.

Note: As of June 2020, SirIsaac does not support Python 3 (we are working on it). Installing Python 2 using the above package managers is likely no longer the default option as it is now officially out of date.

### Install SloppyCell

SirIsaac depends on the latest
version of SloppyCell, available on GitHub.
In the simplest case, you can install with two steps. First download the git repository by running

https://github.com/GutenkunstLab/SloppyCell.git
git clone https://github.com/GutenkunstLab/SloppyCell.git

which will create a folder named `SloppyCell` in the current directory. Next, install SloppyCell by running setup.py. The easiest way to do this is using `pip`:

Expand All @@ -46,18 +45,22 @@ which will create a folder named `SirIsaac` in the current directory. Next, ins

## Test installation

A basic test of the SirIsaac and SloppyCell installation can be
run by descending into the `SirIsaac/SirIsaac/` directory and running
A basic suite of unit tests can be run by moving into the SirIsaac directory and running

python -m unittest

python SloppyCellTest.py
This should take about a minute to run. Note that there may be lots of warnings and compiler optimization messages (we're working on it...), but if you see something like the following then all tests have passed:

More comprehensive tests are found in the `test` subfolder, and can be run using, e.g., `nosetests`.
---------------------------------------------
Ran 9 tests in 56.687s

OK

To further help you get up and running,
code to fit and analyze a simple example dataset
using SirIsaac is provided in two formats:
Python (simpleExample.py) and a Jupyter iPython
notebook (simpleExample.ipynb). The
a Jupyter iPython
notebook (simpleExample.ipynb) and a simple Python script (simpleExample.py). The
iPython notebook opens in a web browser and
includes plots in an interactive format. To
open the .ipynb file, run:
Expand All @@ -68,5 +71,39 @@ To run the .py file in iPython at the command line, run:

ipython --pylab
%run simpleExample.py
show()
plt.show()

## Running in parallel

To run parameter fitting in parallel, you will need to install mpi4py, which further depends on an installation of mpi (often OpenMPI, depending on your operating system). For more information about installing mpi4py, see here: https://pypi.org/project/mpi4py/

Following are notes from one user detailing OpenMPI installation—these are somewhat outdated (using Python 2.7) but could potentially be useful:

OpenMPI Installation

Download the latest version(4.1.1) from https://www.open-mpi.org/software/ompi/v4.1/
Refer the Building MPI from sources section for the installation.

Another source for OpenMPI Installation - https://gist.github.com/mrosemeier/088115b2e34f319b913a

Other Installations that were done for Ubuntu

pip install mpi4py

sudo apt-get install python-dev \
build-essential libssl-dev libffi-dev \
libxml2-dev libxslt1-dev zlib1g-dev \

sudo apt install libopenmpi-dev

sudo apt-get install python2.7-dev
sudo apt-get install build-essential
sudo apt-get install gcc
sudo apt-get install python-dev gcc
sudo apt-get install python2-dev build-essential gcc libpq-dev
sudo apt-get install libblas-dev libatlas-base-dev
sudo apt-get install build-essential gcc gfortran git
sudo apt install gfortran


10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ https://doi.org/10.1371/journal.pone.0119821
Dependencies
============

Python 2.6 or later (not Python 3)
Python 3
Numpy
Scipy
Matplotlib
(One way to install the above is with Anaconda or Sage. See Installation.md.)
Expand All @@ -49,9 +50,10 @@ ipython (for reading ipython notebook file describing example usage)
Contributors
============

Bryan Daniels, Ilya Nemenman


Bryan Daniels
Ilya Nemenman
hashknot
sudheerad9



Loading

0 comments on commit 84f35c3

Please sign in to comment.