Skip to content

Commit

Permalink
Manual installation of lineages: deploy to master (#178)
Browse files Browse the repository at this point in the history
* fix 139 docs

* Default bioscrape installation to core-only without lineage (#176)

* default to x64 for macos

* test defaulting arch

* udpate setup-python action version

* try v3.8 for macos

* update to 3.8

* fix distutils deprecated

* merge master

* remove default lineage installation

* triggering tests

* skipped a lineage test

---------

Co-authored-by: William Poole <[email protected]>

* Update checkout version in pypi workflow (#179)

---------

Co-authored-by: Ayush Pandey <[email protected]>
  • Loading branch information
WilliamIX and ayush9pandey authored Feb 16, 2025
1 parent f87daf1 commit a0b18dc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
environment: Release Deploy

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.12'

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ 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.
Please note that Bioscrape is a Cython extension module and requires a C++ compiler to be set up on your computer for installation. With the PyPi distribution, you can only install the core Bioscrape without the additional lineages package. To install lineages, clone the GitHub repository and run `python setup.py install lineage` from the bioscrape directory.

Try online without installing, open self-explanatory jupyter notebooks with Google Colab (linked at the top of this README).

Expand All @@ -99,8 +99,8 @@ will help you make the PR if you are new to `git` (just ask on the issue). The [

Bioscrape versions:

* 1.2.2 (latest release): To install run `pip install bioscrape`
* 1.2.0 (tagged stable release): To install run `pip install bioscrape==1.2.0`
* 1.3.0 (latest release): To install run `pip install bioscrape`
* 1.2.2 (tagged stable release): To install run `pip install bioscrape==1.2.2`
* 1.0.4 (beta release): To install run `pip install bioscrape==1.0.4`

# License
Expand Down
1 change: 1 addition & 0 deletions bioscrape/types.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,7 @@ cdef class Model:
sbml_filename (str): The SBML filename to import the model.
Note that you cannot any other arguments when importing from SBML.
You can import the SBML model, then edit the model with the API.
If no keyword argument is passed, then an SBML file is assumed as the input.
filename (str): The (old bioscrape XML) file to read the model. Recommended way to import
a model is by importing an SBML using `sbml_filename` argument
species (List[str]): A list of species names, when constructing the model.
Expand Down
13 changes: 5 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
numpyInclude = [get_include(), '.']

#Install Bioscrape Core Package
package_data = {'bioscrape': ['*.pxd']}
package_data = {'bioscrape': ['*.pxd', '*.pyx']}
bioscrape_src_dir = 'bioscrape'

ext_options = {}
Expand Down Expand Up @@ -51,24 +51,21 @@
# # Turn on to enable gdb debugging
# cythonize_options["gdb_debug"] = True

# # Turn on to enable gdb debugging
# cythonize_options["gdb_debug"] = True

#Determine if we install bioscrape, lineage, or both
install_bioscrape = False
install_lineage = False
if "bioscrape" not in sys.argv and "lineage" not in sys.argv:
install_bioscrape = True
install_lineage = True
install_lineage = False
if "bioscrape" in sys.argv:
install_bioscrape = True
sys.argv.remove("bioscrape")
if "lineage" in sys.argv:
install_lineage = True
sys.argv.remove("lineage")

elif "bioscrape" not in sys.argv:
install_lineage = True
# elif "bioscrape" not in sys.argv:
# install_lineage = False

cython_extensions = []
if install_bioscrape:
Expand All @@ -87,7 +84,7 @@
print("Bioscrape Cythonized.")

if install_lineage:
package_data['lineage'] = ['*.pxd']
package_data['lineage'] = ['*.pxd', '*.pyx']
print("Installing Lineage...")
lineage_src_dir = 'lineage'
lineage_source_files = ['lineage.pyx']
Expand Down
9 changes: 7 additions & 2 deletions tests/test_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
import pandas as pd
from bioscrape.simulator import *
from bioscrape.types import *
from bioscrape.lineage import *

try:
from bioscrape.lineage import *
skip_lineage = False
except ModuleNotFoundError:
skip_lineage = True

# Seed RNG value. All tests use this value.
seed = 54173
Expand Down Expand Up @@ -117,7 +122,7 @@ def test_random_complex_model():
f"{'stochastic' if is_stochastic else 'deterministic'} " + \
"simulation when pickled and unpickled."


@pytest.mark.skipif(skip_lineage, reason="Lineage Not Installed")
def test_random_complex_lineagemodel():
'''
Creates a two-reaction LineageModel with more or less the same settings as
Expand Down

0 comments on commit a0b18dc

Please sign in to comment.