Skip to content

Commit

Permalink
Merge pull request #567 from sys-bio/develop
Browse files Browse the repository at this point in the history
Release for 2.2.7
  • Loading branch information
luciansmith authored Apr 14, 2023
2 parents b8465b2 + f12e436 commit c714abd
Show file tree
Hide file tree
Showing 25 changed files with 288 additions and 229 deletions.
92 changes: 49 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ te.plotArray(result)
:exclamation:**Attention to those using Python 2.7 :**
**[Python 2.7 reached EOL on January 1st, 2020](https://www.python.org/doc/sunset-python-2/). Support for Python 2.7 has been dropped, though previous releases will continue to be available.**

Tellurium can either be installed with a front-end (Notebook, IDE) or as a Python package:
Tellurium can be installed as a Python package, with a front-end (Notebook, IDE), or in a cloud environment (Google Colab):

A. [IDE front-end](#front-end-1-tellurium-spyder-ide) based on [Spyder](https://www.spyder-ide.org/)
B. [Notebook front-end](#front-end-2-tellurium-notebook)
C. [Python package (pip)](#install-via-pip-no-front-end)
A. [Python package (pip)](#install-via-pip-no-front-end)
B. [IDE front-end](#front-end-1-spyder-for-tellurium-ide) based on [Spyder](https://www.spyder-ide.org/)
C. [Notebook front-end](#front-end-2-tellurium-notebook)
D. [Google Colab](#google-colab)

We recommend first-time users choose one of the front-ends, while developers looking to integrate Tellurium use the pip package.
The IDE front-end provides a MATLAB like experience with a code editor and Python console.
Expand All @@ -91,11 +92,33 @@ For any issues with installation and setup, please check [FAQ](https://github.co

-------

### Install via pip
[![PyPI version](https://badge.fury.io/py/tellurium.svg)](https://badge.fury.io/py/tellurium)

If you have a version of Python in an environment you're comfortable with, you can add Tellurium with pip:

```
pip install tellurium
```

Tellurium itself is Python-only, and is available for any version of Python 3. Its main binary dependency, roadrunner, should be installed with Tellurium, and should be available for the latest three or four versions of Python (currently 3.8, 3.9, 3.10, and 3.11), for Windows, Mac (both Intel and ARM), and Linux.

For those using Anaconda, we currently do not have a separate Anaconda version of Tellurium, so you'll need to install it via pip, as above.

:exclamation:**For detailed instructions on how to setup Tellurium on Anaconda distributions,
see [this page](https://github.com/sys-bio/tellurium/wiki/FAQ#i-would-like-to-use-tellurium-on-anaconda-what-should-i-do).**


For developers, the latest stable version from the repository can be installed via
```
pip install git+https://github.com/sys-bio/tellurium.git
```

-------


### Front-end 1: Tellurium Spyder IDE
The Tellurium Spyder installers are tested with Windows 7+ and Mac OS X 10.9+. Some older Macs cannot run Spyder IDE, regardless of
whether the operating system is up-to-date.
The Tellurium Spyder IDE comes with Python 3.7 (64-bit).
### Front-end 1: Spyder for Tellurium IDE
The Tellurium Spyder installers are tested with Windows 8+, and comes with Python 3.9 (64-bit).

**For those who wish to use Tellurium with Spyder IDE on Mac OS X or Linux, we suggest you to install through [Anaconda](https://www.anaconda.com/) by
following the instructions on [this page](https://github.com/sys-bio/tellurium/wiki/FAQ#i-would-like-to-use-tellurium-on-anaconda-what-should-i-do).**
Expand All @@ -105,15 +128,17 @@ following the instructions on [this page](https://github.com/sys-bio/tellurium/w
<br style="clear:both"/>

:exclamation:**Attention to those upgrading to Tellurium Spyder IDE from an older version :**
We strongly suggest you to completely remove the older version of Tellurium Spyder IDE prior to installing one of the 2.1.0+ versions.
We strongly suggest you to completely remove the older version of Tellurium Spyder IDE prior to installing the latest version.

1. Download Tellurium Spyder for Windows:
* [Python 3.7](https://sourceforge.net/projects/pytellurium/files/Tellurium-2.3/2.3.5/Tellurium-2.3.5-Python-3.7-win64-setup.exe/download)
* [Python 3.8](https://sourceforge.net/projects/pytellurium/files/Tellurium-2.3/2.3.5/Tellurium-2.3.5-Python-3.8-win64-setup.exe/download)
* [Python 3.10](https://sourceforge.net/projects/pytellurium/files/Tellurium-2.4/2.4.0/Tellurium-2.4.0-Python-3.10-win64-setup.exe/download)
* [Python 3.11](https://sourceforge.net/projects/pytellurium/files/Tellurium-2.4/2.4.0/Tellurium-2.4.0-Python-3.11-win64-setup.exe/download)
2. Double-click the installer to start the installation
3. Follow the instructions

For now if you wish to use Python 3.9 you'll need to install Tellurium from the windows command line by using the command: pip install tellurium
If you wish to use a different version of Python, you'll need to install Tellurium from the windows command line by using the command: pip install tellurium


NOTE: Installation requires administrative rights. It is recommended to accept the default settings.
Expand All @@ -122,7 +147,7 @@ NOTE: Installation requires administrative rights. It is recommended to accept t
<h4>Mac OS X</h4>
<br style="clear:both"/>

Mac OS X user can install Tellurium and the Spyder IDE through Anaconda:
Mac OS X users can install Tellurium and the Spyder IDE through Anaconda:

1. [Download the Anaconda distribution for Mac OS X.](https://www.anaconda.com/download).

Expand All @@ -136,9 +161,9 @@ Next, install Tellurium itself:
```
pip install tellurium
```
If this fails, try using the default absolute path to Anaconda:
If this fails, try using the default absolute path to Anaconda, which will probably be something like:
```
/Users/<your-user>/anaconda3/bin/pip install tellurium
/Users/<your-user>/opt/anaconda3/bin/pip install tellurium
```
5. Launch the Anaconda Navigator via Launchpad. In Anaconda Navigator, run Spyder and then try `import tellurium` within the Spyder editor or console.

Expand All @@ -155,7 +180,7 @@ Currently, only a legacy version of the Mac Spyder IDE is available. We recommen
-------

### Front-end 2: Tellurium Notebook
The Tellurium notebook supports Windows 10, Mac OS X 10.10+, Debian 8+, and Fedora 22+.
The Tellurium notebook is no longer being updated, but is still available. It was tested with Windows 10, Mac OS X 10.10+, Debian 8+, and Fedora 22+.
The notebook viewer comes with Python 3.6 (64-bit).

<img align="left" width="32px" id="windows" src="https://raw.githubusercontent.com/wiki/sys-bio/tellurium/img/windows.png">
Expand Down Expand Up @@ -200,36 +225,17 @@ The notebook viewer comes with Python 3.6 (64-bit).

-------

### Install via pip (no front-end)
[![PyPI version](https://badge.fury.io/py/tellurium.svg)](https://badge.fury.io/py/tellurium)

Binary pip packages for Tellurium are available from PyPI and support 64-bit Python versions 3.6, 3.7, and 3.8 for Windows, Mac, and Linux.
Pip packages are tested on Fedora 22, Debian 8, Ubuntu 14.04, and Mac OS X 10.13.

The latest package release can be installed via
```
pip install tellurium
```

For developers, the latest stable version from the repository can be installed via
```
pip install git+https://github.com/sys-bio/tellurium.git
```

### Install via Anaconda

1. [Download the Anaconda distribution for your platform.](https://www.anaconda.com/download)
2. [Follow the installer instructions.](https://docs.anaconda.com/anaconda/install/linux)
3. When prompted, add Anaconda to your PATH
4. Run

```
pip install tellurium
```
### Google Colab
Tellurium can be used entirely in a browser using [Google Colab](https://colab.research.google.com/). Ideally, it will work with the following steps:

1. run a cell with ```pip install tellurium```
2. Restart the runtime (From the menu: 'Runtime / Restart runtime')
3. Use Tellurium normally.

The Python version behind Colab changes periodically, so what worked one day may stop working the next, but the following Colab notebook worked when used at ICSB 2022: https://colab.research.google.com/drive/1wddLftHNhetbozZY29r2HRkzQLl1F_fs#scrollTo=l1bCgW46-adR and will hopefully be instructive.

:exclamation:**If you would like a detailed instruction on how to setup Tellurium on Anaconda distributions,
check [this page](https://github.com/sys-bio/tellurium/wiki/FAQ#i-would-like-to-use-tellurium-on-anaconda-what-should-i-do).**


## Citing

If you use Tellurium in your research, we would appreciate following citations in any works you publish:
Expand All @@ -240,7 +246,7 @@ Choi et al. (2018). ["Tellurium: An extensible python-based modeling environment

## Contact Us

For general questions or to request help, please post to the [Tellurium-discuss](https://groups.google.com/d/forum/tellurium-discuss) mailing list. If you think you found a bug in our software, please post it to [GitHub issue tracker](https://github.com/sys-bio/tellurium/issues).
For general questions, requesting help, or reporting bugs, feel free to use the [GitHub issue tracker](https://github.com/sys-bio/tellurium/issues). You can also post to the [Tellurium-discuss](https://groups.google.com/d/forum/tellurium-discuss) mailing list.

## Legal

Expand Down
2 changes: 1 addition & 1 deletion docs/_notebooks/core/phrasedmlExample.rst
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ sweeps through a uniform range for another parameter ``J4_KK5``.
'''
phrasedml_str = '''
model_3 = model "parameterScan2D"
model_3 = model "parameterScan2D.xml"
sim_repeat = simulate uniform(0,3000,100)
task_1 = run sim_repeat on model_3
repeatedtask_1 = repeat task_1 for J1_KK2 in [1, 5, 10, 50, 60, 70, 80, 90, 100], reset=true
Expand Down
9 changes: 5 additions & 4 deletions docs/_notebooks/core/roadrunnerBasics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ model with the corresponding format and converts it to a
`RoadRunner <http://sys-bio.github.io/roadrunner/python_docs/index.html>`__
simulator instance.

- ``te.loadAntimony`` (``te.loada``): Load an Antimony model.
- ``te.loadSBML``: Load an SBML model.
- ``te.loadCellML``: Load a CellML model (this passes the model through
Antimony and converts it to SBML, may be lossy).
- ``te.loadAntimonyModel`` (``te.loada``): Load an Antimony model.
- ``te.loadSBMLModel`` (``te.loads``): Load an SBML model.
..
loadCellML doesn't currently work; the CellML API got out of sync with Antimony, and libCellML isn't up to speed yet.
- ``te.loadCellML``: Load a CellML model (this passes the model through Antimony and converts it to SBML, may be lossy).
.. code-block:: python
Expand Down
6 changes: 3 additions & 3 deletions docs/appendix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Tellurium is a collection of Python packages developed inside and outside our gr

* `tellurium <https://github.com/sys-bio/tellurium>`_: This project.
* `libroadrunner <https://github.com/sys-bio/roadrunner>`_: SBML ODE / stochastic simulator.
* `antimony <http://antimony.sourceforge.net/>`_: A human-readable representation of SBML.
* `phrasedml <http://phrasedml.sourceforge.net/>`_: A human-readable representation of SED-ML.
* `antimony <https://github.com/sys-bio/antimony>`_: A human-readable representation of SBML.
* `phrasedml <https://github.com/sys-bio/phrasedml>`_: A human-readable representation of SED-ML.
* `libcombine <https://github.com/sbmlteam/libCombine>`_: A library for reading/writing COMBINE archives.
* `sbml2matlab <https://github.com/stanleygu/sbml2matlab>`_: A utility for converting SBML models to MATLAB ODE simulations.
* `sbml2matlab <https://github.com/sys-bio/sbml2matlab>`_: A utility for converting SBML models to MATLAB ODE simulations.
* `simplesbml <http://sys-bio.github.io/simplesbml/>`_: A utility for creating SBML models without the complexity of libSBML.
* `libsbml <https://sourceforge.net/projects/sbml>`_: A library for reading/writing `SBML <http://sbml.org/Main_Page>`_.
* `libsedml <https://github.com/fbergmann/libSEDML>`_: A library for reading/writing SED-ML.
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __getattr__(cls, name):
return Mock()

MOCK_MODULES = ['roadrunner',
'roadrunner.testing',
'roadrunner.tests',
'antimony',
'libsbml',
'libsedml',
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks-py/model_modelFromBioModels.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import tellurium as te

# Load model from biomodels.
r = te.loadSBMLModel("http://www.ebi.ac.uk/biomodels-main/download?mid=BIOMD0000000010")
r = te.loadSBMLModel("https://www.ebi.ac.uk/biomodels/model/download/BIOMD0000000010.2?filename=BIOMD0000000010_url.xml")
result = r.simulate(0, 3000, 5000)
r.plot(result);

Expand Down
4 changes: 2 additions & 2 deletions examples/notebooks/core/model_modelFromBioModels.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"%matplotlib inline\n",
"\n",
"# Load model from biomodels (may not work with https).\n",
"r = te.loadSBMLModel(\"https://www.ebi.ac.uk/biomodels-main/download?mid=BIOMD0000000010\")\n",
"r = te.loadSBMLModel(\"https://www.ebi.ac.uk/biomodels/model/download/BIOMD0000000010.2?filename=BIOMD0000000010_url.xml\")\n",
"result = r.simulate(0, 3000, 5000)\n",
"r.plot(result)"
],
Expand Down Expand Up @@ -1800,4 +1800,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
2 changes: 1 addition & 1 deletion examples/tellurium-files/SBMLfromBioModelsDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
from __future__ import print_function, division
import tellurium as te

r = te.loadSBMLModel("http://www.ebi.ac.uk/biomodels-main/download?mid=BIOMD0000000010")
r = te.loadSBMLModel("https://www.ebi.ac.uk/biomodels/model/download/BIOMD0000000010.2?filename=BIOMD0000000010_url.xml")
result = r.simulate(0, 3000, 5000)
r.plot(result)
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ numpy>=1.23
scipy>=1.5.1
matplotlib>=2.0.2
pandas>=0.20.2
libroadrunner>=2.0.3
rrplugins>=2.0.3; platform_machine != "arm64"
phrasedml>=1.0.9; (python_version < '3.10' and platform_machine != "arm64")
libroadrunner>=2.1
rrplugins>=2.1; platform_system == "Windows"
phrasedml>=1.0.9; (platform_machine != "arm64")
antimony>=2.12.0
sbml2matlab>=0.9.1; (python_version < '3.10' and platform_machine != "arm64")
python-libsbml>=5.18.0
Expand Down
10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
'matplotlib>=2.0.2',
'pandas>=0.20.2',
# SBW-derived
'libroadrunner>=2.0.3',
'libroadrunner>=2.1',
'antimony>=2.12.0',
# standards
'python-libsbml>=5.18.0',
Expand All @@ -69,11 +69,13 @@
],
extras_require={
':(python_version < "3.10" and platform_machine != "arm64")': [
'phrasedml>=1.0.9',
'sbml2matlab>=0.9.1',
],
': platform_machine != "arm64"': [
'rrplugins>=2.0.3',
':(platform_machine != "arm64")': [
'phrasedml>=1.0.9',
],
': platform_system == "Windows"': [
'rrplugins>=2.1',
],
},
)
2 changes: 1 addition & 1 deletion spyder_mod/Spyder 3.2.2/spyder/config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
'pylab/inline/resolution': 72,
'pylab/inline/width': 6,
'pylab/inline/height': 4,
'startup/run_lines': 'import antimony, import sbml2matlab, import rrplugins, import numpy, import scipy, import matplotlib, import roadrunner, import tellurium as te',
'startup/run_lines': 'import antimony, import sbml2matlab, import numpy, import scipy, import matplotlib, import roadrunner, import tellurium as te',
'startup/use_run_file': False,
'startup/run_file': '',
'greedy_completer': False,
Expand Down
2 changes: 1 addition & 1 deletion spyder_mod/Spyder 3.3.0/spyder/config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
'pylab/inline/width': 6,
'pylab/inline/height': 4,
'pylab/inline/bbox_inches': True,
'startup/run_lines': 'import antimony, import sbml2matlab, import rrplugins, import numpy, import scipy, import matplotlib, import roadrunner, import tellurium as te',
'startup/run_lines': 'import antimony, import sbml2matlab, import numpy, import scipy, import matplotlib, import roadrunner, import tellurium as te',
'startup/use_run_file': False,
'startup/run_file': '',
'greedy_completer': False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
'pylab/inline/width': 6,
'pylab/inline/height': 4,
'pylab/inline/bbox_inches': True,
'startup/run_lines': 'import antimony, import sbml2matlab, import rrplugins, import numpy, import scipy, import matplotlib, import roadrunner, import tellurium as te',
'startup/run_lines': 'import antimony, import sbml2matlab, import numpy, import scipy, import matplotlib, import roadrunner, import tellurium as te',
'startup/use_run_file': False,
'startup/run_file': '',
'greedy_completer': False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
'pylab/inline/width': 6,
'pylab/inline/height': 4,
'pylab/inline/bbox_inches': True,
'startup/run_lines': 'import antimony; import sbml2matlab; import rrplugins; import numpy; import scipy; import matplotlib; import roadrunner; import tellurium as te',
'startup/run_lines': 'import antimony; import sbml2matlab; import numpy; import scipy; import matplotlib; import roadrunner; import tellurium as te',
'startup/use_run_file': False,
'startup/run_file': '',
'greedy_completer': False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
'pylab/inline/width': 6,
'pylab/inline/height': 4,
'pylab/inline/bbox_inches': True,
'startup/run_lines': 'import antimony; import sbml2matlab; import rrplugins; import numpy; import scipy; import matplotlib; import roadrunner; import tellurium as te',
'startup/run_lines': 'import antimony; import sbml2matlab; import numpy; import scipy; import matplotlib; import roadrunner; import tellurium as te',
'startup/use_run_file': False,
'startup/run_file': '',
'greedy_completer': False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
'pylab/inline/width': 6,
'pylab/inline/height': 4,
'pylab/inline/bbox_inches': True,
'startup/run_lines': 'import antimony; import rrplugins; import numpy; import scipy; import matplotlib; import roadrunner; import tellurium as te',
'startup/run_lines': 'import antimony; import numpy; import scipy; import matplotlib; import roadrunner; import tellurium as te',
'startup/use_run_file': False,
'startup/run_file': '',
'greedy_completer': False,
Expand Down
2 changes: 1 addition & 1 deletion tellurium/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.5
2.2.8
4 changes: 2 additions & 2 deletions tellurium/analysis/bifurcation.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def plotBifurcation(model, parameter, lowerBound, upperBound, maxPoints=5000, sc
biData.plotBifurcationDiagram(pts, lbls)
except:
def bifurcation(model, parameter, lowerBound, upperBound, maxPoints=5000, scanPositive=True):
raise RuntimeError('Bifurcation unavailable in this version of Tellurium.')
raise RuntimeError('Bifurcation unavailable in this version of Tellurium; rrplugins not present.')

def plotBifurcation(model, parameter, lowerBound, upperBound, maxPoints=5000, scanPositive=True):
raise RuntimeError('Bifurcation unavailable in this version of Tellurium.')
raise RuntimeError('Bifurcation unavailable in this version of Tellurium; rrplugins not present.')
2 changes: 1 addition & 1 deletion tellurium/plotting/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __str__(self):
return "<PlottingEngine>"

@abc.abstractmethod
def newFigure(self, title=None, logX=False, logY=False, layout=None, xtitle=None, ytitle=None):
def newFigure(self, title=None, logX=False, logY=False, layout=None, xtitle=None, ytitle=None, xlim=None, ylim=None):
""" Returns PlottingFigure.
Needs to be implemented in base class.
"""
Expand Down
6 changes: 4 additions & 2 deletions tellurium/plotting/engine_mpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ def __str__(self):
return "<MatplotlibEngine>"

@classmethod
def newFigure(cls, title=None, logX=False, logY=False, layout=None, xtitle=None, ytitle=None):
def newFigure(cls, title=None, logX=False, logY=False, layout=None, xtitle=None, ytitle=None, xlim=None, ylim=None):
""" Returns a figure object."""
if layout is None:
layout = PlottingLayout()

fig = MatplotlibFigure(title=title, layout=layout, xtitle=xtitle, ytitle=ytitle, logx=logX, logy=logY)
fig = MatplotlibFigure(title=title, layout=layout, xtitle=xtitle, ytitle=ytitle, logx=logX, logy=logY, xlim=xlim, ylim=ylim)
return fig


Expand All @@ -55,6 +55,8 @@ def __init__(self, layout=PlottingLayout(), use_legend=True, xtitle=None, ytitle
self.figsize = figsize
self.savefig = savefig
self.dpi = dpi
self.xlim = xlim
self.ylim = ylim

def render(self):
""" Plot the figure. Call this last."""
Expand Down
Loading

0 comments on commit c714abd

Please sign in to comment.