Repository: biocircuits/bioscrape (language: python)

Issue:
Error while importing SBML in `import_sbml`
The function `import_sbml_reactions` does not have `sbml_warnings` defined. Fix coming soon.
Sensitivity analysis bug: Original model parameter dictionary is changed after running SSA

Add docstring to `py_sensitivity_analysis`
Important to have this documented so that the size of the array returned is clear. 
Dtype mismatch error when integers are passed in inference routines. 
If integer timepoints are passed in, they must be converted to double in `inference_setup.py` before calling the likelihood functions. Also need to make sure that this is happening for all data/input conditions.

Thanks to @zjuradoq for reporting! 

Exact error message for future reference: 
```
ValueError: Buffer dtype mismatch, expected 'double_t' but got 'long long'
```


Discussion / hints:
Fix is up on this branch: https://github.com/biocircuits/bioscrape/tree/sbml-dev
Fixed in this branch: https://github.com/biocircuits/bioscrape/tree/ssa-fix
Fixed in this branch: https://github.com/biocircuits/bioscrape/tree/ssa-fix


Fix patch:
diff --git a/.github/workflows/bioscrape.yml b/.github/workflows/bioscrape.yml
deleted file mode 100644
index 1e27b7c..0000000
--- a/.github/workflows/bioscrape.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-name: install_and_test_package
-on: [push]
-jobs:
-  build:
-      runs-on: ${{ matrix.os }}
-      strategy:
-        max-parallel: 4
-        matrix:
-          os: [windows-latest, ubuntu-latest, macos-latest]
-          python-version: [3.6, 3.7, 3.8]
-
-      steps:
-      - uses: actions/checkout@v2
-      - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v2
-        with:
-          python-version: ${{ matrix.python-version }}
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          pip install -r requirements.txt
-      - name: install bioscrape and lineage
-        run: python setup.py install
-      - name: Test bioscrape with pytest
-        run: pytest
-      - name: install lineage
-        run: python setup.py install lineage
diff --git a/.github/workflows/deploy_bioscrape.yml b/.github/workflows/deploy_bioscrape.yml
new file mode 100644
index 0000000..d7cd168
--- /dev/null
+++ b/.github/workflows/deploy_bioscrape.yml
@@ -0,0 +1,30 @@
+name: deploy_bioscrape
+on:
+  push:
+    branches: ["master"]
+  pull_request:
+    branches: ["master"]  
+jobs:
+  build:
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [windows-latest, ubuntu-latest, macos-latest]
+        python-version: ["3.7", "3.8", "3.9", "3.10"]
+
+    steps:
+    - uses: actions/checkout@v3
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v3
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install -r requirements.txt
+    - name: install bioscrape and lineage
+      run: python setup.py install
+    - name: Test bioscrape with pytest
+      run: pytest
+    - name: install lineage
+      run: python setup.py install lineage
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index d57ec5d..b0e787b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -104,7 +104,7 @@ ENV/
 # Rope project settings
 .ropeproject
 interactive_testing.ipynb
-
+.pck
 *.svg
 # *.py
 examples/models/generic_expressions.xml
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..c69489b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,109 @@
+# Bioscrape &mdash; Biological Stochastic Simulation of Single Cell Reactions and Parameter Estimation
+## Python toolbox to simulate, analyze, and learn biological system models
+
+[![Build Status](https://github.com/biocircuits/bioscrape/actions/workflows/deploy_bioscrape.yml/badge.svg)](https://github.com/biocircuits/bioscrape/actions/workflows/deploy_bioscrape.yml)
+[![PyPI version](https://badge.fury.io/py/bioscrape.svg)](https://badge.fury.io/py/bioscrape)
+[![status](https://joss.theoj.org/papers/5935db21ffab5b33069d05b7adbdf094/status.svg)](https://joss.theoj.org/papers/5935db21ffab5b33069d05b7adbdf094)
+
+* Getting started with Bioscrape: [![Bioscrape Core](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/biocircuits/bioscrape/blob/colab-ipynb/examples/Basic%20Examples%20-%20START%20HERE.ipynb#scrollTo=Jmm8mTPfhMMS)
+
+* Bioscrape analysis features: [![Bioscrape Sensitivity Analysis](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/biocircuits/bioscrape/blob/colab-ipynb/examples/Sensitivity%20Analysis%20using%20Bioscrape.ipynb#scrollTo=Gu1r4H4ti_z7)
+
+* Parameter inference with Bioscrape: [![Bioscrape Inference](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/biocircuits/bioscrape/blob/colab-ipynb/inference%20examples/Bioscrape%20Inference%20-%20Getting%20Started.ipynb#scrollTo=yvYVliBgjyzF)
+
+Bioscrape is a Systems Biology Markup Language (SBML) simulator written in Cython for speed and Python compatibility. It can be used for deterministic, stochastic, or single cell simulation and also has parameter inference capabilities.
+
+- **Mailing list:** [SBTools Google Group](https://groups.google.com/g/sbtools/) Email: sbtools@googlegroups.com
+- **Source:** https://github.com/biocircuits/bioscrape
+- **Preprint:** - [Fast and flexible simulation and parameter estimation for synthetic biology using bioscrape](https://www.biorxiv.org/content/10.1101/121152v3)
+- **Bug reports:** https://github.com/biocircuits/bioscrape/issues
+- **Slack** Join the #bioscrape channel on SBTools slack: Ask on the public SBTools Google group to be added or send a message to one of the maintainers. 
+
+# Example 1: Simulating an SBML
+
+Bioscrape allows for deterministic and stochastic simulation of SBML models:
+
+```python
+from bioscrape.types import Model
+# Load an SBML file repressilator.xml 
+# (you can find this file in `examples/models` directory)
+M = Model(sbml_filename = 'repressilator_sbml.xml')
+# Simulate the model
+from bioscrape.simulator import py_simulate_model
+import numpy as np
+tp = np.linspace(0,256,100)
+result = py_simulate_model(timepoints=tp, Model=M, stochastic=True)
+# Plot the simulation result (the result is a Pandas dataframe)
+import matplotlib.pyplot as plt
+plt.plot(tp, result['X'])
+```
+
+# Example 2: Run Bayesian inference with Bioscrape 
+
+Bioscrape can be used to identify model parameters using experimental data. In the example below, we show the user-friendly plug-and-play nature of bioscrape inference. We load the data as a Pandas dataframe and the model as an SBML file. The Bayesian inference is implemented as a wrapper for Python emcee that implements Markov Chain Monte Carlo (MCMC) sampler. Bioscrape inference provides various features such as: multiple data conditions, multiple data trajectories, deterministic inference, automatic visualization of posteriors, convergence checking tools, built-in and customizable priors, and lots more!
+
+```python
+from bioscrape.types import Model
+import pandas as pd
+from bioscrape.inference import py_inference
+
+# Load an SBML model 
+# (you can get this file in `inference examples/models/` directory)
+M = Model(sbml_filename='toy_sbml_model.xml')
+
+# Load experimental data 
+# (you can find test data in `inference examples/data/` directory)
+df = pd.read_csv('test_data.csv', delimiter = '\t', 
+                 names = ['X','time'], skiprows = 1)
+
+# Use built-in priors, 
+# For 'd1': a Gaussian distribution of mean 0.2 and standard deviation of 20,
+# while ensuring the parameter remains positive
+# For 'k1': a Uniform distribution with minimum value 0 and maximum value 100
+
+prior = {'d1' : ['gaussian', 0.2, 20, 'positive'], 'k1' : ['uniform', 0, 100]}
+
+# Run Bayesian inference
+sampler, pid = py_inference(Model = M, exp_data = df, measurements = ['X'], 
+                            time_column = ['time'], nwalkers = 20, nsteps = 5500,
+                            params_to_estimate = ['d1', 'k1'], prior = prior)
+# A sampler object containing all samples is returned.
+# The pid object consists of various utilities for further analysis.
+# This will plot the resulting posterior parameter distributions as well.
+```
+
+
+All examples can be found in the [examples](https://github.com/biocircuits/bioscrape/tree/master/examples), the [inference examples](https://github.com/biocircuits/bioscrape/tree/master/inference%20examples), and the [lineage examples](https://github.com/biocircuits/bioscrape/tree/master/lineage%20examples) folders. If you prefer to run the package without installing the package, please use the Google Colab links above. If you want a local installation for bioscrape (recommended for faster speeds), follow the steps below: 
+
+# Installation
+
+Install the latest version of Bioscrape::
+
+    $ pip install bioscrape
+    
+
+Please note that Bioscrape is a Cython extension module and requires a C++ compiler to be set up on your computer for installation.
+
+Try online without installing, open self-explanatory jupyter notebooks with Google Colab (linked at the top of this README).
+
+Further details about the installation process can be found in the [Bioscrape wiki](https://github.com/biocircuits/bioscrape/wiki#installation).
+
+# Bugs and Contributing to Bioscrape
+
+Please report any bugs that you find [here](https://github.com/biocircuits/bioscrape/issues).
+Or, even better, fork the repository on [GitHub](https://github.com/biocircuits/bioscrape),
+and create a pull request (PR). We welcome all changes, big or small, and we
+will help you make the PR if you are new to `git` (just ask on the issue).
+
+# Versions
+
+Bioscrape versions:
+
+* 1.1.1 (latest release): To install run `pip install bioscrape==1.1.1` 
+* 1.1.0 (latest stable release): To install run `pip install bioscrape`
+* 1.0.4 (beta release): To install run `pip install bioscrape==1.0.4`
+
+# License
+Released under the MIT License (see `LICENSE`)
+
+Copyright (c) 2022, Biocircuits, California Institute of Technology. All rights reserved.
diff --git a/README.rst b/README.rst
deleted file mode 100644
index 0a2155b..0000000
--- a/README.rst
+++ /dev/null
@@ -1,15 +0,0 @@
-bioscrape - Biological Stochastic Simulation of Single Cell Reactions and Parameter Estimation
-==============================================================================================
-
-|Build Status|
-
-Bioscrape is a Chemical Reaction Network Simulator written in cython for speed and python compatability. It can be used for deterministic, stochastic, or single cell simulation and also has parameter inference capabilities.
-
-To install Bioscrape, in your terminal run the command:
-   
-   pip install bioscrape
-
-Please note that Bioscrape is a cython extension module and requires a C++ compiler to be set up on your computer for installation. For more information, please visit https://github.com/biocircuits/bioscrape/wiki.
-
-.. |Build Status| image:: https://github.com/biocircuits/bioscrape/actions/workflows/bioscrape.yml/badge.svg
-   :target: https://github.com/biocircuits/bioscrape
diff --git a/convert_simbio_to_xml.m b/convert_simbio_to_xml.m
deleted file mode 100644
index 8318f35..0000000
--- a/convert_simbio_to_xml.m
+++ /dev/null
@@ -1,115 +0,0 @@
-function []=convert_simbio_to_xml(filename, model)
-
-f = fopen(filename, 'w');
-m = model;
-fprintf(f, '<model>\n\n');
-
-function [clean_name] = F(dirty_name)
-    clean_name = dirty_name;
-    clean_name(clean_name == '-') = '_';
-    clean_name(clean_name == ' ') = '_';
-end
-
-% Go through reactions one at a time. Add the reactions and propensity, but
-% do not update the output until later.
-number_of_reactions = length(m.Reactions);
-
-param_names = {};
-param_values = [];
-species_used = {};
-for i=1:number_of_reactions,
-    r = m.Reactions(i);
-    number_of_reactants = length(r.Reactants);
-    number_of_products = length(r.Products);
-    
-    % Create reactants together.
-    reactant_string = [];
-    for j=1:number_of_reactants,
-        reactant_string = [reactant_string F(r.Reactants(j).Name)];
-        species_used = [species_used F(r.Reactants(j).Name)];
-        if j < length(r.Reactants),
-            reactant_string = [reactant_string ' + '];
-        end
-    end
-   
-    % Create products together.
-    product_string = [];
-    for j=1:number_of_products,
-        product_string = [product_string F(r.Products(j).Name)];
-        species_used = [species_used F(r.Products(j).Name)];
-        if j < length(r.Products),
-            product_string = [product_string ' + '];
-        end
-    end
-    
-    % Get the reaction rate type and parameters.
-    kl = r.KineticLaw;
-    assert( strcmp(kl.KineticLawName,'MassAction') );
-    parameters = r.KineticLaw.getparameters();
-    
-    % Add parameters to the list of total parameters
-    for k=1:length(parameters),
-        if ~ismember(parameters(k).Name, param_names),
-            param_names = [param_names F(parameters(k).Name)];
-            param_values = [param_values parameters(k).Value];
-        end
-    end
-    
-    % Forward reaction first.
-    
-    param = parameters(1).Name;
-    fprintf(f, '<reaction text="%s--%s" after="--">\n', ...
-               reactant_string, product_string);
-    
-    species_string = '';     
-    for reactant_index = 1:number_of_reactants,
-        species_string = [species_string F(r.Reactants(reactant_index).Name)];
-        if reactant_index < number_of_reactants,
-            species_string = [species_string '*'];
-        end
-    end
-    fprintf(f, '    <propensity type="massaction" k="%s" species="%s" />\n', ...
-                   param, species_string);
-    fprintf(f,'    <delay type="none" />\n</reaction>\n\n');
-    
-    % The the reverse reaction, but skip if it does not exist!!
-    if length(parameters) < 2,
-        continue;
-    end
-    param = parameters(2).Name;
-    
-    fprintf(f, '<reaction text="%s--%s" after="--">\n', ...
-               product_string, reactant_string);
-    
-    species_string = '';     
-    for product_index = 1:number_of_products,
-        species_string = [species_string F(r.Products(product_index).Name)];
-        if product_index < number_of_products,
-            species_string = [species_string '*'];
-        end
-    end
-    fprintf(f, '    <propensity type="massaction" k="%s" species="%s" />\n', ...
-                   param, species_string);
-    
-    fprintf(f,'    <delay type="none" />\n</reaction>\n\n');
-end
-        
-% Take care of parameters as well.
-fprintf(f,'\n\n\n');
-for i=1:length(param_values),
-    fprintf(f, '<parameter name="%s" value="%f" />\n', ...
-            param_names{i}, param_values(i) );
-end
-
-% Take care of species last.
-fprintf(f,'\n\n\n');
-number_of_species = length(m.Species);
-for i=1:number_of_species,
-   if ismember(F(m.Species(i).Name), species_used),    
-      fprintf(f,'<species name="%s" value="%f" />\n', F(m.Species(i).Name), m.Species(i).InitialAmount);
-   end
-end
-
-fprintf(f, '\n\n</model>\n');
-
-end
\ No newline at end of file
diff --git a/delay_model.xml b/delay_model.xml
deleted file mode 100644
index ff742ee..0000000
--- a/delay_model.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2">
-  <model id="bioscrape_generated_model_374639" substanceUnits="mole" timeUnits="second" volumeUnits="litre" areaUnits="square_metre" lengthUnits="metre" extentUnits="mole">
-    <listOfUnitDefinitions>
-      <unitDefinition id="square_metre" name="square_metre">
-        <listOfUnits>
-          <unit kind="metre" exponent="2" scale="0" multiplier="1"/>
-        </listOfUnits>
-      </unitDefinition>
-    </listOfUnitDefinitions>
-    <listOfCompartments>
-      <compartment id="default" name="default" spatialDimensions="3" size="1e-06" constant="true"/>
-    </listOfCompartments>
-    <listOfSpecies>
-      <species id="G" name="G" compartment="default" initialConcentration="0" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
-      <species id="I" name="I" compartment="default" initialConcentration="0" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
-      <species id="T" name="T" compartment="default" initialConcentration="0" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
-      <species id="X" name="X" compartment="default" initialConcentration="0" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
-    </listOfSpecies>
-    <listOfParameters>
-      <parameter id="DummyVar_GammaDelay_k_3" name="DummyVar_GammaDelay_k_3" value="10" constant="true"/>
-      <parameter id="DummyVar_GammaDelay_theta_4" name="DummyVar_GammaDelay_theta_4" value="3" constant="true"/>
-      <parameter id="DummyVar_GaussianDelay_mean_0" name="DummyVar_GaussianDelay_mean_0" value="10" constant="true"/>
-      <parameter id="DummyVar_GaussianDelay_std_1" name="DummyVar_GaussianDelay_std_1" value="1" constant="true"/>
-      <parameter id="DummyVar_PositiveHillPropensity_n_2" name="DummyVar_PositiveHillPropensity_n_2" value="1" constant="true"/>
-      <parameter id="KI" name="KI" value="10" constant="true"/>
-      <parameter id="KR" name="KR" value="20" constant="true"/>
-      <parameter id="delta" name="delta" value="0.1" constant="true"/>
-      <parameter id="ktl" name="ktl" value="10" constant="true"/>
-      <parameter id="ktx" name="ktx" value="1.5" constant="true"/>
-      <parameter id="n" name="n" value="2" constant="true"/>
-    </listOfParameters>
-    <listOfReactions>
-      <reaction id="r0" name="r0" reversible="false">
-        <annotation>
-          <BioscrapeAnnotation>
-            <PropensityType> type=proportionalhillpositive k=ktx K=KI n=n s1=I d=G</PropensityType>
-            <DelayType> type=gaussian reactants=[] products=[T] parameters={mean:DummyVar_GaussianDelay_mean_0,std:DummyVar_GaussianDelay_std_1}</DelayType>
-          </BioscrapeAnnotation>
-        </annotation>
-        <listOfReactants>
-          <speciesReference species="G" stoichiometry="1" constant="false"/>
-        </listOfReactants>
-        <listOfProducts>
-          <speciesReference species="G" stoichiometry="1" constant="false"/>
-        </listOfProducts>
-        <listOfModifiers>
-          <modifierSpeciesReference species="I"/>
-        </listOfModifiers>
-        <kineticLaw>
-          <math xmlns="http://www.w3.org/1998/Math/MathML">
-            <apply>
-              <divide/>
-              <apply>
-                <times/>
-                <ci> G </ci>
-                <apply>
-                  <power/>
-                  <ci> I </ci>
-                  <ci> n </ci>
-                </apply>
-                <ci> ktx </ci>
-              </apply>
-              <apply>
-                <plus/>
-                <apply>
-                  <power/>
-                  <ci> I </ci>
-                  <ci> n </ci>
-                </apply>
-                <ci> KI </ci>
-              </apply>
-            </apply>
-          </math>
-        </kineticLaw>
-      </reaction>
-      <reaction id="r1" name="r1" reversible="false">
-        <annotation>
-          <BioscrapeAnnotation>
-            <PropensityType> type=hillpositive k=ktl K=KR n=DummyVar_PositiveHillPropensity_n_2 s1=T</PropensityType>
-            <DelayType> type=gamma reactants=[] products=[X] parameters={k:DummyVar_GammaDelay_k_3,theta:DummyVar_GammaDelay_theta_4}</DelayType>
-          </BioscrapeAnnotation>
-        </annotation>
-        <listOfReactants>
-          <speciesReference species="T" stoichiometry="1" constant="false"/>
-        </listOfReactants>
-        <listOfProducts>
-          <speciesReference species="T" stoichiometry="1" constant="false"/>
-        </listOfProducts>
-        <kineticLaw>
-          <math xmlns="http://www.w3.org/1998/Math/MathML">
-            <apply>
-              <divide/>
-              <apply>
-                <times/>
-                <apply>
-                  <power/>
-                  <ci> T </ci>
-                  <ci> n </ci>
-                </apply>
-                <ci> ktl </ci>
-              </apply>
-              <apply>
-                <plus/>
-                <ci> KR </ci>
-                <apply>
-                  <power/>
-                  <ci> T </ci>
-                  <ci> DummyVar_PositiveHillPropensity_n_2 </ci>
-                </apply>
-              </apply>
-            </apply>
-          </math>
-        </kineticLaw>
-      </reaction>
-    </listOfReactions>
-  </model>
-</sbml>
diff --git a/mcmc_results.txt b/mcmc_results.txt
deleted file mode 100644
index e9206f2..0000000
--- a/mcmc_results.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Cost function progress
-[-299.9243228336909, -306.15345563831556, -313.5625707529739, -325.89206560876346, -inf, -283.5987170106405, -296.7316099983085, -inf, -inf, -inf, -317.45462462974535, -316.9517808867581, -298.9948717216596, -313.5997287470401, -inf, -292.9862364698091, -inf, -300.27528868829324, -inf, -inf, -311.157003012255, -305.13486349706886, -inf, -inf, -inf, -296.010532471333, -304.6149422585446, -303.58228897516324, -302.7410293738176, -inf, -307.6256392498706, -313.16693117995965, -inf, -306.08336708930926, -inf, -310.378879322629, -289.1596151237836, -inf, -inf, -inf, -314.11584447307166, -292.3409732730065, -inf, -inf, -inf, -296.55584007322386, -312.54490251123184, -294.44482183919274, -inf, -inf, -310.286883605908, -299.78275952317153, -298.8590948372356, -inf, -inf, -307.57770340170293, -316.4155735814128, -294.7453586049736, -295.3566825628111, -inf, -303.10915520547496, -312.76210334693735, -298.34833460463744, -inf, -inf, -310.1079346849573, -310.8637375864648, -293.0317283150813, -inf, -inf, -287.50372174361917, -291.52095676729596, -299.91072357775204, -312.6403771268575, -inf, -306.99180316572415, -318.3023850819271, -inf, -inf, -inf, -295.77758853009755, -302.0144499836516, -311.62426494274587, -inf, -inf, -316.80340143671356, -302.52156799565887, -316.25508366218196, -311.9766717433962, -inf, -301.5002903957709, -309.7449686748498, -326.9322183427777, -inf, -inf, -298.8525715181778, -304.6303797070643, -299.321282781004, -inf, -inf, -301.81529281297503, -308.4057543736567, -304.4008645697919, -inf, -293.37392819290017, -295.9738704383208, -301.5281986766522, -311.38677958496623, -309.7232625498689, -inf, -311.750934132363, -301.2612712931601, -300.51984709453563, -inf, -302.8698734425658, -283.79649904684993, -294.2417326056926, -296.9259011847655, -314.6892434288068, -inf, -310.5449884318955, -316.8693546675446, -306.13084216867867, -inf, -305.6662365881675, -304.9228305197182, -309.26247250607867, -304.8450188556578, -inf, -inf, -289.93499023299773, -307.41416900912213, -314.9182892412997, -300.96818441972164, -inf, -inf, -306.47094828268405, -inf, -inf, -inf, -297.3260709727874, -310.0406217239714, -inf, -inf, -inf, -314.68639571247775, -307.8134802805524, -310.3265924987069, -317.50661533897835, -294.64450774718443, -300.16821519715313, -302.7511280950049, -315.5634623485605, -305.63815468004077, -298.42250717209765, -309.01913062622407, -306.38442641446534, -inf, -inf, -301.6420567891405, -307.4316531967529, -327.53456896271564, -inf, -309.44131834835855, -295.1725700237819, -302.6562348841526, -296.67050873683934, -inf, -inf, -inf, -302.3082849392606, -310.519714031787, -inf, -inf, -305.4739962466856, -297.19373898829133, -312.4037172367134, -310.1794462680816, -307.5185047401875, -298.3437623376367, -301.2809988379206, -318.61931627726744, -299.47710085223423, -inf, -inf, -313.05090743963876, -314.6718024021004, -307.3313894542987, -300.62046243363136, -301.001150653238, -293.4356649189124, -inf, -inf, -inf, -295.2878950431833, -308.46924697404233, -296.5257040044156, -292.47140372854403, -304.8345077262545, -inf, -301.3118183553962, -311.93850551096193, -311.9188535195485, -inf, -inf, -311.66221550482294, -307.10500327674674, -312.878190317472, -inf, -312.2190780439299, -297.8531875635399, -300.1790829059297, -inf, -307.39687057610945, -301.0665385422302, -311.75677296933736, -303.1293694032122, -307.56722947469177, -297.410306336248, -inf, -301.8266943387348, -308.20456392250435, -303.85254401367513, -inf, -307.2874345977791, -302.1232580052655, -296.4598401643673, -302.27970303554366, -inf, -289.49579440554066, -313.0510791491862, -304.4075226361764, -307.49159000398515, -304.88050330965564, -292.0644907159257, -306.645003517482, -302.29554852035517, -299.0697615480858, -inf, -295.0244432905977, -310.1175293901608, -301.6983503134278, -324.93982436238196, -311.10030112540767, -285.259366681418, -291.9996363493077, -295.2214439439929, -309.5021023034219, -inf, -298.45644490888026, -285.5635165197855, -305.7240612250707, -302.4787514218217, -300.15495242910333, -300.53572021382547, -315.4739547261852, -309.72560183325413, -inf, -inf, -299.5156122898766, -303.329394719932, -312.17510912427997, -inf, -312.4389205659221, -290.9290222484028, -306.6009399381908, -inf, -306.7931234783807, -302.37105064652405, -308.0081824525744, -307.2560660805941, -327.4827622776106, -311.966429199033, -inf, -303.1933444240126, -307.48481205997325, -328.11301643144316, -296.1630574978383, -306.9506051592299, -291.01345505420295, -313.81446309261753, -310.8872608060209, -297.16385959829415, -297.95624480394986, -310.2858849310611, -299.5360764977502, -inf, -307.0909266834849, -288.69335781780137, -302.2089729050616, -318.02958734045717, -inf, -295.2087424963904, -302.93920877542575, -282.2949684986892, -303.0070724329041, -306.7041901033432, -306.2215571928606, -305.4786004614001, -308.62156152025864, -302.9023532396353, -310.6640904571731, -inf, -307.7978119539797, -298.23913668093974, -283.8033956576354, -312.6476166904404, -297.05005034368924, -293.9196573826838, -304.8022123521697, -312.23572264377526, -317.4774378374789, -303.8142606755631, -307.38033614823746, -303.79406886676486, -312.7579734378829, -inf, -293.16421864623896, -inf, -283.69321628109196, -inf, -319.0925987086715, -inf, -303.2509757888064, -305.686966597164, -306.7143467358155, -312.4707190203877, -304.07517081770027, -311.9584347090938, -298.12652318415326, -309.01589579681627, -308.038411784996, -314.52835335823534, -319.95259793087143, -inf, -310.2317140833678, -301.7058295411516, -293.96981429824405, -290.55789970271655, -313.82970454251597, -311.20996717463584, -313.5487194430059, -299.7400307431925, -inf, -285.30393625626766, -287.2180232514131, -inf, -301.91771287963286, -304.19382660714143, -300.8014803076519, -inf, -inf, -inf, -275.3284725452428, -281.98546014487647, -300.3164347031228, -298.1041598033123, -322.09312943050566, -342.0916067238802, -296.15022048642084, -334.01197608102063, -305.40859943727776, -inf, -313.1873745526998, -inf, -318.9611721178512, -inf, -304.29378989390807, -304.08305069276514, -280.5360738232962, -304.3952815248913, -302.45735585224395, -inf, -305.73226235513323, -266.1152984857747, -304.174320664604, -287.4991364932623, -299.81565601763566, -280.56445319002023, -313.9979662678779, -313.6206655343009, -293.30514152898957, -300.82371618435593, -312.96039785159735, -266.44218870579084, -294.1587410364, -260.3739554925065, -inf, -306.248703870289, -282.01530829201397, -296.31350256184635, -304.0524022212711, -inf, -308.43173928372096, -269.8965486101713, -308.5585576594664, -301.74196999198205, -276.1122660882679, -288.5340036202956, -284.51022433057597, -292.51864987116414, -290.09072648575307, -282.9675560005934, -290.7673078199557, -331.989530426628, -309.6334348896132, -302.7406419268767, -inf, -283.3746752836727, -271.1504692423366, -301.14500795494234, -306.9323610097832, -310.4080360026402, -285.42686295969156, -inf, -317.55740991012533, -309.04373354713914, -inf, -315.37041777515526, -284.2623195336067, -317.0249559935976, -307.985560803457, -293.1995341236159, -301.1178756915107, -275.7986214853388, -314.8992592786053, -282.54552508366066, -270.41895795232546, -307.9027161251672, -inf, -298.48098588288053, -279.6522409494668, -inf, -286.7068542279085, -282.08184530183996, -296.8840034958762, -inf, -289.57381672566476, -348.0535344746853, -290.5294557544953, -288.54674530789725, -287.1351742109707, -280.2257235622667, -308.9676664110159, -inf, -283.65384076737575, -307.67269074904516, -inf, -284.3612590014004, -260.6072475742925, -302.8189724231901, -293.42919552874787, -260.9729431387141, -inf, -307.8382144348823, -273.30167381843046, -inf, -306.2719053396379, -277.80533969319526, -inf, -281.82846823669524, -280.8899964837691, -307.6692754101632, -inf, -264.353369752734, -306.09972414437755, -273.3309874160087, -306.053361163855, -271.74002355460414, -284.5577392201021, -304.25640652410266, -266.2428244115346, -309.2322889888303, -299.3988773182658, -276.4430202888067, -inf, -278.7720843118926, -300.57527960275183, -280.09778921459815, -272.04846718422857, -291.6961460433439, -274.447777940269, -320.89564284454434, -302.08385718855004, -278.72987404278933, -287.19962785041787, -285.48066341520234, -297.65424055335075, -265.32009137779755, -285.28113145515647, -260.02737884406133, -308.67096303586516, -317.30988232927734, -inf, -299.1931615836029, -329.4272875429857, -301.6715879298299, -300.5616021835797, -302.81859043945417, -269.5061636235221, -297.97732937114097, -278.02852727972765, -inf, -269.60128115146586, -285.78064175068823, -314.571121889643, -273.2530565962744, -318.6850582716163, -inf, -262.09209233213846, -292.28156400159185, -286.8767916335054, -inf, -279.8524509944542, -273.39506915989125, -303.1441344887993, -290.4718311608482, -272.5873384806587, -300.41912554448004, -268.0419118982262, -298.07160426357973, -259.3027033203766, -302.901422956748, -304.81528536168935, -277.4482279645598, -294.0936357306315, -287.80805808513514, -298.43767624634404, -275.3015227887495, -inf, -302.57886539184256, -303.5949678871283, -304.19120083157225, -inf, -267.8196817738795, -292.7026503448574, -270.2274739205612, -312.02618039198524, -290.2413265240016, -269.0621748663937, -295.24277385292316, -294.1955971982245, -292.02885434363657, -298.42475773419153, -inf, -267.514549783736, -306.68101933118453, -inf, -271.31611045881783, -271.4888823840692, -272.93612241874007, -271.1477212265579, -314.8178954431676, -304.4812583898454, -281.6330821792002, -287.80591655149317, -271.1370782602288, -263.3584079125394, -278.9312073233714, -272.29349745227535, -316.00248078387654, -271.67268027471044, -300.9127337588875, -324.2805112837194, -279.4753503912184, -286.51873590361674, -296.45454832077746, -278.95183228442363, -276.26042297941956, -272.7003792761816, -287.61013912951887, -301.5174673732445, -258.62617059033334, -282.27556557014327, -272.35428066877455, -288.6570968503595, -310.79650179674604, -264.68375808868575, -316.494813009164, -292.9789692009791, -276.4450709840021, -275.49222228130634, -259.3644148095599, -305.9771459968107, -253.97962118321453, -284.70677324899293, -318.28055224513025, -inf, -inf, -270.2218278048718, -286.91475196444617, -279.82683783930577, -301.75389723880437, -285.7915012052172, -254.96250355136857, -295.2500262171659, -inf, -320.8067013630433, -289.42778939123957, -270.7329676465061, -302.67831497140264, -309.0712942102474, -277.168748479623, -350.9004772167501, -282.8917766768192, -285.94524097732847, -296.3990984596119, -269.483018542668, -269.40660299292557, -268.35888392488056, -301.4002021464995, -305.5673893044893, -271.52412244887, -365.43073814848094, -284.33089522559726, -273.9115473881633, -309.34125795995783, -267.2575185561709, -276.5288513920832, -256.38873369550544, -298.96361541110673, -303.0512774219451, -261.4941745541684, -293.8934243648556, -276.32240370832665, -264.67757256319464, -294.0831129961614, -292.16897884949026, -279.4989850383064, -281.6621973793018, -279.93176326136575, -332.40935830566707, -inf, -inf, -261.82101066832064, -345.6259846972573, -262.1954895398796, -325.5451942680935, -286.485816683743, -272.41302627916923, -279.58744350983295, -315.789681754459, -302.4071111540874, -286.1582113880538, -276.95528037717315, -291.00749429623886, -267.61334021679863, -298.6969726491766, -inf, -274.2030736564642, -288.47580406347845, -320.03249590519295, -inf, -289.444841803047, -262.78938751195136, -270.4624625708593, -inf, -inf, -262.5636991742871, -272.5137859157102, -278.76260283768534, -301.58962165339415, -307.9017686343939, -inf, -276.60538528654024, -294.1809445560981, -287.5076071372996, -271.31721252182126, -281.62935104207975, -299.12517814016064, -295.08442187847265, -268.97803779404916, -277.48360551856683, -276.1359700743924, -270.3294695647194, -281.524803510732, -276.1477427177431, -298.87549247287893, -280.0828186525921, -261.04005815923665, -264.9611729143346, -274.33401889429035, -inf, -280.8453360162712, -266.9390926936371, -274.7231561987803, -275.0610449553375, -306.8292833933368, -267.5900763902694, -277.0103847527133, -287.33689570958313, -279.8716486966118, -279.3922073381226, -inf, -263.0422808624378, -283.75930578535133, -inf, -303.9890994948249, -inf, -278.40833239045, -274.02603847408204, -266.19699344200285, -290.0868001954292, -260.03735138269536, -267.37622679027163, -269.14973997245664, -289.90569319265694, -367.7696016861273, -324.2991102271832, -inf, -253.6843777191657, -291.5526937906202, -301.8109940654989, -266.0330157052894, -297.8671922719325, -inf, -350.9078961489953, -295.5255501353504, -inf, -inf, -271.15337741291034, -319.38731006129433, -311.8094377374176, -277.85620848080464, -301.2565963757812, -283.3547346326893, -inf, -319.64569399072, -261.0339101444121, -263.7005908728293, -276.54981761556223, -291.45521553150195, -261.86679350502504, -292.2344778757165, -278.6657939046936, -311.16616397220935, -326.14610245113624, -260.70059775286893, -269.97067898765863, -303.1443019012702, -282.4062344205944, -276.22973158490186, -266.9485541009206, -310.56061040274926, -316.9120071476426, -278.6305672511661, -298.0998721509759, -266.75833907462953, -275.29760170719385, -274.77706166755866, -263.61739632780547, -282.80793547827636, -329.28516027913895, -268.41797167941013, -289.3606233667904, -298.1991041787261, -267.42617165063797, -265.0430293298586, -271.1622548175627, -283.4241987503325, -282.2473286067651, -307.6518614222697, -inf, -321.31933788241815, -267.79565218233495, -275.33437341594924, -306.0708856675451, -271.79486318794034, -270.96968271462987, -272.1485026855198, -262.2399398113341, -278.0087625964687, -283.02780119432646, -inf, -262.85035124662755, -inf, -307.50603380863913, -inf, -264.91682215563424, -327.447934494813, -258.2884029813763, -285.6049006819927, -310.9403171397378, -281.7746009105085, -272.1294915987746, -315.305783723207, -271.2715114140956, -289.67984681392625, -inf, -272.0762542602513, -281.7205671382553, -inf, -267.65785507781374, -269.323804750485, -293.51138174863354, -277.40325921716396, -290.1101766945292, -inf, -283.52347554802714, -265.84942894096, -283.18911393140297, -315.2020995858154, -276.59444859370706, -264.39075345217634, -258.4829788752281, -254.3596261867803, -277.6164338693933, -258.6248335469009, -335.47587045772264, -278.923830889574, -295.353866008213, -291.77710561212075, -310.6864652825892, -325.74594115659386, -266.69995898861765, -274.2665457091, -inf, -287.7803666983418, -269.9522786216071, -300.55648162603654, -272.5775160216216, -346.29916532319544, -320.9602845475516, -inf, -265.97359521437295, -292.13981621235405, -274.3599982206201, -258.34043114370405, -278.56503297268614, -273.2765111722324, -272.4919758416837, -309.37180146778803, -311.01506696685476, -258.72817194738525, -291.7995894948897, -335.1028683413763, -303.4744149963932, -270.4573637932623, -261.19488111167755, -272.3608885241151, -268.83854230937504, -271.2894047886674, -350.4379354777784, -290.8516810569597, -271.72522893628604, -270.8548600285717, -291.2169188443196, -266.290312080475, -278.03567543693634, -324.3068948618927, -271.5354585939749, -285.65598037929806, -343.78335423121666, -290.2130625954982, -267.86673957809194, -280.82280291995994, -267.86358787626705, -337.5354558793381, -264.5302602214589, -257.5957655667717, -275.6632821410143, -267.8835311175038, -278.0808570135324, -272.10882141735715, -283.07444933946147, -268.052214086427, -280.1991022888317, -inf, -275.11568635233095, -264.56657828749087, -276.5418768430885, -259.9755903224068, -288.4597690776885, -inf, -271.30625530679373, -262.5148116747485, -338.5275972388997, -279.61193380828774, -272.14438614676567, -276.66108767587514, -276.09396982220335, -275.306514085043, -294.3993614981266, -265.33943024047227, -315.33787869415335, -314.7075134284752, -273.4267103923704, -271.8825694100939, -269.4614414774808, -278.6618942089524, -310.1898422333244, -inf, -354.4875556550405, -268.25205151787185, -273.76925289525775, -260.1599626240058, -271.52767793944577, -280.5935473756192, -265.98769201485595, -270.053782408122, -298.2572799468834, -285.48790727209325, -259.57188629698277, -260.5955945095751, -263.40253451206553, -270.3561971895683, -inf, -278.5173238558856, -269.0934720253408, -263.1377595196534, -259.05127570028804, -282.4796895216407, -inf, -281.05408256847795, -267.74409134930363, -287.60757252546637, -inf, -271.0173058802355, -inf, -270.3694735572869, -267.81210080435005, -291.4072366818484, -278.4116188275947, -268.3823110688264, -274.0529557564595, -347.92651079228324, -274.5425592043955, -inf, -282.3005174428914, -278.797013075673, -282.8328459395034, -261.48951481582395, -272.4694393196029, -inf, -263.93544290730046, -266.2229674991329, -271.194275368204, -288.5173405541351, -268.8016903598266, -268.3632889908019, -284.27126174827663, -307.8515789076679, -288.19766289550955, -272.09759413034317, -298.8526985952136, -274.41206672258363, -292.16293408544925, -inf, -inf, -279.733216380656, -291.6453598897855, -295.2257341277859, -275.4347442082069, -352.71598630601113, -301.03292912751374, -279.354383447985, -278.8831547584522, -inf, -inf, -267.3704318986857, -263.1686311583688, -266.3691486799578, -inf, -263.7704291586597, -270.8940808187391, -256.90940890501776, -286.3857504778176, -277.2741080644912, -275.75544316762694, -263.74917275939447, -291.25838092153697, -inf, -281.2958884251749, -278.1923916570215, -inf, -271.46118933566777, -284.8333982526658, -280.0602666763822, -261.0647148326583, -265.0380085541105, -262.9292054274922, -inf, -273.71695437949154, -inf, -258.974732142697, -276.4494859584147, -276.3453580025257, -270.38857814101976, -272.45948429948464, -256.0236694104144, -276.3945690363655, -279.5575149265451, -271.33493392731975, -272.777543168987, -266.5306979786373, -280.46552868227866, -259.46194035658743, -272.82328489694453, -256.7212275179486, -252.61327179713496, -265.5814200067869, -287.79759800857494, -283.3117094895947, -266.251834742073, -275.485189621716, -266.95422271781706, -266.8923823625758, -277.77483457571725, -264.615171142194, -inf]
\ No newline at end of file
diff --git a/setup.py b/setup.py
index bf81158..8b39a8a 100644
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,7 @@
 
 
 #Load the readme as a long description
-with open('README.rst') as fp:
+with open('README.md') as fp:
     long_description = fp.read()
 
 # Compile Cython
@@ -113,7 +113,7 @@
 
 setup(
     name = 'bioscrape',
-    version = '1.1.1',
+    version = '1.2.0',
     author='Anandh Swaminathan, William Poole, Ayush Pandey',
     url='https://github.com/biocircuits/bioscrape/',
     description='Biological Stochastic Simulation of Single Cell Reactions and Parameter Estimation.',
@@ -152,7 +152,7 @@
     keywords="SBML synthetic biology modeling Chemical Reaction Network CRN simulator stochastic parameter inference",
     tests_require=["pytest"],
     project_urls={
-    'Documentation': 'https://readthedocs.org/projects/biocrnpyler/',
+    'Documentation': 'https://github.com/biocircuits/bioscrape/wiki',
     'Funding': 'http://www.cds.caltech.edu/~murray/wiki/DARPA_BioCon',
     'Source': 'https://github.com/biocircuits/bioscrape/',
     'Tracker': 'https://github.com/biocircuits/bioscrape/issues',
diff --git a/temp.pck b/temp.pck
deleted file mode 100644
index d4940a6..0000000
Binary files a/temp.pck and /dev/null differ


Test patch:
diff --git a/.github/workflows/test_bioscrape.yml b/.github/workflows/test_bioscrape.yml
new file mode 100644
index 0000000..7cb14d3
--- /dev/null
+++ b/.github/workflows/test_bioscrape.yml
@@ -0,0 +1,29 @@
+name: test_bioscrape
+on:
+  push:
+    branches: ["*","!master"]
+jobs:
+  build:
+    runs-on: ${{ matrix.os }}
+    strategy:
+      max-parallel: 4
+      matrix:
+        os: [ubuntu-latest]
+        python-version: ["3.7", "3.10"]
+
+    steps:
+    - uses: actions/checkout@v3
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v3
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install -r requirements.txt
+    - name: install bioscrape and lineage
+      run: python setup.py install
+    - name: Test bioscrape with pytest
+      run: pytest
+    - name: install lineage
+      run: python setup.py install lineage
\ No newline at end of file