Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
836d06e
adding movie
briandrawert Feb 21, 2021
94a1fe1
Merge pull request #70 from StochSS/timeout-and-str
BryanRumsey Feb 25, 2021
fa99a72
Added timestep_size to the timespan function. Closes #74
BryanRumsey Mar 2, 2021
7583ce7
Added 'add_mesh' function that will set a models mesh and the list of…
BryanRumsey Mar 2, 2021
8542d4d
Fixed interation bug in the initial conditions section of the models …
BryanRumsey Mar 2, 2021
fa5b87c
Added function that read in a shochss domain and convert it to a Spat…
BryanRumsey Mar 2, 2021
81d52f6
adding spatial birth death model, shows error for #78
briandrawert Mar 3, 2021
cae4990
Merge pull request #81 from StochSS/spatial_birth_death_model
makdl Mar 3, 2021
ccf2496
Fixed error reporting typo.
BryanRumsey Mar 5, 2021
004f0a3
Fixed bug the was assigning the wrong name for ploting species to the…
BryanRumsey Mar 5, 2021
4fbc402
Implemented Result eq and ne
makdl Mar 6, 2021
3802ed4
Re-implemented solver seed tests
makdl Mar 6, 2021
b214853
Replace diffusion model with simplier model
makdl Mar 6, 2021
d6357e3
Renamed GitHub Actions unit test job
makdl Mar 6, 2021
182cfc1
Removed unused imports & whitespace
makdl Mar 6, 2021
d1cc553
Removed unneeded print statement
makdl Mar 6, 2021
3b626bd
Clarify license information
makdl Mar 6, 2021
6b7ba2e
Updated URLS & license clarification
makdl Mar 6, 2021
54079af
Added AUTHORS file, sorted alphabetically
makdl Mar 6, 2021
1db06d0
Updated RELEASE_NOTES & more URLS
makdl Mar 6, 2021
3d5943f
Replace Python2 PATH with Python3
makdl Mar 6, 2021
7bc2673
Remove mistakenly commited debug script
makdl Mar 6, 2021
b6b4c91
Implemented regex filter for propensity filenames
makdl Mar 6, 2021
c3d2a93
Merge pull request #86 from StochSS/sanitize_model_names
briandrawert Mar 6, 2021
a7ba1e1
Re-implemented pickle tests & pickling
makdl Mar 6, 2021
175ebc6
Merge pull request #85 from StochSS/clarify_license
briandrawert Mar 6, 2021
87f27b9
Removed typo
makdl Mar 6, 2021
8daf04d
Merge pull request #83 from StochSS/ploting-bugs
briandrawert Mar 6, 2021
311fda0
Merge pull request #80 from StochSS/stochss_domain
briandrawert Mar 6, 2021
dfda87b
Merge pull request #84 from StochSS/test_updates1
briandrawert Mar 6, 2021
f6641b7
Merge pull request #79 from StochSS/timespan-update
briandrawert Mar 6, 2021
2533190
Fixed typo in the model class str function.
BryanRumsey Mar 8, 2021
a16b03f
Merge pull request #91 from StochSS/str-typo
makdl Mar 8, 2021
091dedd
Removed Result Dict inheritance
makdl Mar 8, 2021
cd9609b
Added Result timeout flag
makdl Mar 8, 2021
7274994
Implemented results output pickling
makdl Mar 9, 2021
0aa5173
Merge pull request #92 from StochSS/remove_dict_inherit
BryanRumsey Mar 9, 2021
d5382b9
Merge pull request #93 from StochSS/pickle_results_dir
BryanRumsey Mar 9, 2021
56bdbb2
Update RELEASE_NOTES
makdl Mar 9, 2021
d2b27e4
Update __version__.py
makdl Mar 9, 2021
6a6131e
Merge pull request #94 from StochSS/beta-0.6.1
BryanRumsey Mar 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
workflow_dispatch:

jobs:
build:
unit-tests:
runs-on: ubuntu-latest

steps:
Expand Down
7 changes: 7 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Brian Drawert
Bruno Jacob
Bryan Rumsey
Evie Hilton
Mason Kidwell
Matthew Geiger
Sean Matthew
9 changes: 4 additions & 5 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
SpatialPy is a Python 3 package for simulation of
SpatialPy is a Python 3 package for simulation of
spatial deterministic/stochastic reaction-diffusion-advection problems
Copyright (C) 2020 SpatialPy developers.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
it under the terms of the GNU GENERAL PUBLIC LICENSE Version 3 as
published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU GENERAL PUBLIC LICENSE Version 3 for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
19 changes: 16 additions & 3 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
1.0.0
------------
- First release.
RELEASE NOTES
SpatialPy

These are release notes for SpatialPy.
----------------------------------------
Date: 2/25/2021
Version: 0.5.0+beta
----------------------------------------
- Initial beta release
----------------------------------------
Date: 3/9/2021
Version: 0.5.1+beta
----------------------------------------
- Added pickling Results
- Added add_mesh() function
- timespan() now includes option to set timestep size
- Added ability to read StochSS domains
2 changes: 1 addition & 1 deletion examples/coral_reef/coral.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import numpy
import sys
Expand Down
2 changes: 1 addition & 1 deletion examples/coral_reef/old/coral.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import math
import matplotlib.pyplot as plt
import numpy
Expand Down
17 changes: 0 additions & 17 deletions examples/cylinderDemo/SpatialPy_cylinderDemo3D.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -223,23 +223,6 @@
"%time result = sol.run()\n"
]
},
{
"cell_type": "code",
"execution_count": 60,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"{'Status': 'Success'}\n"
]
}
],
"source": [
"print(result)"
]
},
{
"cell_type": "code",
"execution_count": 12,
Expand Down
2 changes: 1 addition & 1 deletion examples/cylinderDemo/old/cylinder_demo3D.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
""" pyURDME model file for the annihilation cylinder 3D example. """

import os
Expand Down
2 changes: 1 addition & 1 deletion examples/cylinderDemo/old/ensemble_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from cylinder_demo3D import cylinderDemo3D
from pyurdme.nsmsolver import NSMSolver
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion examples/cylinderDemo/old/pickle_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from cylinder_demo3D import cylinderDemo3D
from pyurdme.nsmsolver import NSMSolver
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion examples/mincde/old/mincde.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import numpy
import os.path
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_diffusion/simple_diffusion2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
""" PyURDME model with one species diffusing in the unit circle and one
species diffusing on the boundary of the circle. Subdomains are
here handled by Dolfin's native subdomain model. """
Expand Down
Binary file added examples/tests/SpatialPy_gravity.webm
Binary file not shown.
255 changes: 255 additions & 0 deletions examples/tests/Spatial_Birth_Death.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import numpy\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'../../spatialpy/__init__.py'"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import sys\n",
"sys.path.insert(0,'../..')\n",
"import spatialpy\n",
"spatialpy.__file__"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"model = spatialpy.Model('Spatial Birth-Death')"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"model.mesh = spatialpy.Mesh.create_3D_domain([0,1],[0,1],[0,0.1], 10,10,1, fixed=True)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"rabbits = model.add_species(spatialpy.Species('rabbits', D=0.1))"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"model.add_initial_condition(spatialpy.ScatterInitialCondition(rabbits, 100, types=None))"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<spatialpy.Model.Parameter at 0x7f6ade4d9280>,\n",
" <spatialpy.Model.Parameter at 0x7f6ade4d98e0>]"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"kb=spatialpy.Parameter('k_birth',10)\n",
"kd=spatialpy.Parameter('k_death',0.1)\n",
"model.add_parameter([kb,kd])"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"model.add_reaction(spatialpy.Reaction(\n",
" 'birth',\n",
" reactants={},\n",
" products={rabbits:1},\n",
" rate=kb))\n",
"#model.add_reaction(spatialpy.Reaction(\n",
"# 'death',\n",
"# reactants={rabbits:1},\n",
"# products={},\n",
"# rate=kd))\n"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"model.staticDomain"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"model.timespan(numpy.arange(0,10,1))"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"model.timestep_size = 1"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Reading stdout/stderr from process:\n",
"\n",
"make: *** No rule to make target 'Birth-Death_generated_model.c'. Stop.\n",
"\n"
]
},
{
"ename": "SimulationError",
"evalue": "Compilation of solver failed, return_code=2",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mSimulationError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<timed exec>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n",
"\u001b[0;32m~/Desktop/research/SpatialPy/spatialpy/Model.py\u001b[0m in \u001b[0;36mrun\u001b[0;34m(self, number_of_trajectories, seed, timeout, number_of_threads, debug_level, debug, profile)\u001b[0m\n\u001b[1;32m 103\u001b[0m \u001b[0msol\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mSolver\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdebug_level\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdebug_level\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 104\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 105\u001b[0;31m return sol.run(number_of_trajectories=number_of_trajectories, seed=seed, timeout=timeout,\n\u001b[0m\u001b[1;32m 106\u001b[0m number_of_threads=number_of_threads, debug=debug, profile=profile)\n\u001b[1;32m 107\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Desktop/research/SpatialPy/spatialpy/Solver.py\u001b[0m in \u001b[0;36mrun\u001b[0;34m(self, number_of_trajectories, seed, timeout, number_of_threads, debug, profile)\u001b[0m\n\u001b[1;32m 131\u001b[0m \u001b[0;31m# Check if compiled, call compile() if not.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 132\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_compiled\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 133\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcompile\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdebug\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdebug\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mprofile\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mprofile\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 134\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 135\u001b[0m \u001b[0;31m# Execute the solver\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Desktop/research/SpatialPy/spatialpy/Solver.py\u001b[0m in \u001b[0;36mcompile\u001b[0;34m(self, debug, profile)\u001b[0m\n\u001b[1;32m 103\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 104\u001b[0m \u001b[0;32mpass\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 105\u001b[0;31m raise SimulationError(\n\u001b[0m\u001b[1;32m 106\u001b[0m \"Compilation of solver failed, return_code={0}\".format(return_code))\n\u001b[1;32m 107\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mSimulationError\u001b[0m: Compilation of solver failed, return_code=2"
]
}
],
"source": [
"%time result = model.run()"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'result' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-14-baaa9e3c3437>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mresult\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mplot_property\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'type'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mNameError\u001b[0m: name 'result' is not defined"
]
}
],
"source": [
"result.plot_property('type')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"result.plot_species('rabbits', animated=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
2 changes: 1 addition & 1 deletion examples/yeast_polarization/G_protein_cycle.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
""" pyURDME model file for the polarization 1D example. """

import os
Expand Down
2 changes: 1 addition & 1 deletion examples/yeast_polarization/polarisome_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
""" pyURDME model file for the model found in Lawson et al. PloS Comp Bio (2013). """

import os
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[metadata]
description-file=README.md
description-file = README.md
license_files = LICENSE

Loading