diff --git a/docs/build/html/.doctrees/classes/spatialpy.core.doctree b/docs/build/html/.doctrees/classes/spatialpy.core.doctree index 372e3575..3c9dfe51 100644 Binary files a/docs/build/html/.doctrees/classes/spatialpy.core.doctree and b/docs/build/html/.doctrees/classes/spatialpy.core.doctree differ diff --git a/docs/build/html/.doctrees/classes/spatialpy.solvers.doctree b/docs/build/html/.doctrees/classes/spatialpy.solvers.doctree index a972d000..e0782b86 100644 Binary files a/docs/build/html/.doctrees/classes/spatialpy.solvers.doctree and b/docs/build/html/.doctrees/classes/spatialpy.solvers.doctree differ diff --git a/docs/build/html/.doctrees/classes/spatialpy.stochss.doctree b/docs/build/html/.doctrees/classes/spatialpy.stochss.doctree index f269045d..f901dc97 100644 Binary files a/docs/build/html/.doctrees/classes/spatialpy.stochss.doctree and b/docs/build/html/.doctrees/classes/spatialpy.stochss.doctree differ diff --git a/docs/build/html/.doctrees/environment.pickle b/docs/build/html/.doctrees/environment.pickle index ebf24ccd..e5b1ff22 100644 Binary files a/docs/build/html/.doctrees/environment.pickle and b/docs/build/html/.doctrees/environment.pickle differ diff --git a/docs/build/html/.doctrees/index.doctree b/docs/build/html/.doctrees/index.doctree index 62b27d8c..4ecb305d 100644 Binary files a/docs/build/html/.doctrees/index.doctree and b/docs/build/html/.doctrees/index.doctree differ diff --git a/docs/build/html/_modules/spatialpy/core/boundarycondition.html b/docs/build/html/_modules/spatialpy/core/boundarycondition.html index 514b800d..4a7889e4 100644 --- a/docs/build/html/_modules/spatialpy/core/boundarycondition.html +++ b/docs/build/html/_modules/spatialpy/core/boundarycondition.html @@ -124,7 +124,7 @@

Source code for spatialpy.core.boundarycondition

- type_id: type (subdomain) of the partciles Targets (one of the following must be set): property: (str), 'nu', 'rho','v' - species: (str) name of a chemical species. + species: (str) name of a chemical species. \ Must also set deterministic=True/False flag. :param xmin: x-axis coordinate lower bound of **condition** @@ -152,7 +152,7 @@

Source code for spatialpy.core.boundarycondition

and applies to deterministic simulation. **BoundaryCondition not yet implemeneted for Stochastic Species**. :type deterministic: bool - :param target: Set **target** to properties, can be 'nu' 'rho' or 'v' or species name + :param target: Set **target** to properties, can be 'nu' 'rho' or 'v' or species name \ If species name, determinstic must also be set to True/False. :type target: str @@ -160,7 +160,7 @@

Source code for spatialpy.core.boundarycondition

:type value: float or float[3] :param model: Target model of boundary condition - :type model: spatialpy.Model.Model + :type model: spatialpy.core.model.Model """ def __init__(self, xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, diff --git a/docs/build/html/_modules/spatialpy/core/datafunction.html b/docs/build/html/_modules/spatialpy/core/datafunction.html index 97cecec1..3e2840cb 100644 --- a/docs/build/html/_modules/spatialpy/core/datafunction.html +++ b/docs/build/html/_modules/spatialpy/core/datafunction.html @@ -116,6 +116,8 @@

Source code for spatialpy.core.datafunction

 
     :param name: Name of the Data Function.
     :type name: str
+
+    :raises DataFunctionError: If a name is not provided.
     """
 
     def __init__(self, name=None):
@@ -128,11 +130,11 @@ 

Source code for spatialpy.core.datafunction

         """
         This method must be overridden by the DataFunction subclass.
 
-        NOTE: The spatial location is evaulated at t=0 and is not
-              reevaluated as the fluid domain moves over time.
+        NOTE: The spatial location is evaulated at t=0 and is not \
+              re-evaluated as the fluid domain moves over time.
 
-        :param point: The x,y,z position
-        :type point: vector of 3 doubles
+        :param point: The x, y, z position.
+        :type point: float[3]
 
         :returns: Value of function at this spatial location.
         :rtype: float
diff --git a/docs/build/html/_modules/spatialpy/core/domain.html b/docs/build/html/_modules/spatialpy/core/domain.html
index 1e734839..7b608992 100644
--- a/docs/build/html/_modules/spatialpy/core/domain.html
+++ b/docs/build/html/_modules/spatialpy/core/domain.html
@@ -130,13 +130,13 @@ 

Source code for spatialpy.core.domain

     :type numpoints: int
 
     :param xlim: Range of domain along x-axis
-    :type xlim: tuple(float)
+    :type xlim: float(2)
 
     :param ylim: Range of domain along y-axis
-    :type ylim: tuple(float)
+    :type ylim: float(2)
 
     :param zlim: Range of domain along z-axis
-    :type zlim: tuple(float)
+    :type zlim: float(2)
 
     :param rho: Background density for the system
     :type rho: float
@@ -148,7 +148,7 @@ 

Source code for spatialpy.core.domain

     :type P0: float
 
     :param gravity: Acceleration of gravity for the system.
-    :type species: float
+    :type gravity: float[3]
     """
     def __init__(self, numpoints, xlim, ylim, zlim, rho0=1.0, c0=10, P0=None, gravity=None):
         self.vertices = numpy.zeros((numpoints, 3), dtype=float)
@@ -225,10 +225,10 @@ 

Source code for spatialpy.core.domain

 
 
[docs] def compile_prep(self): """ - Generate the domain list of type ids and check for invalid type_ids and rho values + Generate the domains list of type ids and check for invalid type_ids and rho values in preperation of compiling the simulation files. - :raises DomainError: If a type_id is not set or rh for a particle is 0. + :raises DomainError: If a type_id is not set or rho=0 for a particle. """ if self.type_id.tolist().count(None) > 0: raise DomainError(f"Particles must be assigned a type_id.") @@ -243,7 +243,7 @@

Source code for spatialpy.core.domain

         Add a single point particle to the domain space.
 
         :param point: Spatial coordinate vertices of point to be added
-        :type point: tuple(float, float, float) or tuple(float, float)
+        :type point: float(3)
 
         :param vol: Default volume of particle to be added
         :type vol: float
@@ -251,19 +251,19 @@ 

Source code for spatialpy.core.domain

         :param mass: Default mass of particle to be added
         :type mass: float
 
-        :param type_id: Particle type ID of particle to be created
+        :param type_id: Particle type ID of particle to be craddedeated
         :type type_id: str | int
 
-        :param nu: Default viscosity of particle to be created
+        :param nu: Default viscosity of particle to be added
         :type nu: float
 
         :param fixed: True if particle is spatially fixed, else False
         :type fixed: bool
 
-        :param c: Default artificial speed of sound of particle to be created
+        :param c: Default artificial speed of sound of particle to be added
         :type c: float
 
-        :param rho: Default density of particle to be created
+        :param rho: Default density of particle to be added
         :type rho: float
 
         :raises DomainError: Type_id is 0 or type_id contains an invalid character.
@@ -297,9 +297,9 @@ 

Source code for spatialpy.core.domain

         """
         Add a type definition to the domain. By default, all regions are set to type 0.
 
-        :param geometry_ivar: an instance of a 'spatialpy.Geometry' subclass.  The 'inside()' method
+        :param geometry_ivar: an instance of a :py:class:`spatialpy.core.geometry.Geometry` subclass.  The 'inside()' method
                    of this object will be used to assign properties to points.
-        :type geometry_ivar: spatialpy.Geometry.Geometry
+        :type geometry_ivar: spatialpy.core.geometry.Geometry
 
         :param type_id: The identifier for this type.
         :type type_id: str | int
@@ -363,9 +363,9 @@ 

Source code for spatialpy.core.domain

         """
         Fill a geometric shape with particles.
 
-        :param geometry_ivar: an instance of a 'spatialpy.Geometry' subclass.  The 'inside()' method
+        :param geometry_ivar: an instance of a :py:class:`spatialpy.core.geometry.Geometry` subclass.  The 'inside()' method
                    of this object will be used to create add the particles.
-        :type geometry_ivar: spatialpy.geometry.Geometry
+        :type geometry_ivar: spatialpy.core.geometry.Geometry
 
         :param deltax: Distance between particles on the x-axis.
         :type deltax: float
@@ -394,8 +394,7 @@ 

Source code for spatialpy.core.domain

         :param zmax: Maximum z value of the bounding box (defaults to Domain.zlim[1]).
         :type zmax: float
 
-        :param kwargs: Key word arguments for Domain.add_point.
-        :type kwargs: dict
+        :param \**kwargs: Additional keyword arguments passed to :py:meth:`Domain.add_point`.
 
         :returns: The number of particles that were created within this geometry.
         :rtype: int
@@ -509,10 +508,10 @@ 

Source code for spatialpy.core.domain

         Get distance between 2 domain vertices.
 
         :param start: Starting point
-        :type start: tuple(float, float, float) or tuple(float, float)
+        :type start: float(3)
 
         :param end: Ending point
-        :type end: tuple(float, float, float) or tuple(float, float)
+        :type end: float(2)
 
         :returns: a distance measurement between start and end point
         :rtype: float
@@ -524,10 +523,10 @@ 

Source code for spatialpy.core.domain

         Find the nearest vertex of a given point in the domain.
 
         :param point: Target source point
-        :type point: tuple(float, float, float) or tuple(float, float)
+        :type point: float(3)
 
         :returns: The coordinates of the nearest vertex to the source point.
-        :rtype: tuple(float, float, float) or tuple(float, float)
+        :rtype: float(3)
         """
         min_dist = None
         min_vtx = None
@@ -745,7 +744,7 @@ 

Source code for spatialpy.core.domain

         :type filename: str
 
         :returns: SpatialPy Domain object created from xml mesh.
-        :rtype: spatialpy.Domain.Domain
+        :rtype: spatialpy.core.domain.Domain
         """
         root = ET.parse(filename).getroot()
         if not root.tag == 'dolfin':
@@ -798,7 +797,7 @@ 

Source code for spatialpy.core.domain

         :type mesh_obj: meshio.Mesh
 
         :returns: SpatialPy Domain object created from the meshio object
-        :rtype: spatialpy.Domain.Domain
+        :rtype: spatialpy.core.domain.Domain
         """
         # create domain object
         xlim = (min(mesh_obj.points[:, 0]), max(mesh_obj.points[:, 0]))
@@ -808,11 +807,13 @@ 

Source code for spatialpy.core.domain

         #vertices
         obj.vertices = mesh_obj.points
         # triangles
-        if 'triangle' in mesh_obj.cells:
-            obj.triangles = mesh_obj.cells['triangle']
+        triangles = list(filter(lambda cell: cell.type == "triangle", mesh_obj.cells))
+        if triangles:
+            obj.triangles = triangles[0].data
         #tetrahedrons
-        if 'tetra' in mesh_obj.cells:
-            obj.tetrahedrons = mesh_obj.cells['tetra']
+        tetras = list(filter(lambda cell: cell.type == "tetra", mesh_obj.cells))
+        if tetras:
+            obj.tetrahedrons = tetras[0].data
         # volume
         obj.calculate_vol()
         if not numpy.count_nonzero(obj.vol):
@@ -833,18 +834,14 @@ 

Source code for spatialpy.core.domain

         :type filename: str
 
         :returns: SpatialPy Domain object created from the mesh file.
-        :rtype: spatialpy.Domain.Domain
+        :rtype: spatialpy.core.domain.Domain
         """
-        try:
-            import pygmsh # pylint: disable=import-outside-toplevel
-        except ImportError as err:
-            raise DomainError("The python package 'pygmsh' is not installed.") from err
         try:
             import meshio # pylint: disable=import-outside-toplevel
         except ImportError as err:
             raise DomainError("The python package 'meshio' is not installed.") from err
 
-        return cls.import_meshio_object(meshio.msh_io.read(filename))
+ return cls.import_meshio_object(meshio.read(filename))
[docs] def read_stochss_subdomain_file(self, filename, type_ids=None): """ @@ -884,7 +881,7 @@

Source code for spatialpy.core.domain

         :type filename: str
 
         :returns: SpatialPy Domain object created from StochSS domain.
-        :rtype: spatialpy.Domain.Domain
+        :rtype: spatialpy.core.domain.Domain
         """
         try:
             with open(filename, "r", encoding="utf-8") as domain_file:
@@ -920,13 +917,13 @@ 

Source code for spatialpy.core.domain

         Create a filled 3D domain
 
         :param xlim: highest and lowest coordinate in the x dimension
-        :type xlim: tuple(float, float)
+        :type xlim: float(2)
 
         :param ylim: highest and lowest coordinate in the y dimension
-        :type ylim: tuple(float, float)
+        :type ylim: float(2)
 
         :param zlim: highest and lowest coordinate in the z dimension
-        :type zlim: tuple(float, float)
+        :type zlim: float(2)
 
         :param nx: number of particle spacing in the x dimension
         :type nx: int
@@ -950,22 +947,15 @@ 

Source code for spatialpy.core.domain

         :type c: float
 
         :param rho: default density of particles to be created.
-        :type rho:
+        :type rho: float
 
         :param fixed: spatially fixed flag of particles to be created. Defaults to false.
         :type fixed: bool
 
-        :param rho0: background density for the system. Defaults to 1.0
-        :type rho0: float
-
-        :param c0: speed of sound for the system. Defaults to 10
-        :type c0: float
-
-        :param P0: background pressure for the system. Defaults to 10
-        :type P0: float
-
+        :param \**kwargs: Additional keyword arguments passed to :py:class:`Domain`.
+        
         :returns: Uniform 3D SpatialPy Domain object.
-        :rtype: spatialpy.Domain.Domain
+        :rtype: spatialpy.core.domain.Domain
         """
         # Create domain object
         numberparticles = nx * ny * nz
@@ -992,10 +982,10 @@ 

Source code for spatialpy.core.domain

         Create a filled 2D domain
 
         :param xlim: highest and lowest coordinate in the x dimension
-        :type xlim: tuple(float, float)
+        :type xlim: float(2)
 
         :param ylim: highest and lowest coordinate in the y dimension
-        :type ylim: tuple(float, float)
+        :type ylim: float(2)
 
         :param nx: number of particle spacing in the x dimension
         :type nx: int
@@ -1016,22 +1006,15 @@ 

Source code for spatialpy.core.domain

         :type c: float
 
         :param rho: default density of particles to be created.
-        :type rho:
+        :type rho: float
 
         :param fixed: spatially fixed flag of particles to be created. Defaults to false.
         :type fixed: bool
 
-        :param rho0: background density for the system. Defaults to 1.0
-        :type rho0: float
-
-        :param c0: speed of sound for the system. Defaults to 10
-        :type c0: float
-
-        :param P0: background pressure for the system. Defaults to 10
-        :type P0: float
+        :param \**kwargs: Additional keyword arguments passed to :py:class:`Domain`.
 
         :returns: Uniform 2D SpatialPy Domain object.
-        :rtype: spatialpy.Domain.Domain
+        :rtype: spatialpy.core.domain.Domain
         """
         # Create domain object
         numberparticles = nx * ny
diff --git a/docs/build/html/_modules/spatialpy/core/geometry.html b/docs/build/html/_modules/spatialpy/core/geometry.html
index bbdc26dc..8ca065ff 100644
--- a/docs/build/html/_modules/spatialpy/core/geometry.html
+++ b/docs/build/html/_modules/spatialpy/core/geometry.html
@@ -150,7 +150,7 @@ 

Source code for spatialpy.core.geometry

 
[docs]class GeometryExterior(Geometry): """ Mark particles that are on the edge of the domain. - only works for meshes that define triangles and tetrahedrons. + only works for domains that define triangles and tetrahedrons. """
[docs] def inside(self, point, on_boundary): """ @@ -168,7 +168,7 @@

Source code for spatialpy.core.geometry

 
[docs]class GeometryInterior(Geometry): """ Mark particles that are not on the edge of the domain. - Only works for meshes that define triangles and tetrahedrons. + Only works for domains that define triangles and tetrahedrons. """
[docs] def inside(self, point, on_boundary): """ diff --git a/docs/build/html/_modules/spatialpy/core/initialcondition.html b/docs/build/html/_modules/spatialpy/core/initialcondition.html index 13d3e41e..9dc0c791 100644 --- a/docs/build/html/_modules/spatialpy/core/initialcondition.html +++ b/docs/build/html/_modules/spatialpy/core/initialcondition.html @@ -116,11 +116,14 @@

Source code for spatialpy.core.initialcondition

< """ Class used to defined initial conditions in SpatialPy. SubClasses must implement the 'apply(model)' method, which - direction modifies the model.u0[species,voxel] matrix. + direction modifies the model.u0[species, voxel] matrix. """
[docs] def apply(self, model): """ Set the initial condition of the species to the count. + + :param model: Model contianing the target species. + :type model: spatialpy.core.model.Model """ raise InitialConditionError("spatialpy.InitialCondition subclasses must implement apply()")
@@ -129,7 +132,7 @@

Source code for spatialpy.core.initialcondition

< Class used to defined the place initial condition in SpatialPy. :param species: The species to set the initial condition. - :type species: spayialpy.species.Species + :type species: spatialpy.core.species.Species :param count: The initial condition for the target species. :type count: int @@ -151,7 +154,7 @@

Source code for spatialpy.core.initialcondition

< Set the initial condition of the species to the count at the location. :param model: Model contianing the target species. - :type model: spatialpy.model.Model + :type model: spatialpy.core.model.Model """ spec_name = self.species.name spec_ndx = None @@ -167,7 +170,7 @@

Source code for spatialpy.core.initialcondition

< Class used to defined the uniform initial condition in SpatialPy. :param species: The species to set the initial condition. - :type species: spayialpy.species.Species + :type species: spatialpy.core.species.Species :param count: The initial condition for the target species. :type count: int @@ -194,7 +197,7 @@

Source code for spatialpy.core.initialcondition

< Set 'count' of 'species' in over the list of types (all types if None). :param model: Model contianing the target species. - :type model: spatialpy.model.Model + :type model: spatialpy.core.model.Model """ spec_name = self.species.name spec_ndx = None @@ -219,7 +222,7 @@

Source code for spatialpy.core.initialcondition

< Class used to defined the scatter initial condition in SpatialPy. :param species: The species to set the initial condition. - :type species: spayialpy.species.Species + :type species: spatialpy.core.species.Species :param count: The initial condition for the target species. :type count: int @@ -246,7 +249,7 @@

Source code for spatialpy.core.initialcondition

< Scatter 'count' of 'species' randomly over the list of types (all types if None). :param model: Model contianing the target species. - :type model: spatialpy.model.Model + :type model: spatialpy.core.model.Model """ spec_name = self.species.name spec_ndx = None diff --git a/docs/build/html/_modules/spatialpy/core/model.html b/docs/build/html/_modules/spatialpy/core/model.html index 5f5db543..6e155948 100644 --- a/docs/build/html/_modules/spatialpy/core/model.html +++ b/docs/build/html/_modules/spatialpy/core/model.html @@ -125,8 +125,8 @@

Source code for spatialpy.core.model

     """
     SpatialPy model to StochSS converter
 
-    :param spatailpy_model: SpatialPy model to be converted to StochSS
-    :type spatialpy_model: spatialpy.Model
+    :param spatialpy_model: SpatialPy model to be converted to StochSS
+    :type spatialpy_model: spatialpy.core.model.Model
 
     :param filename: Path to the exported stochss model
     :type filename: str
@@ -422,12 +422,12 @@ 

Source code for spatialpy.core.model

         Adds a species, or list of species to the model. Will return the added object upon success.
 
         :param obj: The species or list of species to be added to the model object.
-        :type obj: spatialpy.Model.Species | list(spatialpy.Model.Species
+        :type obj: spatialpy.core.species.Species | list(spatialpy.core.species.Species
 
         :returns: Species object which was added to the model.
-        :rtype: spatialpy.Species | list(spatialpy.Species)
+        :rtype: spatialpy.core.species.Species | list(spatialpy.core.species.Species)
 
-        :raises ModelError: If obj is not a spatialpy.Species
+        :raises ModelError: If obj is not a spatialpy.core.species.Species
         """
         from spatialpy.core.species import Species # pylint: disable=import-outside-toplevel
         if isinstance(obj, list):
@@ -452,7 +452,7 @@ 

Source code for spatialpy.core.model

         Remove a Species from model.listOfSpecies.
 
         :param obj: Species object to be removed
-        :type obj: spatialpy.Model.Species
+        :type obj: spatialpy.core.species.Species
         """
         self.listOfSpecies.pop(obj) # raises key error if param is missing
@@ -482,7 +482,7 @@

Source code for spatialpy.core.model

         :type sname: str
 
         :returns: The Species objected represented by given 'sname'
-        :rtype: spatialpy.Model.Species
+        :rtype: spatialpy.core.species.Species
 
         :raises ModelError: if the model does not contain the requested species
         """
@@ -510,12 +510,12 @@ 

Source code for spatialpy.core.model

         Parameter object or a list of Parameter objects.
 
         :param params: Parameter object or list of Parameters to be added.
-        :type params: spatialpy.Model.Parameter | list(spatialpy.Model.Parameter)
+        :type params: spatialpy.core.parameter.Parameter | list(spatialpy.core.parameter.Parameter)
 
         :returns: Parameter object which has been added to the model.
-        :rtype: spatialpy.Parameter | list(spatialpy.Parameter)
+        :rtype: spatialpy.core.parameter.Parameter | list(spatialpy.core.parameter.Parameter)
 
-        :raises ModelError: if obj is not a spatialpy.Parameter
+        :raises ModelError: if obj is not a spatialpy.core.parameter.Parameter
         """
         from spatialpy.core.parameter import Parameter # pylint: disable=import-outside-toplevel
         if isinstance(params,list):
@@ -542,7 +542,7 @@ 

Source code for spatialpy.core.model

         Remove a Parameter from model.listOfParameters.
 
         :param obj: Parameter object to be removed
-        :type obj: spatialpy.Model.Parameter
+        :type obj: spatialpy.core.parameter.Parameter
         """
         self.listOfParameters.pop(obj)
@@ -559,11 +559,11 @@

Source code for spatialpy.core.model

         """
         Return the Parameter object from model associated with 'pname'
 
-        :param pname: Name of parameter to be removed
-        :type pname: spatialpy.Model.Parameter
+        :param pname: Name of parameter to be returned
+        :type pname: str
 
         :returns: The Parameter object represented in the model by 'pname'
-        :rtype: Spatialpy.Model.Parameter
+        :rtype: Spatialpy.core.parameter.Parameter
 
         :raises ModelError: No parameter named {pname}
         """
@@ -592,12 +592,12 @@ 

Source code for spatialpy.core.model

         or a dict with name, instance pairs.
 
         :param reacs: Reaction or list of Reactions to be added.
-        :type reacs: spatialpy.Model.Reaction | list(spatialpy.Model.Reaction)
+        :type reacs: spatialpy.core.reaction.Reaction | list(spatialpy.core.reaction.Reaction)
 
         :returns: The Reaction object(s) added to the model
-        :rtype: spatialpy.Model.Reaction
+        :rtype: spatialpy.core.reaction.Reaction | list(spatialpy.core.reaction.Reaction)
 
-        :raises ModelError: Invalid input/reaction to add_reaction()
+        :raises ModelError: if obj is not a spatialpy.core.reaction.Reaction
         """
         from spatialpy.core.reaction import Reaction # pylint: disable=import-outside-toplevel
         if isinstance(reacs, list):
@@ -622,7 +622,7 @@ 

Source code for spatialpy.core.model

         Remove reaction from model.listOfReactions
 
         :param obj: Reaction to be removed.
-        :type obj: spatialpy.Model.Reaction
+        :type obj: spatialpy.core.reaction.Reaction
         """
         self.listOfReactions.pop(obj)
@@ -648,11 +648,11 @@

Source code for spatialpy.core.model

         """
         Retrieve a reaction object from the model by name
 
-        :param rname: name of Reaction to retrieve
+        :param rname: name of the reaction to be returned
         :type rname: str
 
         :returns: The Reaction Object in the model represented by 'rname'
-        :rtype: spatialpy.Model.Reaction
+        :rtype: spatialpy.core.reaction.Reaction
 
         :raises ModelError: Could not find reaction
         """
@@ -689,7 +689,7 @@ 

Source code for spatialpy.core.model

         :type profile: bool
 
         :returns: A SpatialPy Result object containing simulation data.
-        :rtype: spatialpy.Result.Result
+        :rtype: spatialpy.core.result.Result
         """
         from spatialpy.solvers.solver import Solver # pylint: disable=import-outside-toplevel
 
@@ -701,7 +701,7 @@ 

Source code for spatialpy.core.model

 
 
 
[docs] def set_timesteps(self, output_interval, num_steps, timestep_size=None): - """" + """ Set the simlation time span parameters. :param output_interval: size of each output timestep in seconds @@ -761,7 +761,7 @@

Source code for spatialpy.core.model

         Add a spatial domain to the model
 
         :param domain: The Domain object to be added to the model
-        :type domain: spatialpy.Domain.Domain
+        :type domain: spatialpy.core.domain.Domain
 
         :raises ModelError: Invalid Domain object
         """
@@ -774,15 +774,15 @@ 

Source code for spatialpy.core.model

 
[docs] def add_data_function(self, data_function): """ Add a scalar spatial function to the simulation. This is useful if you have a - spatially varying in put to your model. Argument is a instances of subclass of the - spatialpy.DataFunction class. It must implement a function 'map(x)' which takes a - the spatial positon 'x' as an array, and it returns a float value. + spatially varying input to your model. Argument is a instances of subclass of the + spatialpy.DataFunction class. It must implement a function 'map(point)' which takes a + the spatial positon 'point' as an array, and it returns a float value. :param data_function: Data function to be added. :type data_function: spatialpy.DataFunction :returns: DataFunction object(s) added tothe model. - :rtype: spatialpy.DataFunction | list(spatialpy.DataFunction) + :rtype: spatialpy.core.datafunction.DataFunction | list(spatialpy.core.datafunction.DataFunction) :raises ModelError: Invalid DataFunction """ @@ -804,16 +804,16 @@

Source code for spatialpy.core.model

         Add an initial condition object to the initialization of the model.
 
         :param init_cond: Initial condition to be added
-        :type init_cond: spatialpy.InitialCondition.InitialCondition
+        :type init_cond: spatialpy.core.initialcondition.InitialCondition
         """
         self.listOfInitialConditions.append(init_cond)
[docs] def add_boundary_condition(self, bound_cond): """ - Add an BoundaryCondition object to the model. + Add an boundary condition object to the model. :param bound_cond: Boundary condition to be added - :type bound_cond: spatialpy.BoundaryCondition + :type bound_cond: spatialpy.core.boundarycondition.BoundaryCondition """ bound_cond.model = self self.listOfBoundaryConditions.append(bound_cond)
diff --git a/docs/build/html/_modules/spatialpy/core/reaction.html b/docs/build/html/_modules/spatialpy/core/reaction.html index 3525a238..3c4d5a34 100644 --- a/docs/build/html/_modules/spatialpy/core/reaction.html +++ b/docs/build/html/_modules/spatialpy/core/reaction.html @@ -135,7 +135,7 @@

Source code for spatialpy.core.reaction

     :type propensity_function: str
 
     :param rate: if mass action, rate is a reference to a parameter instance.
-    :type rate: spatialpy.model.Parameter
+    :type rate: spatialpy.core.parameter.Parameter
 
     :param annotation: Description of the reaction (meta)
     :type annotation: str
@@ -270,8 +270,8 @@ 

Source code for spatialpy.core.reaction

         """
         Add a product to this reaction
 
-        :param S: Species object to be produced by the reaction
-        :type S: spatialpy.Model.Species
+        :param species: Species object to be produced by the reaction
+        :type species: spatialpy.core.species.Species
 
         :param stoichiometry: Stoichiometry of this product.
         :type stoichiometry: int
@@ -288,7 +288,7 @@ 

Source code for spatialpy.core.reaction

         Add a reactant to this reaction
 
         :param species: reactant Species object
-        :type species: spatialpy.Model.Species
+        :type species: spatialpy.core.species.Species
 
         :param stoichiometry: Stoichiometry of this participant reactant
         :type stoichiometry: int
@@ -316,7 +316,7 @@ 

Source code for spatialpy.core.reaction

         Deferred object initialization, called by model.add_reaction().
 
         :param model: Target SpatialPy Model for annotation.
-        :type model: spatialpy.Model
+        :type model: spatialpy.core.model.Model
         """
         self.ode_propensity_function = self.propensity_function
 
diff --git a/docs/build/html/_modules/spatialpy/core/result.html b/docs/build/html/_modules/spatialpy/core/result.html
index 4256e5b5..aa473c0b 100644
--- a/docs/build/html/_modules/spatialpy/core/result.html
+++ b/docs/build/html/_modules/spatialpy/core/result.html
@@ -405,25 +405,25 @@ 

Source code for spatialpy.core.result

         one or all timepoints. Returns a numpy array containing the species population/concentration values.
 
         :param species: A species in string or dictionary form to retreive information about
-        :type species: str | dict
+        :type species: str | spatialpy.core.species.Species
 
         :param timepoints: A time point where the information should be retreived from.
             If 'timepoints' is None (default), a matrix of dimension:
             (number of timepoints) x (number of voxels) is returned.
             If an integer value is given, that value is used to index into the timespan, and that time point is returned
-            as a 1D array with size (number of voxel).
-        :type timepoints: int (default None)
+            as a 1D array with size (number of voxel).  Defaults to None
+        :type timepoints: int
 
         :param concentration: Whether or not the species is a concentration (True) or population (False)
             If concentration is False (default), the integer, raw, trajectory data is returned.
-            If set to True, the concentration (=copy_number/volume) is returned.
-        :type concentration: bool (default False)
+            If set to True, the concentration (=copy_number/volume) is returned.  Defaults to False
+        :type concentration: bool
 
-        :param deterministic: Whether or not the species is deterministic (True) or stochastic (False)
-        :type deterministic: bool (default False)
+        :param deterministic: Whether or not the species is deterministic (True) or stochastic (False).  Defaults to False
+        :type deterministic: bool
 
-        :param debug: Whether or not debug information should be printed
-        :type debug: bool (default False)
+        :param debug: Whether or not debug information should be printed. Defaults to False
+        :type debug: bool
 
         :returns: A numpy array containing population/concentration values for target species across specified
                     timepoints.  Defaults to all timepoints.
@@ -433,7 +433,7 @@ 

Source code for spatialpy.core.result

         """
         num_voxel = self.model.domain.get_num_voxels()
 
-        if isinstance(species,str):
+        if isinstance(species, str):
             spec_name = species
         else:
             spec_name = species.name
@@ -497,11 +497,13 @@ 

Source code for spatialpy.core.result

         :param deterministic: Whether or not to plot the data as deterministic
         :type deterministic: bool
 
-        :param width: Width in pixels of output plot box
-        :type width: int (default 500)
+        :param width: Width in pixels of output plot box or for matplotlib inches of output plot box. \
+        Defaults to 500 (Plotly) or 6.4 (MatPlotLib)
+        :type width: int
 
-        :param height: Height in pixels of output plot box
-        :type height: int (default 500)
+        :param height: Height in pixels of output plot box or for matplotlib inches of output plot box. \
+        Defaults to 500 (Plotly) or 4.8 (MatPlotLib)
+        :type height: int
 
         :param colormap: colormap to use.  Plotly specification, valid values: "Plotly3","Jet","Blues","YlOrRd",
                 "PuRd","BuGn","YlOrBr","PuBuGn","BuPu","YlGnBu", "PuBu","GnBu","YlGn","Greens","Reds",
@@ -543,7 +545,7 @@ 

Source code for spatialpy.core.result

         :returns: A dictionary containing data for a plotly figure of species output trajectory
         :rtype: dict
 
-        :raises ResultsError: unable to plot species for given time
+        :raises ResultError: unable to plot species for given time
         """
         time_index_list = self.get_timespan()
 
@@ -671,7 +673,14 @@ 

Source code for spatialpy.core.result

         given, that value is used to index into the timespan, and that time point is returned \
         as a 1D array with size (number of voxel).
 
-        :param property_name: A string describing the property to be returned.
+        :param property_name: A string describing the property to be returned.  Can be one of: {
+            'v' : velocity,
+            'rho': density,
+            'mass': mass,
+            'id': type_id,
+            'type': type as str,
+            'bvf_phi': boundary volume fraction,
+            'nu': viscosity}
         :type property_name: str
 
         :param timepoints: timespan index to be returned.  Default is None
@@ -680,7 +689,7 @@ 

Source code for spatialpy.core.result

         :returns: a numpy array of target property values across timepoints, defaults to all timepoints.
         :rtype: numpy.ndarray
 
-        :raises ResultsError: Could not get data for given timepoints.
+        :raises ResultError: Could not get data for given timepoints.
         """
 
         l_time = len(self.get_timespan()) - 1
@@ -732,11 +741,13 @@ 

Source code for spatialpy.core.result

         :param p_ndx: The property index of the results to be plotted
         :type p_ndx: int
 
-        :param width: Width in pixels of output plot box or for matplotlib inches of output plot box
-        :type width: int (default 500)
+        :param width: Width in pixels of output plot box or for matplotlib inches of output plot box. \
+        Defaults to 500 (Plotly) or 6.4 (MatPlotLib)
+        :type width: int
 
-        :param height: Height in pixels of output plot box or for matplotlib inches of output plot box
-        :type height: int (default 500)
+        :param height: Height in pixels of output plot box or for matplotlib inches of output plot box. \
+        Defaults to 500 (Plotly) or 4.8 (MatPlotLib)
+        :type height: int
 
         :param colormap: colormap to use.  Plotly specification, valid values: "Plotly3","Jet","Blues","YlOrRd",
                 "PuRd","BuGn","YlOrBr","PuBuGn","BuPu","YlGnBu", "PuBu","GnBu","YlGn","Greens","Reds",
@@ -928,9 +939,9 @@ 

Source code for spatialpy.core.result

         The columns of modelname_mesh.csv are: 'Voxel ID', 'X', 'Y', 'Z', 'Type', 'Volume', 'Mass', 'Viscosity'
         The columns of modelname_species_S.csv: 'Time', 'Voxel 0', Voxel 1', ... 'Voxel N'.
 
-        :type folder_name: str (default current working directory)
-        :param folder_name: A path where the vtk files will be written, created if non-existant.
-        If no path is provided current working directory is used.
+        :type folder_name: str
+        :param folder_name: A path where the vtk files will be written, created if non-existant. \
+        Defaults current working directory
         """
         if not folder_name:
             folder_name = os.path.abspath(os.getcwd())
@@ -959,13 +970,13 @@ 

Source code for spatialpy.core.result

                 for voxel in range(num_vox):
                     writer.writerow([voxel] + data[:,voxel].tolist())
-
[docs] def export_to_vtk(self, timespan, folder_name=None): + def __export_to_vtk(self, timespan, folder_name=None): """ Write the trajectory to a collection of vtk files. The exported data is #molecules/volume, where the volume unit is implicit from the mesh dimension. Not currently implemented. """ - raise ResultError("Not implemented.")
+ raise ResultError("Not implemented.")
diff --git a/docs/build/html/_modules/spatialpy/core/species.html b/docs/build/html/_modules/spatialpy/core/species.html index 0de7a3d4..8429f830 100644 --- a/docs/build/html/_modules/spatialpy/core/species.html +++ b/docs/build/html/_modules/spatialpy/core/species.html @@ -121,7 +121,7 @@

Source code for spatialpy.core.species

     :param diffusion_coefficient: Non-constant coefficient of diffusion for Species.
     :type diffusion_coefficient: float
 
-    :param restrict_to: Set the diffusion coefficient to zero for 'species' in all types not in 'listOfTypes'.
+    :param restrict_to: Set the diffusion coefficient to zero for 'species' in all types not in 'listOfTypes'. \
     This effectively restricts the movement of 'species' to the types specified in 'listOfTypes'.
     :type restrict_to: int, str, list of ints or list of strs
     """
@@ -164,7 +164,7 @@ 

Source code for spatialpy.core.species

         :param diffusion_coefficient: Non-constant coefficient of diffusion for Species.
         :type diffusion_coefficient: float
 
-        :raises SpeciesError: If diffusion_coefficient is negative.
+        :raises SpeciesError: If diffusion_coefficient is negative or not a valid type.
         """
         if not (isinstance(diffusion_coefficient, (Parameter, float, int)) or \
                             type(diffusion_coefficient).__name__ == 'Parameter'):
diff --git a/docs/build/html/_modules/spatialpy/solvers/solver.html b/docs/build/html/_modules/spatialpy/solvers/solver.html
index c4967386..5c84fcbc 100644
--- a/docs/build/html/_modules/spatialpy/solvers/solver.html
+++ b/docs/build/html/_modules/spatialpy/solvers/solver.html
@@ -142,7 +142,7 @@ 

Source code for spatialpy.solvers.solver

     SpatialPy solver object.
 
     :param model: Target model of solver simulation.
-    :type model: spatialpy.Model.Model
+    :type model: spatialpy.core.model.Model
 
     :param debug_level: Target level of debugging.
     :type debug_level: int
diff --git a/docs/build/html/_modules/spatialpy/stochss/stochss_export.html b/docs/build/html/_modules/spatialpy/stochss/stochss_export.html
index bb8ca688..cead8e00 100644
--- a/docs/build/html/_modules/spatialpy/stochss/stochss_export.html
+++ b/docs/build/html/_modules/spatialpy/stochss/stochss_export.html
@@ -293,13 +293,17 @@ 

Source code for spatialpy.stochss.stochss_export

""" SpatialPy model to StochSS converter - Args: - spatialpy_model : spatialpy.Model - SpatialPy model to be converted to StochSS - filename : str - Path to the exported stochss model - return_stochss_model : bool - Whether or not to return the model + :param model: SpatialPy model to be converted to StochSS. + :type model: spatialpy.core.model.Model + + :param filename: Path to the exported stochss model. + :type filename: str + + :param return_stochss_model: Whether or not to return the model. + :type return_stochss_model: bool + + :returns: StochSS model dict if return_stochss_model is True else path to StochSS model file. + :rtype: dict | str """ _ = model.compile_prep() if path is None: diff --git a/docs/build/html/_sources/index.rst.txt b/docs/build/html/_sources/index.rst.txt index ef9b1b78..33060207 100644 --- a/docs/build/html/_sources/index.rst.txt +++ b/docs/build/html/_sources/index.rst.txt @@ -20,7 +20,7 @@ The latest version of SpatialPy can be found on `PyPI `_ for more information on how to build and simulate your models with SpatialPy. For an example of how to use SpatialPy to simulate a spatial stochastic reaction-diffusion system, see the `3D Cylinder Demo `_. We also provide examples of how to use SpatialPy to simulate physics (`Gravity Demo `_) and fluid flow (`Weir Model `_). +See our `Example Notebook - Start Here `_ for more information on how to build and simulate your models with SpatialPy. For an example of how to use SpatialPy to simulate a spatial stochastic reaction-diffusion system, see the `3D Cylinder Demo `_. We also provide examples of how to use SpatialPy to simulate physics (`Gravity Demo `_) and fluid flow (`Weir Model `_). Reporting Issues diff --git a/docs/build/html/classes/spatialpy.core.html b/docs/build/html/classes/spatialpy.core.html index a5249b96..0b5b39b2 100644 --- a/docs/build/html/classes/spatialpy.core.html +++ b/docs/build/html/classes/spatialpy.core.html @@ -128,7 +128,7 @@

Submodulesobject

Set spatial regions of the domain where a property of particles are held constant (updated each simulation step)

-
+
Conditions (one or more of the following must be set):
@@ -257,18 +246,18 @@

SubmodulesParameters

name (str) – Name of the Data Function.

+
Raises
+

DataFunctionError – If a name is not provided.

+

map(point)[source]

This method must be overridden by the DataFunction subclass.

-
-
NOTE: The spatial location is evaulated at t=0 and is not

reevaluated as the fluid domain moves over time.

-
-
+

NOTE: The spatial location is evaulated at t=0 and is not re-evaluated as the fluid domain moves over time.

Parameters
-

point (vector of 3 doubles) – The x,y,z position

+

point (float[3]) – The x, y, z position.

Returns

Value of function at this spatial location.

@@ -305,13 +294,13 @@

SubmodulesParameters
  • numpoints (int) – Total number of spatial domain points

  • -
  • xlim (tuple(float)) – Range of domain along x-axis

  • -
  • ylim (tuple(float)) – Range of domain along y-axis

  • -
  • zlim (tuple(float)) – Range of domain along z-axis

  • +
  • xlim (float(2)) – Range of domain along x-axis

  • +
  • ylim (float(2)) – Range of domain along y-axis

  • +
  • zlim (float(2)) – Range of domain along z-axis

  • rho (float) – Background density for the system

  • c0 (float) – Speed of sound for the system

  • P0 (float) – Background pressure for the system

  • -
  • gravity – Acceleration of gravity for the system.

  • +
  • gravity (float[3]) – Acceleration of gravity for the system.

@@ -322,14 +311,14 @@

Submodules
Parameters
    -
  • point (tuple(float, float, float) or tuple(float, float)) – Spatial coordinate vertices of point to be added

  • +
  • point (float(3)) – Spatial coordinate vertices of point to be added

  • vol (float) – Default volume of particle to be added

  • mass (float) – Default mass of particle to be added

  • -
  • type_id (str | int) – Particle type ID of particle to be created

  • -
  • nu (float) – Default viscosity of particle to be created

  • +
  • type_id (str | int) – Particle type ID of particle to be craddedeated

  • +
  • nu (float) – Default viscosity of particle to be added

  • fixed (bool) – True if particle is spatially fixed, else False

  • -
  • c (float) – Default artificial speed of sound of particle to be created

  • -
  • rho (float) – Default density of particle to be created

  • +
  • c (float) – Default artificial speed of sound of particle to be added

  • +
  • rho (float) – Default density of particle to be added

Raises
@@ -350,13 +339,13 @@

Submodules
Parameters
-

point (tuple(float, float, float) or tuple(float, float)) – Target source point

+

point (float(3)) – Target source point

Returns

The coordinates of the nearest vertex to the source point.

Return type
-

tuple(float, float, float) or tuple(float, float)

+

float(3)

@@ -364,11 +353,11 @@

Submodules
compile_prep()[source]
-

Generate the domain list of type ids and check for invalid type_ids and rho values +

Generate the domains list of type ids and check for invalid type_ids and rho values in preperation of compiling the simulation files.

Raises
-

DomainError – If a type_id is not set or rh for a particle is 0.

+

DomainError – If a type_id is not set or rho=0 for a particle.

@@ -394,26 +383,24 @@

Submodules
Parameters
Returns

Uniform 2D SpatialPy Domain object.

Return type
-

spatialpy.Domain.Domain

+

spatialpy.core.domain.Domain

@@ -425,9 +412,9 @@

Submodules
Parameters
Returns

Uniform 3D SpatialPy Domain object.

Return type
-

spatialpy.Domain.Domain

+

spatialpy.core.domain.Domain

@@ -458,8 +443,8 @@

Submodules
Parameters
    -
  • start (tuple(float, float, float) or tuple(float, float)) – Starting point

  • -
  • end (tuple(float, float, float) or tuple(float, float)) – Ending point

  • +
  • start (float(3)) – Starting point

  • +
  • end (float(2)) – Ending point

Returns
@@ -478,7 +463,7 @@

Submodules
Parameters
Returns
@@ -619,7 +604,7 @@

Submodules

SpatialPy Domain object created from the meshio object

Return type
-

spatialpy.Domain.Domain

+

spatialpy.core.domain.Domain

@@ -662,7 +647,7 @@

Submodules

SpatialPy Domain object created from the mesh file.

Return type
-

spatialpy.Domain.Domain

+

spatialpy.core.domain.Domain

@@ -679,7 +664,7 @@

Submodules

SpatialPy Domain object created from StochSS domain.

Return type
-

spatialpy.Domain.Domain

+

spatialpy.core.domain.Domain

@@ -713,7 +698,7 @@

Submodules

SpatialPy Domain object created from xml mesh.

Return type
-

spatialpy.Domain.Domain

+

spatialpy.core.domain.Domain

@@ -725,7 +710,7 @@

Submodules
Parameters
@@ -1114,16 +1104,16 @@

Submodules
Parameters
-

obj (spatialpy.Model.Species | list(spatialpy.Model.Species) – The species or list of species to be added to the model object.

+

obj (spatialpy.core.species.Species | list(spatialpy.core.species.Species) – The species or list of species to be added to the model object.

Returns

Species object which was added to the model.

Return type
-

spatialpy.Species | list(spatialpy.Species)

+

spatialpy.core.species.Species | list(spatialpy.core.species.Species)

Raises
-

ModelError – If obj is not a spatialpy.Species

+

ModelError – If obj is not a spatialpy.core.species.Species

@@ -1171,7 +1161,7 @@

Submodules
Parameters
-

obj (spatialpy.Model.Parameter) – Parameter object to be removed

+

obj (spatialpy.core.parameter.Parameter) – Parameter object to be removed

@@ -1182,7 +1172,7 @@

Submodules
Parameters
-

obj (spatialpy.Model.Reaction) – Reaction to be removed.

+

obj (spatialpy.core.reaction.Reaction) – Reaction to be removed.

@@ -1193,7 +1183,7 @@

Submodules
Parameters
-

obj (spatialpy.Model.Species) – Species object to be removed

+

obj (spatialpy.core.species.Species) – Species object to be removed

@@ -1274,13 +1264,13 @@

Submodules
Parameters
-

pname (spatialpy.Model.Parameter) – Name of parameter to be removed

+

pname (str) – Name of parameter to be returned

Returns

The Parameter object represented in the model by ‘pname’

Return type
-

Spatialpy.Model.Parameter

+

Spatialpy.core.parameter.Parameter

Raises

ModelError – No parameter named {pname}

@@ -1294,13 +1284,13 @@

Submodules
Parameters
-

rname (str) – name of Reaction to retrieve

+

rname (str) – name of the reaction to be returned

Returns

The Reaction Object in the model represented by ‘rname’

Return type
-

spatialpy.Model.Reaction

+

spatialpy.core.reaction.Reaction

Raises

ModelError – Could not find reaction

@@ -1320,7 +1310,7 @@

Submodules

The Species objected represented by given ‘sname’

Return type
-

spatialpy.Model.Species

+

spatialpy.core.species.Species

Raises

ModelError – if the model does not contain the requested species

@@ -1354,7 +1344,7 @@

Submodules

A SpatialPy Result object containing simulation data.

Return type
-

spatialpy.Result.Result

+

spatialpy.core.result.Result

@@ -1407,8 +1397,7 @@

Submodules
set_timesteps(output_interval, num_steps, timestep_size=None)[source]
-

” -Set the simlation time span parameters.

+

Set the simlation time span parameters.

Parameters
@@ -1548,7 +1537,7 @@

Submodules
Parameters
@@ -1562,7 +1551,7 @@

Submodules
Parameters
@@ -1586,7 +1575,7 @@

Submodules
Parameters
-

model (spatialpy.Model) – Target SpatialPy Model for annotation.

+

model (spatialpy.core.model.Model) – Target SpatialPy Model for annotation.

@@ -1622,18 +1611,9 @@

Submodules
Parameters
-

folder_name (str (default current working directory)) – A path where the vtk files will be written, created if non-existant.

+

folder_name (str) – A path where the vtk files will be written, created if non-existant. Defaults current working directory

-

If no path is provided current working directory is used.

- - -
-
-export_to_vtk(timespan, folder_name=None)[source]
-

Write the trajectory to a collection of vtk files. -The exported data is #molecules/volume, where the volume unit is implicit from the mesh dimension. -Not currently implemented.

@@ -1643,7 +1623,14 @@

Submodules
Parameters
    -
  • property_name (str) – A string describing the property to be returned.

  • +
  • property_name (str) – A string describing the property to be returned. Can be one of: { +‘v’ : velocity, +‘rho’: density, +‘mass’: mass, +‘id’: type_id, +‘type’: type as str, +‘bvf_phi’: boundary volume fraction, +‘nu’: viscosity}

  • timepoints (int) – timespan index to be returned. Default is None

@@ -1654,7 +1641,7 @@

Submodules

numpy.ndarray

Raises
-

ResultsError – Could not get data for given timepoints.

+

ResultError – Could not get data for given timepoints.

@@ -1667,17 +1654,17 @@

Submodules
Parameters
    -
  • species (str | dict) – A species in string or dictionary form to retreive information about

  • -
  • timepoints (int (default None)) – A time point where the information should be retreived from. +

  • species (str | spatialpy.core.species.Species) – A species in string or dictionary form to retreive information about

  • +
  • timepoints (int) – A time point where the information should be retreived from. If ‘timepoints’ is None (default), a matrix of dimension: (number of timepoints) x (number of voxels) is returned. If an integer value is given, that value is used to index into the timespan, and that time point is returned -as a 1D array with size (number of voxel).

  • -
  • concentration (bool (default False)) – Whether or not the species is a concentration (True) or population (False) +as a 1D array with size (number of voxel). Defaults to None

  • +
  • concentration (bool) – Whether or not the species is a concentration (True) or population (False) If concentration is False (default), the integer, raw, trajectory data is returned. -If set to True, the concentration (=copy_number/volume) is returned.

  • -
  • deterministic (bool (default False)) – Whether or not the species is deterministic (True) or stochastic (False)

  • -
  • debug (bool (default False)) – Whether or not debug information should be printed

  • +If set to True, the concentration (=copy_number/volume) is returned. Defaults to False

    +
  • deterministic (bool) – Whether or not the species is deterministic (True) or stochastic (False). Defaults to False

  • +
  • debug (bool) – Whether or not debug information should be printed. Defaults to False

Returns
@@ -1718,8 +1705,8 @@

Submodules

dict

Raises
-

ResultsError – unable to plot species for given time

+

ResultError – unable to plot species for given time

@@ -1959,12 +1946,10 @@

Submodules
  • name (str) – Name of the Species

  • diffusion_coefficient (float) – Non-constant coefficient of diffusion for Species.

  • -
  • restrict_to – Set the diffusion coefficient to zero for ‘species’ in all types not in ‘listOfTypes’.

  • +
  • restrict_to (int, str, list of ints or list of strs) – Set the diffusion coefficient to zero for ‘species’ in all types not in ‘listOfTypes’. This effectively restricts the movement of ‘species’ to the types specified in ‘listOfTypes’.

-

This effectively restricts the movement of ‘species’ to the types specified in ‘listOfTypes’. -:type restrict_to: int, str, list of ints or list of strs

set_diffusion_coefficient(diffusion_coefficient)[source]
@@ -1974,7 +1959,7 @@

Submodules

diffusion_coefficient (float) – Non-constant coefficient of diffusion for Species.

Raises
-

SpeciesError – If diffusion_coefficient is negative.

+

SpeciesError – If diffusion_coefficient is negative or not a valid type.

@@ -2114,7 +2099,7 @@

Submodulesobject

Set spatial regions of the domain where a property of particles are held constant (updated each simulation step)

-
+
Conditions (one or more of the following must be set):
@@ -2186,18 +2160,18 @@

SubmodulesParameters

name (str) – Name of the Data Function.

+
Raises
+

DataFunctionError – If a name is not provided.

+

map(point)[source]

This method must be overridden by the DataFunction subclass.

-
-
NOTE: The spatial location is evaulated at t=0 and is not

reevaluated as the fluid domain moves over time.

-
-
+

NOTE: The spatial location is evaulated at t=0 and is not re-evaluated as the fluid domain moves over time.

Parameters
-

point (vector of 3 doubles) – The x,y,z position

+

point (float[3]) – The x, y, z position.

Returns

Value of function at this spatial location.

@@ -2226,13 +2200,13 @@

SubmodulesParameters
  • numpoints (int) – Total number of spatial domain points

  • -
  • xlim (tuple(float)) – Range of domain along x-axis

  • -
  • ylim (tuple(float)) – Range of domain along y-axis

  • -
  • zlim (tuple(float)) – Range of domain along z-axis

  • +
  • xlim (float(2)) – Range of domain along x-axis

  • +
  • ylim (float(2)) – Range of domain along y-axis

  • +
  • zlim (float(2)) – Range of domain along z-axis

  • rho (float) – Background density for the system

  • c0 (float) – Speed of sound for the system

  • P0 (float) – Background pressure for the system

  • -
  • gravity – Acceleration of gravity for the system.

  • +
  • gravity (float[3]) – Acceleration of gravity for the system.

@@ -2243,14 +2217,14 @@

Submodules
Parameters
    -
  • point (tuple(float, float, float) or tuple(float, float)) – Spatial coordinate vertices of point to be added

  • +
  • point (float(3)) – Spatial coordinate vertices of point to be added

  • vol (float) – Default volume of particle to be added

  • mass (float) – Default mass of particle to be added

  • -
  • type_id (str | int) – Particle type ID of particle to be created

  • -
  • nu (float) – Default viscosity of particle to be created

  • +
  • type_id (str | int) – Particle type ID of particle to be craddedeated

  • +
  • nu (float) – Default viscosity of particle to be added

  • fixed (bool) – True if particle is spatially fixed, else False

  • -
  • c (float) – Default artificial speed of sound of particle to be created

  • -
  • rho (float) – Default density of particle to be created

  • +
  • c (float) – Default artificial speed of sound of particle to be added

  • +
  • rho (float) – Default density of particle to be added

Raises
@@ -2271,13 +2245,13 @@

Submodules
Parameters
-

point (tuple(float, float, float) or tuple(float, float)) – Target source point

+

point (float(3)) – Target source point

Returns

The coordinates of the nearest vertex to the source point.

Return type
-

tuple(float, float, float) or tuple(float, float)

+

float(3)

@@ -2285,11 +2259,11 @@

Submodules
compile_prep()[source]
-

Generate the domain list of type ids and check for invalid type_ids and rho values +

Generate the domains list of type ids and check for invalid type_ids and rho values in preperation of compiling the simulation files.

Raises
-

DomainError – If a type_id is not set or rh for a particle is 0.

+

DomainError – If a type_id is not set or rho=0 for a particle.

@@ -2315,26 +2289,24 @@

Submodules
Parameters
Returns

Uniform 2D SpatialPy Domain object.

Return type
-

spatialpy.Domain.Domain

+

spatialpy.core.domain.Domain

@@ -2346,9 +2318,9 @@

Submodules
Parameters
Returns

Uniform 3D SpatialPy Domain object.

Return type
-

spatialpy.Domain.Domain

+

spatialpy.core.domain.Domain

@@ -2379,8 +2349,8 @@

Submodules
Parameters
    -
  • start (tuple(float, float, float) or tuple(float, float)) – Starting point

  • -
  • end (tuple(float, float, float) or tuple(float, float)) – Ending point

  • +
  • start (float(3)) – Starting point

  • +
  • end (float(2)) – Ending point

Returns
@@ -2399,7 +2369,7 @@

Submodules
Parameters
Returns
@@ -2540,7 +2510,7 @@

Submodules

SpatialPy Domain object created from the meshio object

Return type
-

spatialpy.Domain.Domain

+

spatialpy.core.domain.Domain

@@ -2583,7 +2553,7 @@

Submodules

SpatialPy Domain object created from the mesh file.

Return type
-

spatialpy.Domain.Domain

+

spatialpy.core.domain.Domain

@@ -2600,7 +2570,7 @@

Submodules

SpatialPy Domain object created from StochSS domain.

Return type
-

spatialpy.Domain.Domain

+

spatialpy.core.domain.Domain

@@ -2634,7 +2604,7 @@

Submodules

SpatialPy Domain object created from xml mesh.

Return type
-

spatialpy.Domain.Domain

+

spatialpy.core.domain.Domain

@@ -2646,7 +2616,7 @@

Submodules
Parameters
@@ -3240,16 +3215,16 @@

Submodules
Parameters
-

obj (spatialpy.Model.Species | list(spatialpy.Model.Species) – The species or list of species to be added to the model object.

+

obj (spatialpy.core.species.Species | list(spatialpy.core.species.Species) – The species or list of species to be added to the model object.

Returns

Species object which was added to the model.

Return type
-

spatialpy.Species | list(spatialpy.Species)

+

spatialpy.core.species.Species | list(spatialpy.core.species.Species)

Raises
-

ModelError – If obj is not a spatialpy.Species

+

ModelError – If obj is not a spatialpy.core.species.Species

@@ -3297,7 +3272,7 @@

Submodules
Parameters
-

obj (spatialpy.Model.Parameter) – Parameter object to be removed

+

obj (spatialpy.core.parameter.Parameter) – Parameter object to be removed

@@ -3308,7 +3283,7 @@

Submodules
Parameters
-

obj (spatialpy.Model.Reaction) – Reaction to be removed.

+

obj (spatialpy.core.reaction.Reaction) – Reaction to be removed.

@@ -3319,7 +3294,7 @@

Submodules
Parameters
-

obj (spatialpy.Model.Species) – Species object to be removed

+

obj (spatialpy.core.species.Species) – Species object to be removed

@@ -3400,13 +3375,13 @@

Submodules
Parameters
-

pname (spatialpy.Model.Parameter) – Name of parameter to be removed

+

pname (str) – Name of parameter to be returned

Returns

The Parameter object represented in the model by ‘pname’

Return type
-

Spatialpy.Model.Parameter

+

Spatialpy.core.parameter.Parameter

Raises

ModelError – No parameter named {pname}

@@ -3420,13 +3395,13 @@

Submodules
Parameters
-

rname (str) – name of Reaction to retrieve

+

rname (str) – name of the reaction to be returned

Returns

The Reaction Object in the model represented by ‘rname’

Return type
-

spatialpy.Model.Reaction

+

spatialpy.core.reaction.Reaction

Raises

ModelError – Could not find reaction

@@ -3446,7 +3421,7 @@

Submodules

The Species objected represented by given ‘sname’

Return type
-

spatialpy.Model.Species

+

spatialpy.core.species.Species

Raises

ModelError – if the model does not contain the requested species

@@ -3480,7 +3455,7 @@

Submodules

A SpatialPy Result object containing simulation data.

Return type
-

spatialpy.Result.Result

+

spatialpy.core.result.Result

@@ -3533,8 +3508,7 @@

Submodules
set_timesteps(output_interval, num_steps, timestep_size=None)[source]
-

” -Set the simlation time span parameters.

+

Set the simlation time span parameters.

Parameters
@@ -3725,7 +3699,7 @@

Submodulesspatialpy.core.parameter.Parameter) – if mass action, rate is a reference to a parameter instance.

  • annotation (str) – Description of the reaction (meta)

  • restrict_to (int, str, list of ints or list of strs) – Restrict reaction execution to a type or list of types within the domain.

  • @@ -3738,7 +3712,7 @@

    Submodules
    Parameters
    @@ -3752,7 +3726,7 @@

    Submodules
    Parameters
    @@ -3776,7 +3750,7 @@

    Submodules
    Parameters
    -

    model (spatialpy.Model) – Target SpatialPy Model for annotation.

    +

    model (spatialpy.core.model.Model) – Target SpatialPy Model for annotation.

    @@ -3804,18 +3778,9 @@

    Submodules
    Parameters
    -

    folder_name (str (default current working directory)) – A path where the vtk files will be written, created if non-existant.

    +

    folder_name (str) – A path where the vtk files will be written, created if non-existant. Defaults current working directory

    -

    If no path is provided current working directory is used.

    - - -
    -
    -export_to_vtk(timespan, folder_name=None)[source]
    -

    Write the trajectory to a collection of vtk files. -The exported data is #molecules/volume, where the volume unit is implicit from the mesh dimension. -Not currently implemented.

    @@ -3825,7 +3790,14 @@

    Submodules
    Parameters
      -
    • property_name (str) – A string describing the property to be returned.

    • +
    • property_name (str) – A string describing the property to be returned. Can be one of: { +‘v’ : velocity, +‘rho’: density, +‘mass’: mass, +‘id’: type_id, +‘type’: type as str, +‘bvf_phi’: boundary volume fraction, +‘nu’: viscosity}

    • timepoints (int) – timespan index to be returned. Default is None

    @@ -3836,7 +3808,7 @@

    Submodules

    numpy.ndarray

    Raises
    -

    ResultsError – Could not get data for given timepoints.

    +

    ResultError – Could not get data for given timepoints.

    @@ -3849,17 +3821,17 @@

    Submodules
    Parameters
      -
    • species (str | dict) – A species in string or dictionary form to retreive information about

    • -
    • timepoints (int (default None)) – A time point where the information should be retreived from. +

    • species (str | spatialpy.core.species.Species) – A species in string or dictionary form to retreive information about

    • +
    • timepoints (int) – A time point where the information should be retreived from. If ‘timepoints’ is None (default), a matrix of dimension: (number of timepoints) x (number of voxels) is returned. If an integer value is given, that value is used to index into the timespan, and that time point is returned -as a 1D array with size (number of voxel).

    • -
    • concentration (bool (default False)) – Whether or not the species is a concentration (True) or population (False) +as a 1D array with size (number of voxel). Defaults to None

    • +
    • concentration (bool) – Whether or not the species is a concentration (True) or population (False) If concentration is False (default), the integer, raw, trajectory data is returned. -If set to True, the concentration (=copy_number/volume) is returned.

    • -
    • deterministic (bool (default False)) – Whether or not the species is deterministic (True) or stochastic (False)

    • -
    • debug (bool (default False)) – Whether or not debug information should be printed

    • +If set to True, the concentration (=copy_number/volume) is returned. Defaults to False

      +
    • deterministic (bool) – Whether or not the species is deterministic (True) or stochastic (False). Defaults to False

    • +
    • debug (bool) – Whether or not debug information should be printed. Defaults to False

    Returns
    @@ -3900,8 +3872,8 @@

    Submodules

    dict

    Raises
    -

    ResultsError – unable to plot species for given time

    +

    ResultError – unable to plot species for given time

    @@ -4018,7 +3990,7 @@

    Submodules
    Parameters
    @@ -4030,7 +4002,7 @@

    Submodules
    Parameters
    -

    model (spatialpy.model.Model) – Model contianing the target species.

    +

    model (spatialpy.core.model.Model) – Model contianing the target species.

    @@ -4061,12 +4033,10 @@

    Submodules
    • name (str) – Name of the Species

    • diffusion_coefficient (float) – Non-constant coefficient of diffusion for Species.

    • -
    • restrict_to – Set the diffusion coefficient to zero for ‘species’ in all types not in ‘listOfTypes’.

    • +
    • restrict_to (int, str, list of ints or list of strs) – Set the diffusion coefficient to zero for ‘species’ in all types not in ‘listOfTypes’. This effectively restricts the movement of ‘species’ to the types specified in ‘listOfTypes’.

    -

    This effectively restricts the movement of ‘species’ to the types specified in ‘listOfTypes’. -:type restrict_to: int, str, list of ints or list of strs

    set_diffusion_coefficient(diffusion_coefficient)[source]
    @@ -4076,7 +4046,7 @@

    Submodules

    diffusion_coefficient (float) – Non-constant coefficient of diffusion for Species.

    Raises
    -

    SpeciesError – If diffusion_coefficient is negative.

    +

    SpeciesError – If diffusion_coefficient is negative or not a valid type.

    @@ -4098,7 +4068,7 @@

    Submodules
    Parameters
    @@ -4110,7 +4080,7 @@

    Submodules
    Parameters
    -

    model (spatialpy.model.Model) – Model contianing the target species.

    +

    model (spatialpy.core.model.Model) – Model contianing the target species.

    diff --git a/docs/build/html/classes/spatialpy.solvers.html b/docs/build/html/classes/spatialpy.solvers.html index 6399a06c..a0aecbb1 100644 --- a/docs/build/html/classes/spatialpy.solvers.html +++ b/docs/build/html/classes/spatialpy.solvers.html @@ -891,7 +891,7 @@

    Submodules
    Parameters
    diff --git a/docs/build/html/classes/spatialpy.stochss.html b/docs/build/html/classes/spatialpy.stochss.html index 2cb25e06..b422fed0 100644 --- a/docs/build/html/classes/spatialpy.stochss.html +++ b/docs/build/html/classes/spatialpy.stochss.html @@ -127,14 +127,17 @@

    Submodules
    Parameters
    +
    Returns
    +

    StochSS model dict if return_stochss_model is True else path to StochSS model file.

    +
    +
    Return type
    +

    dict | str

    +
    diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html index b01ffea2..f15d74f7 100644 --- a/docs/build/html/genindex.html +++ b/docs/build/html/genindex.html @@ -390,12 +390,6 @@

    E

    -
  • export_to_vtk() (spatialpy.core.Result method) - -
  • diff --git a/docs/build/html/index.html b/docs/build/html/index.html index e6a60f46..dfb90b68 100644 --- a/docs/build/html/index.html +++ b/docs/build/html/index.html @@ -100,7 +100,7 @@

    Getting a copy of SpatialPyPlease register as a user! SpatialPy's development is funded by NIH grant 2R01EB014877, and to continue support, we need to prove SpatialPy has users. Please fill out our short registration form!

    Examples

    -

    See our Example Notebook - Getting Started for more information on how to build and simulate your models with SpatialPy. For an example of how to use SpatialPy to simulate a spatial stochastic reaction-diffusion system, see the 3D Cylinder Demo. We also provide examples of how to use SpatialPy to simulate physics (Gravity Demo) and fluid flow (Weir Model).

    +

    See our Example Notebook - Start Here for more information on how to build and simulate your models with SpatialPy. For an example of how to use SpatialPy to simulate a spatial stochastic reaction-diffusion system, see the 3D Cylinder Demo. We also provide examples of how to use SpatialPy to simulate physics (Gravity Demo) and fluid flow (Weir Model).

    Reporting Issues

    diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv index 8e7baf8f..df1b09ba 100644 Binary files a/docs/build/html/objects.inv and b/docs/build/html/objects.inv differ diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index 4a0be063..70ef50ba 100644 --- a/docs/build/html/searchindex.js +++ b/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["classes/spatialpy","classes/spatialpy.core","classes/spatialpy.solvers","classes/spatialpy.stochss","index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":4,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.todo":2,"sphinx.ext.viewcode":1,sphinx:56},filenames:["classes/spatialpy.rst","classes/spatialpy.core.rst","classes/spatialpy.solvers.rst","classes/spatialpy.stochss.rst","index.rst"],objects:{"":{spatialpy:[0,0,0,"-"]},"spatialpy.core":{BoundaryCondition:[1,1,1,""],BoundaryConditionError:[1,3,1,""],DataFunction:[1,1,1,""],DataFunctionError:[1,3,1,""],Domain:[1,1,1,""],DomainError:[1,3,1,""],Geometry:[1,1,1,""],GeometryAll:[1,1,1,""],GeometryError:[1,3,1,""],GeometryExterior:[1,1,1,""],GeometryInterior:[1,1,1,""],InitialCondition:[1,1,1,""],InitialConditionError:[1,3,1,""],KDTree:[1,1,1,""],Model:[1,1,1,""],ModelError:[1,3,1,""],OrderedDict:[1,1,1,""],Parameter:[1,1,1,""],ParameterError:[1,3,1,""],PlaceInitialCondition:[1,1,1,""],Reaction:[1,1,1,""],ReactionError:[1,3,1,""],Result:[1,1,1,""],ResultError:[1,3,1,""],ScatterInitialCondition:[1,1,1,""],SimulationError:[1,3,1,""],SimulationTimeout:[1,3,1,""],Species:[1,1,1,""],SpeciesError:[1,3,1,""],UniformInitialCondition:[1,1,1,""],VTKReader:[1,1,1,""],VTKReaderError:[1,3,1,""],VTKReaderIOError:[1,3,1,""],boundarycondition:[1,0,0,"-"],cleanup:[1,0,0,"-"],cleanup_build_files:[1,5,1,""],cleanup_core_files:[1,5,1,""],cleanup_result_files:[1,5,1,""],cleanup_tempfiles:[1,5,1,""],combinations:[1,1,1,""],datafunction:[1,0,0,"-"],domain:[1,0,0,"-"],geometry:[1,0,0,"-"],init_notebook_mode:[1,5,1,""],initialcondition:[1,0,0,"-"],iplot:[1,5,1,""],model:[1,0,0,"-"],parameter:[1,0,0,"-"],reaction:[1,0,0,"-"],result:[1,0,0,"-"],spatialpyerror:[1,0,0,"-"],species:[1,0,0,"-"],vtkreader:[1,0,0,"-"]},"spatialpy.core.BoundaryCondition":{expression:[1,2,1,""]},"spatialpy.core.DataFunction":{map:[1,2,1,""]},"spatialpy.core.Domain":{add_point:[1,2,1,""],calculate_vol:[1,2,1,""],closest_vertex:[1,2,1,""],compile_prep:[1,2,1,""],coordinates:[1,2,1,""],create_2D_domain:[1,2,1,""],create_3D_domain:[1,2,1,""],distance_between_2_vertices:[1,2,1,""],fill_with_particles:[1,2,1,""],find_boundary_points:[1,2,1,""],find_h:[1,2,1,""],get_bounding_box:[1,2,1,""],get_domain_size:[1,2,1,""],get_num_voxels:[1,2,1,""],get_type_def:[1,2,1,""],get_vol:[1,2,1,""],import_meshio_object:[1,2,1,""],plot_types:[1,2,1,""],read_msh_file:[1,2,1,""],read_stochss_domain:[1,2,1,""],read_stochss_subdomain_file:[1,2,1,""],read_xml_mesh:[1,2,1,""],set_properties:[1,2,1,""]},"spatialpy.core.Geometry":{inside:[1,2,1,""]},"spatialpy.core.GeometryAll":{inside:[1,2,1,""]},"spatialpy.core.GeometryExterior":{inside:[1,2,1,""]},"spatialpy.core.GeometryInterior":{inside:[1,2,1,""]},"spatialpy.core.InitialCondition":{apply:[1,2,1,""]},"spatialpy.core.KDTree":{count_neighbors:[1,2,1,""],innernode:[1,1,1,""],leafnode:[1,1,1,""],node:[1,1,1,""],query:[1,2,1,""],query_ball_point:[1,2,1,""],query_ball_tree:[1,2,1,""],query_pairs:[1,2,1,""],sparse_distance_matrix:[1,2,1,""]},"spatialpy.core.Model":{add_boundary_condition:[1,2,1,""],add_data_function:[1,2,1,""],add_domain:[1,2,1,""],add_initial_condition:[1,2,1,""],add_parameter:[1,2,1,""],add_reaction:[1,2,1,""],add_species:[1,2,1,""],compile_prep:[1,2,1,""],delete_all_parameters:[1,2,1,""],delete_all_reactions:[1,2,1,""],delete_all_species:[1,2,1,""],delete_parameter:[1,2,1,""],delete_reaction:[1,2,1,""],delete_species:[1,2,1,""],get_all_parameters:[1,2,1,""],get_all_reactions:[1,2,1,""],get_all_species:[1,2,1,""],get_num_reactions:[1,2,1,""],get_num_species:[1,2,1,""],get_parameter:[1,2,1,""],get_reaction:[1,2,1,""],get_species:[1,2,1,""],reserved_names:[1,4,1,""],run:[1,2,1,""],sanitized_data_function_names:[1,2,1,""],sanitized_parameter_names:[1,2,1,""],sanitized_species_names:[1,2,1,""],set_timesteps:[1,2,1,""],special_characters:[1,4,1,""],timespan:[1,2,1,""],update_namespace:[1,2,1,""]},"spatialpy.core.OrderedDict":{clear:[1,2,1,""],copy:[1,2,1,""],fromkeys:[1,2,1,""],items:[1,2,1,""],keys:[1,2,1,""],move_to_end:[1,2,1,""],pop:[1,2,1,""],popitem:[1,2,1,""],setdefault:[1,2,1,""],update:[1,2,1,""],values:[1,2,1,""]},"spatialpy.core.PlaceInitialCondition":{apply:[1,2,1,""]},"spatialpy.core.Reaction":{add_product:[1,2,1,""],add_reactant:[1,2,1,""],annotate:[1,2,1,""],initialize:[1,2,1,""]},"spatialpy.core.Result":{export_to_csv:[1,2,1,""],export_to_vtk:[1,2,1,""],get_property:[1,2,1,""],get_species:[1,2,1,""],get_timespan:[1,2,1,""],plot_property:[1,2,1,""],plot_species:[1,2,1,""],read_step:[1,2,1,""]},"spatialpy.core.ScatterInitialCondition":{apply:[1,2,1,""]},"spatialpy.core.Species":{set_diffusion_coefficient:[1,2,1,""]},"spatialpy.core.UniformInitialCondition":{apply:[1,2,1,""]},"spatialpy.core.VTKReader":{get_array_name:[1,2,1,""],get_arrays:[1,2,1,""],get_num_points:[1,2,1,""],get_points:[1,2,1,""],read_file:[1,2,1,""],set_filename:[1,2,1,""]},"spatialpy.core.boundarycondition":{BoundaryCondition:[1,1,1,""]},"spatialpy.core.boundarycondition.BoundaryCondition":{expression:[1,2,1,""]},"spatialpy.core.cleanup":{cleanup_build_files:[1,5,1,""],cleanup_core_files:[1,5,1,""],cleanup_result_files:[1,5,1,""],cleanup_tempfiles:[1,5,1,""]},"spatialpy.core.datafunction":{DataFunction:[1,1,1,""]},"spatialpy.core.datafunction.DataFunction":{map:[1,2,1,""]},"spatialpy.core.domain":{Domain:[1,1,1,""]},"spatialpy.core.domain.Domain":{add_point:[1,2,1,""],calculate_vol:[1,2,1,""],closest_vertex:[1,2,1,""],compile_prep:[1,2,1,""],coordinates:[1,2,1,""],create_2D_domain:[1,2,1,""],create_3D_domain:[1,2,1,""],distance_between_2_vertices:[1,2,1,""],fill_with_particles:[1,2,1,""],find_boundary_points:[1,2,1,""],find_h:[1,2,1,""],get_bounding_box:[1,2,1,""],get_domain_size:[1,2,1,""],get_num_voxels:[1,2,1,""],get_type_def:[1,2,1,""],get_vol:[1,2,1,""],import_meshio_object:[1,2,1,""],plot_types:[1,2,1,""],read_msh_file:[1,2,1,""],read_stochss_domain:[1,2,1,""],read_stochss_subdomain_file:[1,2,1,""],read_xml_mesh:[1,2,1,""],set_properties:[1,2,1,""]},"spatialpy.core.geometry":{Geometry:[1,1,1,""],GeometryAll:[1,1,1,""],GeometryExterior:[1,1,1,""],GeometryInterior:[1,1,1,""]},"spatialpy.core.geometry.Geometry":{inside:[1,2,1,""]},"spatialpy.core.geometry.GeometryAll":{inside:[1,2,1,""]},"spatialpy.core.geometry.GeometryExterior":{inside:[1,2,1,""]},"spatialpy.core.geometry.GeometryInterior":{inside:[1,2,1,""]},"spatialpy.core.initialcondition":{InitialCondition:[1,1,1,""],PlaceInitialCondition:[1,1,1,""],ScatterInitialCondition:[1,1,1,""],UniformInitialCondition:[1,1,1,""]},"spatialpy.core.initialcondition.InitialCondition":{apply:[1,2,1,""]},"spatialpy.core.initialcondition.PlaceInitialCondition":{apply:[1,2,1,""]},"spatialpy.core.initialcondition.ScatterInitialCondition":{apply:[1,2,1,""]},"spatialpy.core.initialcondition.UniformInitialCondition":{apply:[1,2,1,""]},"spatialpy.core.model":{Model:[1,1,1,""],export_StochSS:[1,5,1,""]},"spatialpy.core.model.Model":{add_boundary_condition:[1,2,1,""],add_data_function:[1,2,1,""],add_domain:[1,2,1,""],add_initial_condition:[1,2,1,""],add_parameter:[1,2,1,""],add_reaction:[1,2,1,""],add_species:[1,2,1,""],compile_prep:[1,2,1,""],delete_all_parameters:[1,2,1,""],delete_all_reactions:[1,2,1,""],delete_all_species:[1,2,1,""],delete_parameter:[1,2,1,""],delete_reaction:[1,2,1,""],delete_species:[1,2,1,""],get_all_parameters:[1,2,1,""],get_all_reactions:[1,2,1,""],get_all_species:[1,2,1,""],get_num_reactions:[1,2,1,""],get_num_species:[1,2,1,""],get_parameter:[1,2,1,""],get_reaction:[1,2,1,""],get_species:[1,2,1,""],reserved_names:[1,4,1,""],run:[1,2,1,""],sanitized_data_function_names:[1,2,1,""],sanitized_parameter_names:[1,2,1,""],sanitized_species_names:[1,2,1,""],set_timesteps:[1,2,1,""],special_characters:[1,4,1,""],timespan:[1,2,1,""],update_namespace:[1,2,1,""]},"spatialpy.core.parameter":{Parameter:[1,1,1,""]},"spatialpy.core.reaction":{Reaction:[1,1,1,""]},"spatialpy.core.reaction.Reaction":{add_product:[1,2,1,""],add_reactant:[1,2,1,""],annotate:[1,2,1,""],initialize:[1,2,1,""]},"spatialpy.core.result":{Result:[1,1,1,""]},"spatialpy.core.result.Result":{export_to_csv:[1,2,1,""],export_to_vtk:[1,2,1,""],get_property:[1,2,1,""],get_species:[1,2,1,""],get_timespan:[1,2,1,""],plot_property:[1,2,1,""],plot_species:[1,2,1,""],read_step:[1,2,1,""]},"spatialpy.core.spatialpyerror":{BoundaryConditionError:[1,3,1,""],DataFunctionError:[1,3,1,""],DomainError:[1,3,1,""],GeometryError:[1,3,1,""],InitialConditionError:[1,3,1,""],ModelError:[1,3,1,""],ParameterError:[1,3,1,""],ReactionError:[1,3,1,""],ResultError:[1,3,1,""],SimulationError:[1,3,1,""],SimulationTimeout:[1,3,1,""],SpeciesError:[1,3,1,""],VTKReaderError:[1,3,1,""],VTKReaderIOError:[1,3,1,""]},"spatialpy.core.species":{Species:[1,1,1,""]},"spatialpy.core.species.Species":{set_diffusion_coefficient:[1,2,1,""]},"spatialpy.core.vtkreader":{VTKReader:[1,1,1,""]},"spatialpy.core.vtkreader.VTKReader":{get_array_name:[1,2,1,""],get_arrays:[1,2,1,""],get_num_points:[1,2,1,""],get_points:[1,2,1,""],read_file:[1,2,1,""],set_filename:[1,2,1,""]},"spatialpy.solvers":{build_expression:[2,0,0,"-"],solver:[2,0,0,"-"]},"spatialpy.solvers.build_expression":{BuildExpression:[2,1,1,""],CppConverter:[2,1,1,""],ExpressionConverter:[2,1,1,""],ExpressionResults:[2,1,1,""],PythonConverter:[2,1,1,""]},"spatialpy.solvers.build_expression.BuildExpression":{ValidationVisitor:[2,1,1,""],getexpr_cpp:[2,2,1,""],getexpr_python:[2,2,1,""],map_operator:[2,2,1,""],operator_map:[2,4,1,""],validate:[2,2,1,""],with_blacklist:[2,2,1,""],with_namespace:[2,2,1,""]},"spatialpy.solvers.build_expression.BuildExpression.ValidationVisitor":{visit_Assign:[2,2,1,""],visit_BinOp:[2,2,1,""],visit_BoolOp:[2,2,1,""],visit_Call:[2,2,1,""],visit_Compare:[2,2,1,""],visit_Name:[2,2,1,""],visit_UnaryOp:[2,2,1,""]},"spatialpy.solvers.build_expression.CppConverter":{CppExpressionTransformer:[2,1,1,""],get_str:[2,2,1,""],visit_And:[2,2,1,""],visit_Or:[2,2,1,""]},"spatialpy.solvers.build_expression.CppConverter.CppExpressionTransformer":{visit_BinOp:[2,2,1,""]},"spatialpy.solvers.build_expression.ExpressionConverter":{convert_str:[2,2,1,""],get_str:[2,2,1,""],parse_comparison:[2,2,1,""],parse_logical:[2,2,1,""],parse_operator:[2,2,1,""],visit_Add:[2,2,1,""],visit_BinOp:[2,2,1,""],visit_BoolOp:[2,2,1,""],visit_Bytes:[2,2,1,""],visit_Call:[2,2,1,""],visit_Compare:[2,2,1,""],visit_Constant:[2,2,1,""],visit_Div:[2,2,1,""],visit_Ellipsis:[2,2,1,""],visit_Eq:[2,2,1,""],visit_Gt:[2,2,1,""],visit_GtE:[2,2,1,""],visit_Lt:[2,2,1,""],visit_LtE:[2,2,1,""],visit_Mult:[2,2,1,""],visit_Name:[2,2,1,""],visit_NameConstant:[2,2,1,""],visit_NotEq:[2,2,1,""],visit_Num:[2,2,1,""],visit_Pow:[2,2,1,""],visit_Str:[2,2,1,""],visit_Sub:[2,2,1,""],visit_USub:[2,2,1,""],visit_UnaryOp:[2,2,1,""]},"spatialpy.solvers.build_expression.PythonConverter":{visit_And:[2,2,1,""],visit_Or:[2,2,1,""]},"spatialpy.solvers.solver":{Solver:[2,1,1,""]},"spatialpy.solvers.solver.Solver":{compile:[2,2,1,""],run:[2,2,1,""]},"spatialpy.stochss":{stochss_export:[3,0,0,"-"]},"spatialpy.stochss.stochss_export":{"export":[3,5,1,""]},spatialpy:{core:[1,0,0,"-"],solvers:[2,0,0,"-"],stochss:[3,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","exception","Python exception"],"4":["py","attribute","Python attribute"],"5":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:exception","4":"py:attribute","5":"py:function"},terms:{"0":[1,2],"04":1,"1":[1,2],"10":1,"10000":1,"11":1,"13":1,"14142136":1,"15":1,"1999":1,"1d":1,"2":1,"20":1,"2000":1,"2015":1,"2019":[0,1,2,3],"2022":[0,1,2,3],"2d":1,"2e9":1,"2r01eb014877":4,"3":[0,1,2,3,4],"300":1,"3d":[1,4],"4":1,"5":1,"500":1,"6":1,"600":1,"7":1,"8":1,"800":1,"9":1,"abstract":[1,2],"byte":2,"case":1,"class":[1,2],"default":1,"do":1,"export":[1,3],"float":1,"function":[1,2],"import":1,"int":[1,2],"long":1,"new":[1,2],"public":[0,1,2,3,4],"return":[1,2,3],"short":4,"static":[1,4],"super":2,"switch":1,"true":[1,2],A:[0,1,2,3,4],And:2,By:[1,2],FOR:[0,1,2,3],For:[1,4],If:[0,1,2,3,4],In:1,It:1,No:1,Not:[1,2],Or:2,The:[1,2,4],These:1,Will:1,_ast:2,abl:1,about:1,absolut:1,acceler:1,accept:2,across:1,action:1,ad:[1,2],add:[1,2],add_boundary_condit:1,add_data_funct:1,add_domain:1,add_initial_condit:1,add_paramet:1,add_point:1,add_product:1,add_react:1,add_speci:1,addit:[1,2],addition:[1,2],addtion:[1,2],advect:[0,1,2,3,4],against:[1,2],algorithm:[1,4],align:1,all:[1,2],allow:2,along:[0,1,2,3],alreadi:1,also:[1,2,4],alwai:2,amount:1,an:[1,2,4],ani:[0,1,2,3,4],anim:1,animation_attribut:1,animation_opt:1,annot:1,append:2,appli:1,approxim:1,ar:[1,2],argument:1,arrai:1,arraid:1,array_lik:1,articl:4,artifici:1,asarrai:1,ascii:1,assign:[1,2],associ:1,assum:2,ast:2,attempt:1,attribut:1,author:4,auto_plai:1,automat:[1,2],autorang:1,avail:[1,2,4],averag:1,axi:1,background:1,bare:2,base:[1,2,4],bass:1,becaus:1,becom:1,been:1,begin:1,behavior:2,best:1,between:[1,2],binari:1,binboolopop:2,binop:2,biochem:1,bitand:2,bitor:2,bitxor:2,blacklist:2,blob:1,blue:1,bodi:1,bogu:1,bool:[1,2,3],boolop:2,both:[1,4],bottom:1,bound:1,bound_cond:1,boundari:1,boundarycondit:0,boundaryconditionerror:1,box:1,branch:1,brian:4,browser:1,brute:1,bugn:1,build:[1,2,4],build_dir:1,build_express:0,buildexpress:2,built:2,bulk:1,bupu:1,c0:1,c:[0,1,2,3],c_:1,calcul:1,calculate_vol:1,call:[1,2],can:[0,1,2,3,4],caus:2,cdn:1,cell:1,charact:1,chart:1,check:[1,2],chemic:1,choos:1,chosen:1,circumradiu:1,ckdtree:1,classmethod:[1,2],cleanup:0,cleanup_build_fil:1,cleanup_core_fil:1,cleanup_result_fil:1,cleanup_tempfil:1,clear:1,close:1,closest:1,closest_vertex:1,cloud:1,code:[1,4],coeffic:1,coeffici:1,collabor:1,collect:1,colormap:1,column:1,com:[1,4],combin:1,compar:[1,2],comparison:2,compil:[1,2],compile_prep:1,comput:1,conain:1,conatain:1,concentr:1,condit:[1,2],config:1,connect:1,consid:1,consol:2,constant:[1,2],construct:1,constructor:2,constuct:1,contact:4,contain:[1,2],content:4,context:2,contian:1,continu:4,convers:2,convert:[1,2,3],convert_str:2,convet:2,coodin:1,coordin:1,copi:[0,1,2,3],copy_numb:1,copyright:[0,1,2,3],core:[0,4],corner:1,correl:1,correspond:[1,2],could:[1,2],count:1,count_neighbor:1,coupl:1,cppconvert:2,cppexpressiontransform:2,creat:[1,2],create_2d_domain:1,create_3d_domain:1,csv:1,current:[1,2],custom:1,cylind:4,cython:1,d:1,data:[1,2],data_funct:1,datafunct:0,datafunctionerror:1,debug:[1,2],debug_level:[1,2],debugg:2,defer:1,defin:[1,2],definit:1,delete_all_paramet:1,delete_all_react:1,delete_all_speci:1,delete_paramet:1,delete_react:1,delete_speci:1,deltai:1,deltax:1,deltaz:1,demo:4,densiti:1,dependency_graph:1,describ:[1,4],descript:1,detail:[0,1,2,3],determinist:[0,1,2,3,4],determinst:1,develop:[0,1,2,3,4],diamet:1,dict:[1,2],dictionari:[1,2],differ:[1,2],diffus:[0,1,2,3,4],diffusion_coeffici:1,dimens:1,dimension:1,direct:1,directli:[1,4],directori:1,displai:1,dissip:4,distanc:1,distance_between_2_vertic:1,distance_upper_bound:1,distribut:[0,1,2,3],div:2,doe:1,doesn:1,dok_matrix:1,dolfin:1,dom:1,domain:[0,4],domainerror:1,domn:1,doubl:1,download:1,dr:4,draw:1,drawert:4,drawn:1,dtype:1,duplic:2,durat:1,dure:[1,2],dynam:4,e:1,each:1,edg:1,edit:1,effect:1,effici:1,either:1,element:1,ellipsi:2,els:1,embed:4,empti:2,end:1,engin:1,ensur:[1,2],enterpris:1,entir:1,entireti:1,ep:1,eq:2,equival:2,error:1,estim:1,euclidean:1,evalu:1,evaul:1,even:[0,1,2,3],evenli:1,exampl:1,exce:1,exceed:[1,2],except:1,execut:[1,2],exist:1,expect:[1,2],explor:1,export_stochss:1,export_to_csv:1,export_to_vtk:1,expres:2,express:[1,2],expressionconvert:2,expressionresult:2,extens:1,extra:1,f:1,f_durat:1,fail:2,fals:[1,2,3],far:2,faster:1,featur:4,fenic:1,fifo:1,figur:1,figure_or_data:1,file:1,filenam:[1,3],fill:[1,4],fill_with_particl:1,find:[1,4],find_boundary_point:1,find_h:1,first:[1,2],fit:[0,1,2,3],fix:1,flag:[1,2],flatten:1,flight:2,floordiv:2,flow:4,fluid:[1,4],folder_nam:1,follow:[1,2],forc:1,form:[1,4],format:1,forward:2,found:[1,2,4],foundat:[0,1,2,3],frame:[1,4],free:[0,1,2,3],frequenc:1,from:[1,2],fromkei:1,fund:4,further:1,furthest:1,g:1,gain:1,gdbgui:2,gener:[0,1,2,3,4],geometr:1,geometri:0,geometry_ivar:1,geometryal:1,geometryerror:1,geometryexterior:1,geometryinterior:1,get:[1,2],get_all_paramet:1,get_all_react:1,get_all_speci:1,get_arrai:1,get_array_nam:1,get_bounding_box:1,get_domain_s:1,get_num_point:1,get_num_react:1,get_num_speci:1,get_num_voxel:1,get_paramet:1,get_point:1,get_properti:1,get_react:1,get_speci:1,get_str:2,get_timespan:1,get_type_def:1,get_vol:1,getexpr_:2,getexpr_cpp:2,getexpr_python:2,github:[1,4],given:[1,2],gmsh:1,gnbu:1,gnu:[0,1,2,3,4],gprof:2,grai:1,grant:4,granular:2,graph:1,graph_obj:1,graph_refer:1,graviti:[1,4],greater:1,greatest:1,green:1,grei:1,gt:2,gte:2,guarante:1,h:1,ha:[1,4],hand:2,handl:2,happen:[1,2],hasn:[1,2],have:[0,1,2,3],height:1,held:1,help:1,here:1,high:1,higher:1,highest:1,hit:1,hope:[0,1,2,3],how:[1,2,4],http:[0,1,2,3,4],hybrid:4,hyperrectangl:1,i:1,id:1,idea:1,ideal:2,idempot:1,identifi:[1,2],idx:1,ignor:1,imag:1,image_height:1,image_width:1,immobil:1,implemenet:1,implement:[1,2],impli:[0,1,2,3],implicit:1,import_meshio_object:1,imposs:2,inch:1,incid:1,includ:1,included_types_list:1,incompat:1,increas:1,increment:2,indec:1,indeci:1,index:[1,4],indic:[1,2],inf:1,infer:2,infin:1,infinit:1,info:1,inform:[1,2,4],inherit:2,init_cond:1,init_notebook_mod:1,initailcondit:1,initi:1,initialcondit:0,initialconditionerror:1,inlin:1,innernod:1,input:1,insert:1,insid:1,instanc:[1,2],instead:1,integ:1,intend:4,intern:1,internet:1,interv:1,invalid:[1,2],invalid_:2,invalid_nam:2,invalid_oper:2,io:1,iplot:1,ipython:1,is_valid:2,item:[1,2],iter:1,its:1,j:1,jacob:4,jet:1,jpeg:1,js:1,json:1,jupyt:1,k:1,kd:1,kdtree:1,kei:[1,2],keyerror:1,keyword:1,kill:1,kth:1,kwarg:1,lack:1,lagrangian:4,larg:1,larger:1,last:[1,2],later:[1,2],latest:4,layout:1,leafnod:1,leafsiz:1,learn:1,leav:1,left:2,legaci:1,length:1,less:1,level:[1,2],li:4,librari:1,licens:[0,1,2,3,4],lifo:1,like:1,limit:1,link:1,link_text:1,list:[1,2],listofparamet:1,listofreact:1,listofspeci:1,listoftyp:1,load:1,local:1,locat:1,logic:2,look:1,lookup:1,lower:1,lowest:1,lshift:2,lt:2,lte:2,ly:1,m:1,mai:1,main:4,make:1,manag:2,maneewongvatana:1,manhattan:1,mani:[1,2],map:[1,2],map_oper:2,margin:1,mark:1,mass:1,master:1,mathemat:[1,2],matmult:2,matplotlib:1,matrix:1,max:1,max_dist:1,maximum:[1,2],mean:1,measur:1,meet:1,megabyt:1,merchant:[0,1,2,3],mesh:1,mesh_obj:1,meshio:1,messag:1,meta:1,method:[1,2],mgrid:1,midpoint:1,min:1,minim:1,minimum:1,minkowski:1,miss:1,mod:2,model:[0,2,3,4],modelerror:1,modelname_mesh:1,modelname_species_:1,modifi:[0,1,2,3],modul:4,molecul:1,moor:1,more:[0,1,2,3,4],most:[1,2],mount:1,move:1,move_to_end:1,movement:1,msh:1,much:1,mult:2,multipl:[1,2],must:1,n:1,name:[1,2],nameconst:2,namespac:[1,2],ndarrai:1,nearbi:1,nearby_point:1,nearer:1,nearest:1,necessarili:1,need:[1,4],neg:1,neighbor:1,nih:4,node:[1,2],nodetransform:2,nodevisitor:2,non:1,none:[1,2,3],nonneg:1,norm:1,notat:1,note:[1,2],notebook:[1,4],noteq:2,np:1,nsm:4,nu:1,num:2,num_step:1,number:[1,2],number_of_thread:[1,2],number_of_trajectori:[1,2],numpi:1,numpoint:1,nx:1,ny:1,nz:1,o:1,obj:1,object:[1,2],od:1,off:1,offlin:1,omit:1,on_boundari:1,one:[1,2],onli:[1,2],onlin:1,open:1,oper:2,operator_map:2,option:1,orang:1,order:1,ordereddict:1,org:[0,1,2,3],origin:2,orrd:1,other:[1,2],otherwis:[1,2],our:4,out:[1,4],outdat:1,output:[1,2],output_interv:1,over:1,overflow:1,overrid:2,overridden:1,p0:1,p:1,p_ndx:1,packag:4,page:[1,4],pair:1,param:1,param_nam:1,param_obj:1,paramet:[0,2,3],parametererror:1,paramt:1,parent:1,pars:2,parse_comparison:2,parse_log:2,parse_oper:2,part:1,partcil:1,particip:1,particl:[1,4],particular:[0,1,2,3],pass:[1,2],path:[1,3],pdf:1,perform:1,petzold:4,physic:4,pii:4,pixel:1,place:1,placeinitialcondit:1,platform:1,pleas:[1,4],plot:1,plot_imag:1,plot_properti:1,plot_speci:1,plot_typ:1,plotli:1,plotly3:1,plt:1,pname:1,png:1,point:1,pop:[1,2],popitem:1,popul:1,posit:1,positon:1,pow:2,pre:2,predict:1,preper:1,present:[1,2],pressur:1,print:[1,2],problem:[0,1,2,3,4],process:2,produc:1,product:1,profil:[1,2],program:[0,1,2,3],project:4,propens:1,propensity_funct:1,properti:[1,2],property_nam:1,proprti:1,prove:4,provid:[1,2,4],prune:1,pt:1,publish:[0,1,2,3],pubu:1,pubugn:1,pull:1,purd:1,purpl:1,purpos:[0,1,2,3],put:1,px:1,py:1,pypi:4,pyplot:1,python:[0,1,2,3,4],pythonconvert:2,pyurdm:4,queri:1,query_ball_point:1,query_ball_tre:1,query_pair:1,question:4,quick:1,r:1,radii:1,radiu:1,rais:[1,2],random:[1,2],randomli:1,rang:1,rapidli:1,rate:1,rather:1,ravel:1,raw:1,rdme:4,rdpu:1,reac:1,reach:1,react_nam:1,react_obj:1,reactant:1,reaction:[0,2,3,4],reactionerror:1,read:1,read_fil:1,read_msh_fil:1,read_step:1,read_stochss_domain:1,read_stochss_subdomain_fil:1,read_xml_mesh:1,reader:1,real:1,reason:1,receiv:[0,1,2,3],recent:[1,2],recurs:1,red:1,redistribut:[0,1,2,3],reevalu:1,refer:1,referenc:1,regardless:1,region:1,regist:4,registr:4,reject:2,rememb:1,remov:1,replac:4,repres:1,represent:[1,2],request:1,requir:1,reserved_nam:1,resolut:1,restrict:1,restrict_to:1,result:[0,2],result_dir:1,resulterror:1,resultserror:1,retreiv:1,retriev:1,return_plotly_figur:1,return_stochss_model:[1,3],rh:1,rho0:1,rho:1,right:[1,2],rname:1,rshift:2,rtype:2,rule:1,run:[1,2],runtimeerror:1,rvalu:2,s0021999118307101:4,s:[1,4],same:1,sampl:1,sanit:2,sanitized_data_function_nam:1,sanitized_parameter_nam:1,sanitized_species_nam:1,save:1,scalar:1,scatter:1,scatterinitialcondit:1,scienc:[1,4],sciencedirect:4,scipi:1,sdpd:[1,4],search:[1,4],second:[1,2],see:[0,1,2,3,4],seed:[1,2],self:[1,2],separ:1,sequenc:1,seri:[1,2],set:[1,2],set_diffusion_coeffici:1,set_filenam:1,set_properti:1,set_timestep:1,setdefault:1,setrecursionlimit:1,setter:1,shallow:1,shape:1,should:[0,1,2,3],show:1,show_link:1,significantli:1,simlat:1,simplifi:1,simul:[0,1,2,3,4],simulationerror:[1,2],simulationtimeout:[1,2],sinc:1,singl:[1,2],size:1,slide:1,smaller:1,smdl:1,smooth:4,sname:1,so:[1,2],softwar:[0,1,2,3,4],solver:[0,1,4],some:1,sort:1,sound:1,sourc:[1,2,3,4],space:1,spactialpi:2,span:1,spars:1,sparse_distance_matrix:1,spatailpy_model:1,spatial:[0,1,2,3,4],spatialpy_build:1,spatialpy_model:[1,3],spatialpy_result:1,spatialpyerror:0,spatialpysolv:1,spayialpi:1,speci:0,special_charact:1,species_nam:1,species_object:1,specieserror:1,specif:1,specifi:1,speed:1,split:1,split_dim:1,src:1,ssa:1,sssa:4,start:[1,2,4],statement:2,statist:1,step:1,step_num:1,stochast:[0,1,2,3,4],stochss:[0,1,4],stochss_export:0,stoichiometr:1,stoichiometri:1,store:1,str:[1,2,3],string:[1,2],struct:2,structur:1,style:1,sub:2,subclass:[1,2],subdomain:1,submodul:0,subpackag:4,substanti:1,substitut:2,success:1,suggest:4,sum:1,suppli:1,support:[1,4],sure:1,svg:1,sy:1,symbol:2,syntax:2,syntaxerror:2,system:[1,4],t:[1,2],t_durat:1,t_ndx:1,t_ndx_list:1,t_val:1,tag:1,take:1,target:[1,2],tempfil:1,term:[0,1,2,3],tetrahedron:1,text:1,than:1,them:1,thi:[0,1,2,3,4],thin:1,those:1,thread:[1,2],time:[1,2],time_span:1,timeout:[1,2],timepoint:1,timespan:1,timestep:1,timestep_s:1,titl:1,token:2,total:1,toth:1,trace:1,tracker:4,trajectori:[1,2],transit:1,travers:1,tree:[1,2],triangl:1,trigger:2,tspan:1,tupl:1,two:[1,2],txt:1,type:[1,2],type_id:1,u0:1,unabl:1,unaryop:2,under:[0,1,2,3,4],uniform:1,uniforminitialcondit:1,union:1,unit:1,univers:2,unnecessari:1,up:1,updat:1,update_namespac:1,upload:1,upon:1,upper:1,urdm:1,us:[0,1,2,3,4],use_matplotlib:1,user:[1,4],usual:1,usub:2,util:1,v1:1,v:1,valid:[1,2],validationvisitor:2,valu:[1,2],vari:1,vector:1,verbos:2,veri:1,version:[0,1,2,3,4],vertex:1,vertic:1,view:1,viewer:1,viscos:1,visit:2,visit_add:2,visit_and:2,visit_assign:2,visit_binop:2,visit_boolop:2,visit_byt:2,visit_cal:2,visit_compar:2,visit_const:2,visit_div:2,visit_ellipsi:2,visit_eq:2,visit_gt:2,visit_lt:2,visit_mult:2,visit_nam:2,visit_nameconst:2,visit_noteq:2,visit_num:2,visit_or:2,visit_pow:2,visit_str:2,visit_sub:2,visit_unaryop:2,visit_usub:2,visitor:2,vol:1,volum:1,voxel:1,vtk:1,vtkreader:0,vtkreadererror:1,vtkreaderioerror:1,wa:1,want:1,warranti:[0,1,2,3],we:[1,4],web:1,webp:1,weir:4,well:2,were:[1,2],what:2,when:[1,2],where:1,whether:[1,2,3],which:[1,2],whose:1,width:1,with_blacklist:2,with_namespac:2,within:1,without:[0,1,2,3],word:1,work:1,wp:1,write:1,write_imag:1,written:1,www:[0,1,2,3,4],x1:1,x2:1,x:1,xaxi:1,xlim:1,xmax:1,xmin:1,xml:1,y:1,yaxi:1,yet:1,yi:4,ylgn:1,ylgnbu:1,ylim:1,ylorbr:1,ylorrd:1,ymax:1,ymin:1,you:[0,1,2,3,4],your:[1,4],z:1,zero:1,zeroth:1,zip:1,zlim:1,zmax:1,zmin:1},titles:["spatialpy package","spatialpy.core package","spatialpy.solvers package","spatialpy.stochss package","Documentation for SpatialPy 1.0"],titleterms:{"0":4,"1":4,api:4,boundarycondit:1,build_express:2,cleanup:1,content:[0,1,2,3],copi:4,core:1,datafunct:1,document:4,domain:1,exampl:4,geometri:1,get:4,indic:4,initialcondit:1,issu:4,model:1,modul:[0,1,2,3],packag:[0,1,2,3],paramet:1,reaction:1,refer:4,report:4,result:1,solver:2,spatialpi:[0,1,2,3,4],spatialpyerror:1,speci:1,stochss:3,stochss_export:3,submodul:[1,2,3],subpackag:0,tabl:4,vtkreader:1}}) \ No newline at end of file +Search.setIndex({docnames:["classes/spatialpy","classes/spatialpy.core","classes/spatialpy.solvers","classes/spatialpy.stochss","index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":4,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.todo":2,"sphinx.ext.viewcode":1,sphinx:56},filenames:["classes/spatialpy.rst","classes/spatialpy.core.rst","classes/spatialpy.solvers.rst","classes/spatialpy.stochss.rst","index.rst"],objects:{"":{spatialpy:[0,0,0,"-"]},"spatialpy.core":{BoundaryCondition:[1,1,1,""],BoundaryConditionError:[1,3,1,""],DataFunction:[1,1,1,""],DataFunctionError:[1,3,1,""],Domain:[1,1,1,""],DomainError:[1,3,1,""],Geometry:[1,1,1,""],GeometryAll:[1,1,1,""],GeometryError:[1,3,1,""],GeometryExterior:[1,1,1,""],GeometryInterior:[1,1,1,""],InitialCondition:[1,1,1,""],InitialConditionError:[1,3,1,""],KDTree:[1,1,1,""],Model:[1,1,1,""],ModelError:[1,3,1,""],OrderedDict:[1,1,1,""],Parameter:[1,1,1,""],ParameterError:[1,3,1,""],PlaceInitialCondition:[1,1,1,""],Reaction:[1,1,1,""],ReactionError:[1,3,1,""],Result:[1,1,1,""],ResultError:[1,3,1,""],ScatterInitialCondition:[1,1,1,""],SimulationError:[1,3,1,""],SimulationTimeout:[1,3,1,""],Species:[1,1,1,""],SpeciesError:[1,3,1,""],UniformInitialCondition:[1,1,1,""],VTKReader:[1,1,1,""],VTKReaderError:[1,3,1,""],VTKReaderIOError:[1,3,1,""],boundarycondition:[1,0,0,"-"],cleanup:[1,0,0,"-"],cleanup_build_files:[1,5,1,""],cleanup_core_files:[1,5,1,""],cleanup_result_files:[1,5,1,""],cleanup_tempfiles:[1,5,1,""],combinations:[1,1,1,""],datafunction:[1,0,0,"-"],domain:[1,0,0,"-"],geometry:[1,0,0,"-"],init_notebook_mode:[1,5,1,""],initialcondition:[1,0,0,"-"],iplot:[1,5,1,""],model:[1,0,0,"-"],parameter:[1,0,0,"-"],reaction:[1,0,0,"-"],result:[1,0,0,"-"],spatialpyerror:[1,0,0,"-"],species:[1,0,0,"-"],vtkreader:[1,0,0,"-"]},"spatialpy.core.BoundaryCondition":{expression:[1,2,1,""]},"spatialpy.core.DataFunction":{map:[1,2,1,""]},"spatialpy.core.Domain":{add_point:[1,2,1,""],calculate_vol:[1,2,1,""],closest_vertex:[1,2,1,""],compile_prep:[1,2,1,""],coordinates:[1,2,1,""],create_2D_domain:[1,2,1,""],create_3D_domain:[1,2,1,""],distance_between_2_vertices:[1,2,1,""],fill_with_particles:[1,2,1,""],find_boundary_points:[1,2,1,""],find_h:[1,2,1,""],get_bounding_box:[1,2,1,""],get_domain_size:[1,2,1,""],get_num_voxels:[1,2,1,""],get_type_def:[1,2,1,""],get_vol:[1,2,1,""],import_meshio_object:[1,2,1,""],plot_types:[1,2,1,""],read_msh_file:[1,2,1,""],read_stochss_domain:[1,2,1,""],read_stochss_subdomain_file:[1,2,1,""],read_xml_mesh:[1,2,1,""],set_properties:[1,2,1,""]},"spatialpy.core.Geometry":{inside:[1,2,1,""]},"spatialpy.core.GeometryAll":{inside:[1,2,1,""]},"spatialpy.core.GeometryExterior":{inside:[1,2,1,""]},"spatialpy.core.GeometryInterior":{inside:[1,2,1,""]},"spatialpy.core.InitialCondition":{apply:[1,2,1,""]},"spatialpy.core.KDTree":{count_neighbors:[1,2,1,""],innernode:[1,1,1,""],leafnode:[1,1,1,""],node:[1,1,1,""],query:[1,2,1,""],query_ball_point:[1,2,1,""],query_ball_tree:[1,2,1,""],query_pairs:[1,2,1,""],sparse_distance_matrix:[1,2,1,""]},"spatialpy.core.Model":{add_boundary_condition:[1,2,1,""],add_data_function:[1,2,1,""],add_domain:[1,2,1,""],add_initial_condition:[1,2,1,""],add_parameter:[1,2,1,""],add_reaction:[1,2,1,""],add_species:[1,2,1,""],compile_prep:[1,2,1,""],delete_all_parameters:[1,2,1,""],delete_all_reactions:[1,2,1,""],delete_all_species:[1,2,1,""],delete_parameter:[1,2,1,""],delete_reaction:[1,2,1,""],delete_species:[1,2,1,""],get_all_parameters:[1,2,1,""],get_all_reactions:[1,2,1,""],get_all_species:[1,2,1,""],get_num_reactions:[1,2,1,""],get_num_species:[1,2,1,""],get_parameter:[1,2,1,""],get_reaction:[1,2,1,""],get_species:[1,2,1,""],reserved_names:[1,4,1,""],run:[1,2,1,""],sanitized_data_function_names:[1,2,1,""],sanitized_parameter_names:[1,2,1,""],sanitized_species_names:[1,2,1,""],set_timesteps:[1,2,1,""],special_characters:[1,4,1,""],timespan:[1,2,1,""],update_namespace:[1,2,1,""]},"spatialpy.core.OrderedDict":{clear:[1,2,1,""],copy:[1,2,1,""],fromkeys:[1,2,1,""],items:[1,2,1,""],keys:[1,2,1,""],move_to_end:[1,2,1,""],pop:[1,2,1,""],popitem:[1,2,1,""],setdefault:[1,2,1,""],update:[1,2,1,""],values:[1,2,1,""]},"spatialpy.core.PlaceInitialCondition":{apply:[1,2,1,""]},"spatialpy.core.Reaction":{add_product:[1,2,1,""],add_reactant:[1,2,1,""],annotate:[1,2,1,""],initialize:[1,2,1,""]},"spatialpy.core.Result":{export_to_csv:[1,2,1,""],get_property:[1,2,1,""],get_species:[1,2,1,""],get_timespan:[1,2,1,""],plot_property:[1,2,1,""],plot_species:[1,2,1,""],read_step:[1,2,1,""]},"spatialpy.core.ScatterInitialCondition":{apply:[1,2,1,""]},"spatialpy.core.Species":{set_diffusion_coefficient:[1,2,1,""]},"spatialpy.core.UniformInitialCondition":{apply:[1,2,1,""]},"spatialpy.core.VTKReader":{get_array_name:[1,2,1,""],get_arrays:[1,2,1,""],get_num_points:[1,2,1,""],get_points:[1,2,1,""],read_file:[1,2,1,""],set_filename:[1,2,1,""]},"spatialpy.core.boundarycondition":{BoundaryCondition:[1,1,1,""]},"spatialpy.core.boundarycondition.BoundaryCondition":{expression:[1,2,1,""]},"spatialpy.core.cleanup":{cleanup_build_files:[1,5,1,""],cleanup_core_files:[1,5,1,""],cleanup_result_files:[1,5,1,""],cleanup_tempfiles:[1,5,1,""]},"spatialpy.core.datafunction":{DataFunction:[1,1,1,""]},"spatialpy.core.datafunction.DataFunction":{map:[1,2,1,""]},"spatialpy.core.domain":{Domain:[1,1,1,""]},"spatialpy.core.domain.Domain":{add_point:[1,2,1,""],calculate_vol:[1,2,1,""],closest_vertex:[1,2,1,""],compile_prep:[1,2,1,""],coordinates:[1,2,1,""],create_2D_domain:[1,2,1,""],create_3D_domain:[1,2,1,""],distance_between_2_vertices:[1,2,1,""],fill_with_particles:[1,2,1,""],find_boundary_points:[1,2,1,""],find_h:[1,2,1,""],get_bounding_box:[1,2,1,""],get_domain_size:[1,2,1,""],get_num_voxels:[1,2,1,""],get_type_def:[1,2,1,""],get_vol:[1,2,1,""],import_meshio_object:[1,2,1,""],plot_types:[1,2,1,""],read_msh_file:[1,2,1,""],read_stochss_domain:[1,2,1,""],read_stochss_subdomain_file:[1,2,1,""],read_xml_mesh:[1,2,1,""],set_properties:[1,2,1,""]},"spatialpy.core.geometry":{Geometry:[1,1,1,""],GeometryAll:[1,1,1,""],GeometryExterior:[1,1,1,""],GeometryInterior:[1,1,1,""]},"spatialpy.core.geometry.Geometry":{inside:[1,2,1,""]},"spatialpy.core.geometry.GeometryAll":{inside:[1,2,1,""]},"spatialpy.core.geometry.GeometryExterior":{inside:[1,2,1,""]},"spatialpy.core.geometry.GeometryInterior":{inside:[1,2,1,""]},"spatialpy.core.initialcondition":{InitialCondition:[1,1,1,""],PlaceInitialCondition:[1,1,1,""],ScatterInitialCondition:[1,1,1,""],UniformInitialCondition:[1,1,1,""]},"spatialpy.core.initialcondition.InitialCondition":{apply:[1,2,1,""]},"spatialpy.core.initialcondition.PlaceInitialCondition":{apply:[1,2,1,""]},"spatialpy.core.initialcondition.ScatterInitialCondition":{apply:[1,2,1,""]},"spatialpy.core.initialcondition.UniformInitialCondition":{apply:[1,2,1,""]},"spatialpy.core.model":{Model:[1,1,1,""],export_StochSS:[1,5,1,""]},"spatialpy.core.model.Model":{add_boundary_condition:[1,2,1,""],add_data_function:[1,2,1,""],add_domain:[1,2,1,""],add_initial_condition:[1,2,1,""],add_parameter:[1,2,1,""],add_reaction:[1,2,1,""],add_species:[1,2,1,""],compile_prep:[1,2,1,""],delete_all_parameters:[1,2,1,""],delete_all_reactions:[1,2,1,""],delete_all_species:[1,2,1,""],delete_parameter:[1,2,1,""],delete_reaction:[1,2,1,""],delete_species:[1,2,1,""],get_all_parameters:[1,2,1,""],get_all_reactions:[1,2,1,""],get_all_species:[1,2,1,""],get_num_reactions:[1,2,1,""],get_num_species:[1,2,1,""],get_parameter:[1,2,1,""],get_reaction:[1,2,1,""],get_species:[1,2,1,""],reserved_names:[1,4,1,""],run:[1,2,1,""],sanitized_data_function_names:[1,2,1,""],sanitized_parameter_names:[1,2,1,""],sanitized_species_names:[1,2,1,""],set_timesteps:[1,2,1,""],special_characters:[1,4,1,""],timespan:[1,2,1,""],update_namespace:[1,2,1,""]},"spatialpy.core.parameter":{Parameter:[1,1,1,""]},"spatialpy.core.reaction":{Reaction:[1,1,1,""]},"spatialpy.core.reaction.Reaction":{add_product:[1,2,1,""],add_reactant:[1,2,1,""],annotate:[1,2,1,""],initialize:[1,2,1,""]},"spatialpy.core.result":{Result:[1,1,1,""]},"spatialpy.core.result.Result":{export_to_csv:[1,2,1,""],get_property:[1,2,1,""],get_species:[1,2,1,""],get_timespan:[1,2,1,""],plot_property:[1,2,1,""],plot_species:[1,2,1,""],read_step:[1,2,1,""]},"spatialpy.core.spatialpyerror":{BoundaryConditionError:[1,3,1,""],DataFunctionError:[1,3,1,""],DomainError:[1,3,1,""],GeometryError:[1,3,1,""],InitialConditionError:[1,3,1,""],ModelError:[1,3,1,""],ParameterError:[1,3,1,""],ReactionError:[1,3,1,""],ResultError:[1,3,1,""],SimulationError:[1,3,1,""],SimulationTimeout:[1,3,1,""],SpeciesError:[1,3,1,""],VTKReaderError:[1,3,1,""],VTKReaderIOError:[1,3,1,""]},"spatialpy.core.species":{Species:[1,1,1,""]},"spatialpy.core.species.Species":{set_diffusion_coefficient:[1,2,1,""]},"spatialpy.core.vtkreader":{VTKReader:[1,1,1,""]},"spatialpy.core.vtkreader.VTKReader":{get_array_name:[1,2,1,""],get_arrays:[1,2,1,""],get_num_points:[1,2,1,""],get_points:[1,2,1,""],read_file:[1,2,1,""],set_filename:[1,2,1,""]},"spatialpy.solvers":{build_expression:[2,0,0,"-"],solver:[2,0,0,"-"]},"spatialpy.solvers.build_expression":{BuildExpression:[2,1,1,""],CppConverter:[2,1,1,""],ExpressionConverter:[2,1,1,""],ExpressionResults:[2,1,1,""],PythonConverter:[2,1,1,""]},"spatialpy.solvers.build_expression.BuildExpression":{ValidationVisitor:[2,1,1,""],getexpr_cpp:[2,2,1,""],getexpr_python:[2,2,1,""],map_operator:[2,2,1,""],operator_map:[2,4,1,""],validate:[2,2,1,""],with_blacklist:[2,2,1,""],with_namespace:[2,2,1,""]},"spatialpy.solvers.build_expression.BuildExpression.ValidationVisitor":{visit_Assign:[2,2,1,""],visit_BinOp:[2,2,1,""],visit_BoolOp:[2,2,1,""],visit_Call:[2,2,1,""],visit_Compare:[2,2,1,""],visit_Name:[2,2,1,""],visit_UnaryOp:[2,2,1,""]},"spatialpy.solvers.build_expression.CppConverter":{CppExpressionTransformer:[2,1,1,""],get_str:[2,2,1,""],visit_And:[2,2,1,""],visit_Or:[2,2,1,""]},"spatialpy.solvers.build_expression.CppConverter.CppExpressionTransformer":{visit_BinOp:[2,2,1,""]},"spatialpy.solvers.build_expression.ExpressionConverter":{convert_str:[2,2,1,""],get_str:[2,2,1,""],parse_comparison:[2,2,1,""],parse_logical:[2,2,1,""],parse_operator:[2,2,1,""],visit_Add:[2,2,1,""],visit_BinOp:[2,2,1,""],visit_BoolOp:[2,2,1,""],visit_Bytes:[2,2,1,""],visit_Call:[2,2,1,""],visit_Compare:[2,2,1,""],visit_Constant:[2,2,1,""],visit_Div:[2,2,1,""],visit_Ellipsis:[2,2,1,""],visit_Eq:[2,2,1,""],visit_Gt:[2,2,1,""],visit_GtE:[2,2,1,""],visit_Lt:[2,2,1,""],visit_LtE:[2,2,1,""],visit_Mult:[2,2,1,""],visit_Name:[2,2,1,""],visit_NameConstant:[2,2,1,""],visit_NotEq:[2,2,1,""],visit_Num:[2,2,1,""],visit_Pow:[2,2,1,""],visit_Str:[2,2,1,""],visit_Sub:[2,2,1,""],visit_USub:[2,2,1,""],visit_UnaryOp:[2,2,1,""]},"spatialpy.solvers.build_expression.PythonConverter":{visit_And:[2,2,1,""],visit_Or:[2,2,1,""]},"spatialpy.solvers.solver":{Solver:[2,1,1,""]},"spatialpy.solvers.solver.Solver":{compile:[2,2,1,""],run:[2,2,1,""]},"spatialpy.stochss":{stochss_export:[3,0,0,"-"]},"spatialpy.stochss.stochss_export":{"export":[3,5,1,""]},spatialpy:{core:[1,0,0,"-"],solvers:[2,0,0,"-"],stochss:[3,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","exception","Python exception"],"4":["py","attribute","Python attribute"],"5":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:exception","4":"py:attribute","5":"py:function"},terms:{"0":[1,2],"04":1,"1":[1,2],"10":1,"10000":1,"11":1,"13":1,"14142136":1,"15":1,"1999":1,"1d":1,"2":1,"20":1,"2000":1,"2015":1,"2019":[0,1,2,3],"2022":[0,1,2,3],"2d":1,"2e9":1,"2r01eb014877":4,"3":[0,1,2,3,4],"300":1,"3d":[1,4],"4":1,"5":1,"500":1,"6":1,"600":1,"7":1,"8":1,"800":1,"9":1,"abstract":[1,2],"byte":2,"case":1,"class":[1,2],"default":1,"do":1,"export":[1,3],"float":1,"function":[1,2],"import":1,"int":[1,2],"long":1,"new":[1,2],"public":[0,1,2,3,4],"return":[1,2,3],"short":4,"static":[1,4],"super":2,"switch":1,"true":[1,2,3],A:[0,1,2,3,4],And:2,By:[1,2],FOR:[0,1,2,3],For:[1,4],If:[0,1,2,3,4],In:1,It:1,No:1,Not:2,Or:2,The:[1,2,4],These:1,Will:1,_ast:2,abl:1,about:1,absolut:1,acceler:1,accept:2,across:1,action:1,ad:[1,2],add:[1,2],add_boundary_condit:1,add_data_funct:1,add_domain:1,add_initial_condit:1,add_paramet:1,add_point:1,add_product:1,add_react:1,add_speci:1,addit:[1,2],addition:[1,2],addtion:[1,2],advect:[0,1,2,3,4],against:[1,2],algorithm:[1,4],align:1,all:[1,2],allow:2,along:[0,1,2,3],alreadi:1,also:[1,2,4],alwai:2,amount:1,an:[1,2,4],ani:[0,1,2,3,4],anim:1,animation_attribut:1,animation_opt:1,annot:1,append:2,appli:1,approxim:1,ar:[1,2],argument:1,arrai:1,arraid:1,array_lik:1,articl:4,artifici:1,asarrai:1,ascii:1,assign:[1,2],associ:1,assum:2,ast:2,attempt:1,attribut:1,author:4,auto_plai:1,automat:[1,2],autorang:1,avail:[1,2,4],averag:1,axi:1,background:1,bare:2,base:[1,2,4],bass:1,becaus:1,becom:1,been:1,begin:1,behavior:2,best:1,between:[1,2],binari:1,binboolopop:2,binop:2,biochem:1,bitand:2,bitor:2,bitxor:2,blacklist:2,blob:1,blue:1,bodi:1,bogu:1,bool:[1,2,3],boolop:2,both:[1,4],bottom:1,bound:1,bound_cond:1,boundari:1,boundarycondit:0,boundaryconditionerror:1,box:1,branch:1,brian:4,browser:1,brute:1,bugn:1,build:[1,2,4],build_dir:1,build_express:0,buildexpress:2,built:2,bulk:1,bupu:1,bvf_phi:1,c0:1,c:[0,1,2,3],c_:1,calcul:1,calculate_vol:1,call:[1,2],can:[0,1,2,3,4],caus:2,cdn:1,cell:1,charact:1,chart:1,check:[1,2],chemic:1,choos:1,chosen:1,circumradiu:1,ckdtree:1,classmethod:[1,2],cleanup:0,cleanup_build_fil:1,cleanup_core_fil:1,cleanup_result_fil:1,cleanup_tempfil:1,clear:1,close:1,closest:1,closest_vertex:1,cloud:1,code:[1,4],coeffic:1,coeffici:1,collabor:1,colormap:1,column:1,com:[1,4],combin:1,compar:[1,2],comparison:2,compil:[1,2],compile_prep:1,comput:1,conain:1,conatain:1,concentr:1,condit:[1,2],config:1,connect:1,consid:1,consol:2,constant:[1,2],construct:1,constructor:2,constuct:1,contact:4,contain:[1,2],content:4,context:2,contian:1,continu:4,convers:2,convert:[1,2,3],convert_str:2,convet:2,coodin:1,coordin:1,copi:[0,1,2,3],copy_numb:1,copyright:[0,1,2,3],core:[0,2,3,4],corner:1,correl:1,correspond:[1,2],could:[1,2],count:1,count_neighbor:1,coupl:1,cppconvert:2,cppexpressiontransform:2,cradded:1,creat:[1,2],create_2d_domain:1,create_3d_domain:1,csv:1,current:[1,2],custom:1,cylind:4,cython:1,d:1,data:[1,2],data_funct:1,datafunct:0,datafunctionerror:1,debug:[1,2],debug_level:[1,2],debugg:2,defer:1,defin:[1,2],definit:1,delete_all_paramet:1,delete_all_react:1,delete_all_speci:1,delete_paramet:1,delete_react:1,delete_speci:1,deltai:1,deltax:1,deltaz:1,demo:4,densiti:1,dependency_graph:1,describ:[1,4],descript:1,detail:[0,1,2,3],determinist:[0,1,2,3,4],determinst:1,develop:[0,1,2,3,4],diamet:1,dict:[1,2,3],dictionari:[1,2],differ:[1,2],diffus:[0,1,2,3,4],diffusion_coeffici:1,dimens:1,dimension:1,direct:1,directli:[1,4],directori:1,displai:1,dissip:4,distanc:1,distance_between_2_vertic:1,distance_upper_bound:1,distribut:[0,1,2,3],div:2,doe:1,doesn:1,dok_matrix:1,dolfin:1,dom:1,domain:[0,4],domainerror:1,domn:1,download:1,dr:4,draw:1,drawert:4,drawn:1,dtype:1,duplic:2,durat:1,dure:[1,2],dynam:4,e:1,each:1,edg:1,edit:1,effect:1,effici:1,either:1,element:1,ellipsi:2,els:[1,3],embed:4,empti:2,end:1,engin:1,ensur:[1,2],enterpris:1,entir:1,entireti:1,ep:1,eq:2,equival:2,error:1,estim:1,euclidean:1,evalu:1,evaul:1,even:[0,1,2,3],evenli:1,exampl:1,exce:1,exceed:[1,2],except:1,execut:[1,2],exist:1,expect:[1,2],explor:1,export_stochss:1,export_to_csv:1,expres:2,express:[1,2],expressionconvert:2,expressionresult:2,extens:1,extra:1,f:1,f_durat:1,fail:2,fals:[1,2,3],far:2,faster:1,featur:4,fenic:1,fifo:1,figur:1,figure_or_data:1,file:[1,3],filenam:[1,3],fill:[1,4],fill_with_particl:1,find:[1,4],find_boundary_point:1,find_h:1,first:[1,2],fit:[0,1,2,3],fix:1,flag:[1,2],flatten:1,flight:2,floordiv:2,flow:4,fluid:[1,4],folder_nam:1,follow:[1,2],forc:1,form:[1,4],format:1,forward:2,found:[1,2,4],foundat:[0,1,2,3],fraction:1,frame:[1,4],free:[0,1,2,3],frequenc:1,from:[1,2],fromkei:1,fund:4,further:1,furthest:1,g:1,gain:1,gdbgui:2,gener:[0,1,2,3,4],geometr:1,geometri:0,geometry_ivar:1,geometryal:1,geometryerror:1,geometryexterior:1,geometryinterior:1,get:[1,2],get_all_paramet:1,get_all_react:1,get_all_speci:1,get_arrai:1,get_array_nam:1,get_bounding_box:1,get_domain_s:1,get_num_point:1,get_num_react:1,get_num_speci:1,get_num_voxel:1,get_paramet:1,get_point:1,get_properti:1,get_react:1,get_speci:1,get_str:2,get_timespan:1,get_type_def:1,get_vol:1,getexpr_:2,getexpr_cpp:2,getexpr_python:2,github:[1,4],given:[1,2],gmsh:1,gnbu:1,gnu:[0,1,2,3,4],gprof:2,grai:1,grant:4,granular:2,graph:1,graph_obj:1,graph_refer:1,graviti:[1,4],greater:1,greatest:1,green:1,grei:1,gt:2,gte:2,guarante:1,h:1,ha:[1,4],hand:2,handl:2,happen:[1,2],hasn:[1,2],have:[0,1,2,3],height:1,held:1,help:1,here:[1,4],high:1,higher:1,highest:1,hit:1,hope:[0,1,2,3],how:[1,2,4],http:[0,1,2,3,4],hybrid:4,hyperrectangl:1,i:1,id:1,idea:1,ideal:2,idempot:1,identifi:[1,2],idx:1,ignor:1,imag:1,image_height:1,image_width:1,immobil:1,implemenet:1,implement:[1,2],impli:[0,1,2,3],import_meshio_object:1,imposs:2,inch:1,incid:1,includ:1,included_types_list:1,incompat:1,increas:1,increment:2,indec:1,indeci:1,index:[1,4],indic:[1,2],inf:1,infer:2,infin:1,infinit:1,info:1,inform:[1,2,4],inherit:2,init_cond:1,init_notebook_mod:1,initailcondit:1,initi:1,initialcondit:0,initialconditionerror:1,inlin:1,innernod:1,input:1,insert:1,insid:1,instanc:[1,2],instead:1,integ:1,intend:4,intern:1,internet:1,interv:1,invalid:[1,2],invalid_:2,invalid_nam:2,invalid_oper:2,io:1,iplot:1,ipython:1,is_valid:2,item:[1,2],iter:1,its:1,j:1,jacob:4,jet:1,jpeg:1,js:1,json:1,jupyt:1,k:1,kd:1,kdtree:1,kei:[1,2],keyerror:1,keyword:1,kill:1,kth:1,kwarg:1,lack:1,lagrangian:4,larg:1,larger:1,last:[1,2],later:[1,2],latest:4,layout:1,leafnod:1,leafsiz:1,learn:1,leav:1,left:2,legaci:1,length:1,less:1,level:[1,2],li:4,librari:1,licens:[0,1,2,3,4],lifo:1,like:1,limit:1,link:1,link_text:1,list:[1,2],listofparamet:1,listofreact:1,listofspeci:1,listoftyp:1,load:1,local:1,locat:1,logic:2,look:1,lookup:1,lower:1,lowest:1,lshift:2,lt:2,lte:2,ly:1,m:1,mai:1,main:4,make:1,manag:2,maneewongvatana:1,manhattan:1,mani:[1,2],map:[1,2],map_oper:2,margin:1,mark:1,mass:1,master:1,mathemat:[1,2],matmult:2,matplotlib:1,matrix:1,max:1,max_dist:1,maximum:[1,2],mean:1,measur:1,meet:1,megabyt:1,merchant:[0,1,2,3],mesh:1,mesh_obj:1,meshio:1,messag:1,meta:1,method:[1,2],mgrid:1,midpoint:1,min:1,minim:1,minimum:1,minkowski:1,miss:1,mod:2,model:[0,2,3,4],modelerror:1,modelname_mesh:1,modelname_species_:1,modifi:[0,1,2,3],modul:4,moor:1,more:[0,1,2,3,4],most:[1,2],mount:1,move:1,move_to_end:1,movement:1,msh:1,much:1,mult:2,multipl:[1,2],must:1,n:1,name:[1,2],nameconst:2,namespac:[1,2],ndarrai:1,nearbi:1,nearby_point:1,nearer:1,nearest:1,necessarili:1,need:[1,4],neg:1,neighbor:1,nih:4,node:[1,2],nodetransform:2,nodevisitor:2,non:1,none:[1,2,3],nonneg:1,norm:1,notat:1,note:[1,2],notebook:[1,4],noteq:2,np:1,nsm:4,nu:1,num:2,num_step:1,number:[1,2],number_of_thread:[1,2],number_of_trajectori:[1,2],numpi:1,numpoint:1,nx:1,ny:1,nz:1,o:1,obj:1,object:[1,2],od:1,off:1,offlin:1,omit:1,on_boundari:1,one:[1,2],onli:[1,2],onlin:1,open:1,oper:2,operator_map:2,option:1,orang:1,order:1,ordereddict:1,org:[0,1,2,3],origin:2,orrd:1,other:[1,2],otherwis:[1,2],our:4,out:[1,4],outdat:1,output:[1,2],output_interv:1,over:1,overflow:1,overrid:2,overridden:1,p0:1,p:1,p_ndx:1,packag:4,page:[1,4],pair:1,param:1,param_nam:1,param_obj:1,paramet:[0,2,3],parametererror:1,paramt:1,parent:1,pars:2,parse_comparison:2,parse_log:2,parse_oper:2,part:1,partcil:1,particip:1,particl:[1,4],particular:[0,1,2,3],pass:[1,2],path:[1,3],pdf:1,perform:1,petzold:4,physic:4,pii:4,pixel:1,place:1,placeinitialcondit:1,platform:1,pleas:[1,4],plot:1,plot_imag:1,plot_properti:1,plot_speci:1,plot_typ:1,plotli:1,plotly3:1,plt:1,pname:1,png:1,point:1,pop:[1,2],popitem:1,popul:1,posit:1,positon:1,pow:2,pre:2,predict:1,preper:1,present:[1,2],pressur:1,print:[1,2],problem:[0,1,2,3,4],process:2,produc:1,product:1,profil:[1,2],program:[0,1,2,3],project:4,propens:1,propensity_funct:1,properti:[1,2],property_nam:1,proprti:1,prove:4,provid:[1,2,4],prune:1,pt:1,publish:[0,1,2,3],pubu:1,pubugn:1,pull:1,purd:1,purpl:1,purpos:[0,1,2,3],put:1,px:1,py:1,pypi:4,pyplot:1,python:[0,1,2,3,4],pythonconvert:2,pyurdm:4,queri:1,query_ball_point:1,query_ball_tre:1,query_pair:1,question:4,quick:1,r:1,radii:1,radiu:1,rais:[1,2],random:[1,2],randomli:1,rang:1,rapidli:1,rate:1,rather:1,ravel:1,raw:1,rdme:4,rdpu:1,re:1,reac:1,reach:1,react_nam:1,react_obj:1,reactant:1,reaction:[0,2,3,4],reactionerror:1,read:1,read_fil:1,read_msh_fil:1,read_step:1,read_stochss_domain:1,read_stochss_subdomain_fil:1,read_xml_mesh:1,reader:1,real:1,reason:1,receiv:[0,1,2,3],recent:[1,2],recurs:1,red:1,redistribut:[0,1,2,3],refer:1,referenc:1,regardless:1,region:1,regist:4,registr:4,reject:2,rememb:1,remov:1,replac:4,repres:1,represent:[1,2],request:1,requir:1,reserved_nam:1,resolut:1,restrict:1,restrict_to:1,result:[0,2],result_dir:1,resulterror:1,retreiv:1,retriev:1,return_plotly_figur:1,return_stochss_model:[1,3],rho0:1,rho:1,right:[1,2],rname:1,rshift:2,rtype:2,rule:1,run:[1,2],runtimeerror:1,rvalu:2,s0021999118307101:4,s:[1,4],same:1,sampl:1,sanit:2,sanitized_data_function_nam:1,sanitized_parameter_nam:1,sanitized_species_nam:1,save:1,scalar:1,scatter:1,scatterinitialcondit:1,scienc:[1,4],sciencedirect:4,scipi:1,sdpd:[1,4],search:[1,4],second:[1,2],see:[0,1,2,3,4],seed:[1,2],self:[1,2],separ:1,sequenc:1,seri:[1,2],set:[1,2],set_diffusion_coeffici:1,set_filenam:1,set_properti:1,set_timestep:1,setdefault:1,setrecursionlimit:1,setter:1,shallow:1,shape:1,should:[0,1,2,3],show:1,show_link:1,significantli:1,simlat:1,simplifi:1,simul:[0,1,2,3,4],simulationerror:[1,2],simulationtimeout:[1,2],sinc:1,singl:[1,2],size:1,slide:1,smaller:1,smdl:1,smooth:4,sname:1,so:[1,2],softwar:[0,1,2,3,4],solver:[0,1,4],some:1,sort:1,sound:1,sourc:[1,2,3,4],space:1,spactialpi:2,span:1,spars:1,sparse_distance_matrix:1,spatial:[0,1,2,3,4],spatialpy_build:1,spatialpy_model:1,spatialpy_result:1,spatialpyerror:0,spatialpysolv:1,speci:0,special_charact:1,species_nam:1,species_object:1,specieserror:1,specif:1,specifi:1,speed:1,split:1,split_dim:1,src:1,ssa:1,sssa:4,start:[1,2,4],statement:2,statist:1,step:1,step_num:1,stochast:[0,1,2,3,4],stochss:[0,1,4],stochss_export:0,stoichiometr:1,stoichiometri:1,store:1,str:[1,2,3],string:[1,2],struct:2,structur:1,style:1,sub:2,subclass:[1,2],subdomain:1,submodul:0,subpackag:4,substanti:1,substitut:2,success:1,suggest:4,sum:1,suppli:1,support:[1,4],sure:1,svg:1,sy:1,symbol:2,syntax:2,syntaxerror:2,system:[1,4],t:[1,2],t_durat:1,t_ndx:1,t_ndx_list:1,t_val:1,tag:1,take:1,target:[1,2],tempfil:1,term:[0,1,2,3],tetrahedron:1,text:1,than:1,them:1,thi:[0,1,2,3,4],thin:1,those:1,thread:[1,2],time:[1,2],time_span:1,timeout:[1,2],timepoint:1,timespan:1,timestep:1,timestep_s:1,titl:1,token:2,total:1,toth:1,trace:1,tracker:4,trajectori:[1,2],transit:1,travers:1,tree:[1,2],triangl:1,trigger:2,tspan:1,tupl:1,two:[1,2],txt:1,type:[1,2,3],type_id:1,u0:1,unabl:1,unaryop:2,under:[0,1,2,3,4],uniform:1,uniforminitialcondit:1,union:1,univers:2,unnecessari:1,up:1,updat:1,update_namespac:1,upload:1,upon:1,upper:1,urdm:1,us:[0,1,2,3,4],use_matplotlib:1,user:[1,4],usual:1,usub:2,util:1,v1:1,v:1,valid:[1,2],validationvisitor:2,valu:[1,2],vari:1,veloc:1,verbos:2,veri:1,version:[0,1,2,3,4],vertex:1,vertic:1,view:1,viewer:1,viscos:1,visit:2,visit_add:2,visit_and:2,visit_assign:2,visit_binop:2,visit_boolop:2,visit_byt:2,visit_cal:2,visit_compar:2,visit_const:2,visit_div:2,visit_ellipsi:2,visit_eq:2,visit_gt:2,visit_lt:2,visit_mult:2,visit_nam:2,visit_nameconst:2,visit_noteq:2,visit_num:2,visit_or:2,visit_pow:2,visit_str:2,visit_sub:2,visit_unaryop:2,visit_usub:2,visitor:2,vol:1,volum:1,voxel:1,vtk:1,vtkreader:0,vtkreadererror:1,vtkreaderioerror:1,wa:1,want:1,warranti:[0,1,2,3],we:[1,4],web:1,webp:1,weir:4,well:2,were:[1,2],what:2,when:[1,2],where:1,whether:[1,2,3],which:[1,2],whose:1,width:1,with_blacklist:2,with_namespac:2,within:1,without:[0,1,2,3],work:1,wp:1,write:1,write_imag:1,written:1,www:[0,1,2,3,4],x1:1,x2:1,x:1,xaxi:1,xlim:1,xmax:1,xmin:1,xml:1,y:1,yaxi:1,yet:1,yi:4,ylgn:1,ylgnbu:1,ylim:1,ylorbr:1,ylorrd:1,ymax:1,ymin:1,you:[0,1,2,3,4],your:[1,4],z:1,zero:1,zeroth:1,zip:1,zlim:1,zmax:1,zmin:1},titles:["spatialpy package","spatialpy.core package","spatialpy.solvers package","spatialpy.stochss package","Documentation for SpatialPy 1.0"],titleterms:{"0":4,"1":4,api:4,boundarycondit:1,build_express:2,cleanup:1,content:[0,1,2,3],copi:4,core:1,datafunct:1,document:4,domain:1,exampl:4,geometri:1,get:4,indic:4,initialcondit:1,issu:4,model:1,modul:[0,1,2,3],packag:[0,1,2,3],paramet:1,reaction:1,refer:4,report:4,result:1,solver:2,spatialpi:[0,1,2,3,4],spatialpyerror:1,speci:1,stochss:3,stochss_export:3,submodul:[1,2,3],subpackag:0,tabl:4,vtkreader:1}}) \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index ef9b1b78..33060207 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -20,7 +20,7 @@ The latest version of SpatialPy can be found on `PyPI `_ for more information on how to build and simulate your models with SpatialPy. For an example of how to use SpatialPy to simulate a spatial stochastic reaction-diffusion system, see the `3D Cylinder Demo `_. We also provide examples of how to use SpatialPy to simulate physics (`Gravity Demo `_) and fluid flow (`Weir Model `_). +See our `Example Notebook - Start Here `_ for more information on how to build and simulate your models with SpatialPy. For an example of how to use SpatialPy to simulate a spatial stochastic reaction-diffusion system, see the `3D Cylinder Demo `_. We also provide examples of how to use SpatialPy to simulate physics (`Gravity Demo `_) and fluid flow (`Weir Model `_). Reporting Issues diff --git a/spatialpy/core/boundarycondition.py b/spatialpy/core/boundarycondition.py index 55fb0bd0..c66579d2 100644 --- a/spatialpy/core/boundarycondition.py +++ b/spatialpy/core/boundarycondition.py @@ -31,7 +31,7 @@ class BoundaryCondition(): - type_id: type (subdomain) of the partciles Targets (one of the following must be set): property: (str), 'nu', 'rho','v' - species: (str) name of a chemical species. + species: (str) name of a chemical species. \ Must also set deterministic=True/False flag. :param xmin: x-axis coordinate lower bound of **condition** @@ -59,7 +59,7 @@ class BoundaryCondition(): and applies to deterministic simulation. **BoundaryCondition not yet implemeneted for Stochastic Species**. :type deterministic: bool - :param target: Set **target** to properties, can be 'nu' 'rho' or 'v' or species name + :param target: Set **target** to properties, can be 'nu' 'rho' or 'v' or species name \ If species name, determinstic must also be set to True/False. :type target: str @@ -67,7 +67,7 @@ class BoundaryCondition(): :type value: float or float[3] :param model: Target model of boundary condition - :type model: spatialpy.Model.Model + :type model: spatialpy.core.model.Model """ def __init__(self, xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, diff --git a/spatialpy/core/datafunction.py b/spatialpy/core/datafunction.py index f63b375f..a926fc5d 100644 --- a/spatialpy/core/datafunction.py +++ b/spatialpy/core/datafunction.py @@ -23,6 +23,8 @@ class DataFunction(): :param name: Name of the Data Function. :type name: str + + :raises DataFunctionError: If a name is not provided. """ def __init__(self, name=None): @@ -35,11 +37,11 @@ def map(self, point): """ This method must be overridden by the DataFunction subclass. - NOTE: The spatial location is evaulated at t=0 and is not - reevaluated as the fluid domain moves over time. + NOTE: The spatial location is evaulated at t=0 and is not \ + re-evaluated as the fluid domain moves over time. - :param point: The x,y,z position - :type point: vector of 3 doubles + :param point: The x, y, z position. + :type point: float[3] :returns: Value of function at this spatial location. :rtype: float diff --git a/spatialpy/core/domain.py b/spatialpy/core/domain.py index 27e6445a..b6c763de 100644 --- a/spatialpy/core/domain.py +++ b/spatialpy/core/domain.py @@ -37,13 +37,13 @@ class Domain(): :type numpoints: int :param xlim: Range of domain along x-axis - :type xlim: tuple(float) + :type xlim: float(2) :param ylim: Range of domain along y-axis - :type ylim: tuple(float) + :type ylim: float(2) :param zlim: Range of domain along z-axis - :type zlim: tuple(float) + :type zlim: float(2) :param rho: Background density for the system :type rho: float @@ -55,7 +55,7 @@ class Domain(): :type P0: float :param gravity: Acceleration of gravity for the system. - :type species: float + :type gravity: float[3] """ def __init__(self, numpoints, xlim, ylim, zlim, rho0=1.0, c0=10, P0=None, gravity=None): self.vertices = numpy.zeros((numpoints, 3), dtype=float) @@ -132,10 +132,10 @@ def get_type_def(self, type_id): def compile_prep(self): """ - Generate the domain list of type ids and check for invalid type_ids and rho values + Generate the domains list of type ids and check for invalid type_ids and rho values in preperation of compiling the simulation files. - :raises DomainError: If a type_id is not set or rh for a particle is 0. + :raises DomainError: If a type_id is not set or rho=0 for a particle. """ if self.type_id.tolist().count(None) > 0: raise DomainError(f"Particles must be assigned a type_id.") @@ -150,7 +150,7 @@ def add_point(self, point, vol=0, mass=0, type_id=1, nu=0, fixed=False, rho=None Add a single point particle to the domain space. :param point: Spatial coordinate vertices of point to be added - :type point: tuple(float, float, float) or tuple(float, float) + :type point: float(3) :param vol: Default volume of particle to be added :type vol: float @@ -158,19 +158,19 @@ def add_point(self, point, vol=0, mass=0, type_id=1, nu=0, fixed=False, rho=None :param mass: Default mass of particle to be added :type mass: float - :param type_id: Particle type ID of particle to be created + :param type_id: Particle type ID of particle to be craddedeated :type type_id: str | int - :param nu: Default viscosity of particle to be created + :param nu: Default viscosity of particle to be added :type nu: float :param fixed: True if particle is spatially fixed, else False :type fixed: bool - :param c: Default artificial speed of sound of particle to be created + :param c: Default artificial speed of sound of particle to be added :type c: float - :param rho: Default density of particle to be created + :param rho: Default density of particle to be added :type rho: float :raises DomainError: Type_id is 0 or type_id contains an invalid character. @@ -204,9 +204,9 @@ def set_properties(self, geometry_ivar, type_id, vol=None, mass=None, nu=None, r """ Add a type definition to the domain. By default, all regions are set to type 0. - :param geometry_ivar: an instance of a 'spatialpy.Geometry' subclass. The 'inside()' method + :param geometry_ivar: an instance of a :py:class:`spatialpy.core.geometry.Geometry` subclass. The 'inside()' method of this object will be used to assign properties to points. - :type geometry_ivar: spatialpy.Geometry.Geometry + :type geometry_ivar: spatialpy.core.geometry.Geometry :param type_id: The identifier for this type. :type type_id: str | int @@ -270,9 +270,9 @@ def fill_with_particles(self, geometry_ivar, deltax, deltay=None, deltaz=None, x """ Fill a geometric shape with particles. - :param geometry_ivar: an instance of a 'spatialpy.Geometry' subclass. The 'inside()' method + :param geometry_ivar: an instance of a :py:class:`spatialpy.core.geometry.Geometry` subclass. The 'inside()' method of this object will be used to create add the particles. - :type geometry_ivar: spatialpy.geometry.Geometry + :type geometry_ivar: spatialpy.core.geometry.Geometry :param deltax: Distance between particles on the x-axis. :type deltax: float @@ -301,8 +301,7 @@ def fill_with_particles(self, geometry_ivar, deltax, deltay=None, deltaz=None, x :param zmax: Maximum z value of the bounding box (defaults to Domain.zlim[1]). :type zmax: float - :param kwargs: Key word arguments for Domain.add_point. - :type kwargs: dict + :param \**kwargs: Additional keyword arguments passed to :py:meth:`Domain.add_point`. :returns: The number of particles that were created within this geometry. :rtype: int @@ -416,10 +415,10 @@ def distance_between_2_vertices(self, start, end): Get distance between 2 domain vertices. :param start: Starting point - :type start: tuple(float, float, float) or tuple(float, float) + :type start: float(3) :param end: Ending point - :type end: tuple(float, float, float) or tuple(float, float) + :type end: float(2) :returns: a distance measurement between start and end point :rtype: float @@ -431,10 +430,10 @@ def closest_vertex(self, point): Find the nearest vertex of a given point in the domain. :param point: Target source point - :type point: tuple(float, float, float) or tuple(float, float) + :type point: float(3) :returns: The coordinates of the nearest vertex to the source point. - :rtype: tuple(float, float, float) or tuple(float, float) + :rtype: float(3) """ min_dist = None min_vtx = None @@ -652,7 +651,7 @@ def read_xml_mesh(cls, filename): :type filename: str :returns: SpatialPy Domain object created from xml mesh. - :rtype: spatialpy.Domain.Domain + :rtype: spatialpy.core.domain.Domain """ root = ET.parse(filename).getroot() if not root.tag == 'dolfin': @@ -705,7 +704,7 @@ def import_meshio_object(cls, mesh_obj): :type mesh_obj: meshio.Mesh :returns: SpatialPy Domain object created from the meshio object - :rtype: spatialpy.Domain.Domain + :rtype: spatialpy.core.domain.Domain """ # create domain object xlim = (min(mesh_obj.points[:, 0]), max(mesh_obj.points[:, 0])) @@ -742,7 +741,7 @@ def read_msh_file(cls, filename): :type filename: str :returns: SpatialPy Domain object created from the mesh file. - :rtype: spatialpy.Domain.Domain + :rtype: spatialpy.core.domain.Domain """ try: import meshio # pylint: disable=import-outside-toplevel @@ -789,7 +788,7 @@ def read_stochss_domain(cls, filename): :type filename: str :returns: SpatialPy Domain object created from StochSS domain. - :rtype: spatialpy.Domain.Domain + :rtype: spatialpy.core.domain.Domain """ try: with open(filename, "r", encoding="utf-8") as domain_file: @@ -825,13 +824,13 @@ def create_3D_domain(cls, xlim, ylim, zlim, nx, ny, nz, type_id=1, mass=1.0, Create a filled 3D domain :param xlim: highest and lowest coordinate in the x dimension - :type xlim: tuple(float, float) + :type xlim: float(2) :param ylim: highest and lowest coordinate in the y dimension - :type ylim: tuple(float, float) + :type ylim: float(2) :param zlim: highest and lowest coordinate in the z dimension - :type zlim: tuple(float, float) + :type zlim: float(2) :param nx: number of particle spacing in the x dimension :type nx: int @@ -855,22 +854,15 @@ def create_3D_domain(cls, xlim, ylim, zlim, nx, ny, nz, type_id=1, mass=1.0, :type c: float :param rho: default density of particles to be created. - :type rho: + :type rho: float :param fixed: spatially fixed flag of particles to be created. Defaults to false. :type fixed: bool - :param rho0: background density for the system. Defaults to 1.0 - :type rho0: float - - :param c0: speed of sound for the system. Defaults to 10 - :type c0: float - - :param P0: background pressure for the system. Defaults to 10 - :type P0: float - + :param \**kwargs: Additional keyword arguments passed to :py:class:`Domain`. + :returns: Uniform 3D SpatialPy Domain object. - :rtype: spatialpy.Domain.Domain + :rtype: spatialpy.core.domain.Domain """ # Create domain object numberparticles = nx * ny * nz @@ -897,10 +889,10 @@ def create_2D_domain(cls, xlim, ylim, nx, ny, type_id=1, mass=1.0, Create a filled 2D domain :param xlim: highest and lowest coordinate in the x dimension - :type xlim: tuple(float, float) + :type xlim: float(2) :param ylim: highest and lowest coordinate in the y dimension - :type ylim: tuple(float, float) + :type ylim: float(2) :param nx: number of particle spacing in the x dimension :type nx: int @@ -921,22 +913,15 @@ def create_2D_domain(cls, xlim, ylim, nx, ny, type_id=1, mass=1.0, :type c: float :param rho: default density of particles to be created. - :type rho: + :type rho: float :param fixed: spatially fixed flag of particles to be created. Defaults to false. :type fixed: bool - :param rho0: background density for the system. Defaults to 1.0 - :type rho0: float - - :param c0: speed of sound for the system. Defaults to 10 - :type c0: float - - :param P0: background pressure for the system. Defaults to 10 - :type P0: float + :param \**kwargs: Additional keyword arguments passed to :py:class:`Domain`. :returns: Uniform 2D SpatialPy Domain object. - :rtype: spatialpy.Domain.Domain + :rtype: spatialpy.core.domain.Domain """ # Create domain object numberparticles = nx * ny diff --git a/spatialpy/core/geometry.py b/spatialpy/core/geometry.py index b94a9ace..ee3e7aa5 100644 --- a/spatialpy/core/geometry.py +++ b/spatialpy/core/geometry.py @@ -57,7 +57,7 @@ def inside(self, point, on_boundary): class GeometryExterior(Geometry): """ Mark particles that are on the edge of the domain. - only works for meshes that define triangles and tetrahedrons. + only works for domains that define triangles and tetrahedrons. """ def inside(self, point, on_boundary): """ @@ -75,7 +75,7 @@ def inside(self, point, on_boundary): class GeometryInterior(Geometry): """ Mark particles that are not on the edge of the domain. - Only works for meshes that define triangles and tetrahedrons. + Only works for domains that define triangles and tetrahedrons. """ def inside(self, point, on_boundary): """ diff --git a/spatialpy/core/initialcondition.py b/spatialpy/core/initialcondition.py index 40b1cc67..f3cb505d 100644 --- a/spatialpy/core/initialcondition.py +++ b/spatialpy/core/initialcondition.py @@ -23,11 +23,14 @@ class InitialCondition(): """ Class used to defined initial conditions in SpatialPy. SubClasses must implement the 'apply(model)' method, which - direction modifies the model.u0[species,voxel] matrix. + direction modifies the model.u0[species, voxel] matrix. """ def apply(self, model): """ Set the initial condition of the species to the count. + + :param model: Model contianing the target species. + :type model: spatialpy.core.model.Model """ raise InitialConditionError("spatialpy.InitialCondition subclasses must implement apply()") @@ -36,7 +39,7 @@ class PlaceInitialCondition(InitialCondition): Class used to defined the place initial condition in SpatialPy. :param species: The species to set the initial condition. - :type species: spayialpy.species.Species + :type species: spatialpy.core.species.Species :param count: The initial condition for the target species. :type count: int @@ -58,7 +61,7 @@ def apply(self, model): Set the initial condition of the species to the count at the location. :param model: Model contianing the target species. - :type model: spatialpy.model.Model + :type model: spatialpy.core.model.Model """ spec_name = self.species.name spec_ndx = None @@ -74,7 +77,7 @@ class UniformInitialCondition(InitialCondition): Class used to defined the uniform initial condition in SpatialPy. :param species: The species to set the initial condition. - :type species: spayialpy.species.Species + :type species: spatialpy.core.species.Species :param count: The initial condition for the target species. :type count: int @@ -101,7 +104,7 @@ def apply(self, model): Set 'count' of 'species' in over the list of types (all types if None). :param model: Model contianing the target species. - :type model: spatialpy.model.Model + :type model: spatialpy.core.model.Model """ spec_name = self.species.name spec_ndx = None @@ -126,7 +129,7 @@ class ScatterInitialCondition(InitialCondition): Class used to defined the scatter initial condition in SpatialPy. :param species: The species to set the initial condition. - :type species: spayialpy.species.Species + :type species: spatialpy.core.species.Species :param count: The initial condition for the target species. :type count: int @@ -153,7 +156,7 @@ def apply(self, model): Scatter 'count' of 'species' randomly over the list of types (all types if None). :param model: Model contianing the target species. - :type model: spatialpy.model.Model + :type model: spatialpy.core.model.Model """ spec_name = self.species.name spec_ndx = None diff --git a/spatialpy/core/model.py b/spatialpy/core/model.py index f605dcd9..68b74b03 100644 --- a/spatialpy/core/model.py +++ b/spatialpy/core/model.py @@ -32,8 +32,8 @@ def export_StochSS(spatialpy_model, filename=None, return_stochss_model=False): """ SpatialPy model to StochSS converter - :param spatailpy_model: SpatialPy model to be converted to StochSS - :type spatialpy_model: spatialpy.Model + :param spatialpy_model: SpatialPy model to be converted to StochSS + :type spatialpy_model: spatialpy.core.model.Model :param filename: Path to the exported stochss model :type filename: str @@ -329,12 +329,12 @@ def add_species(self, obj): Adds a species, or list of species to the model. Will return the added object upon success. :param obj: The species or list of species to be added to the model object. - :type obj: spatialpy.Model.Species | list(spatialpy.Model.Species + :type obj: spatialpy.core.species.Species | list(spatialpy.core.species.Species :returns: Species object which was added to the model. - :rtype: spatialpy.Species | list(spatialpy.Species) + :rtype: spatialpy.core.species.Species | list(spatialpy.core.species.Species) - :raises ModelError: If obj is not a spatialpy.Species + :raises ModelError: If obj is not a spatialpy.core.species.Species """ from spatialpy.core.species import Species # pylint: disable=import-outside-toplevel if isinstance(obj, list): @@ -359,7 +359,7 @@ def delete_species(self, obj): Remove a Species from model.listOfSpecies. :param obj: Species object to be removed - :type obj: spatialpy.Model.Species + :type obj: spatialpy.core.species.Species """ self.listOfSpecies.pop(obj) # raises key error if param is missing @@ -389,7 +389,7 @@ def get_species(self, sname): :type sname: str :returns: The Species objected represented by given 'sname' - :rtype: spatialpy.Model.Species + :rtype: spatialpy.core.species.Species :raises ModelError: if the model does not contain the requested species """ @@ -417,12 +417,12 @@ def add_parameter(self,params): Parameter object or a list of Parameter objects. :param params: Parameter object or list of Parameters to be added. - :type params: spatialpy.Model.Parameter | list(spatialpy.Model.Parameter) + :type params: spatialpy.core.parameter.Parameter | list(spatialpy.core.parameter.Parameter) :returns: Parameter object which has been added to the model. - :rtype: spatialpy.Parameter | list(spatialpy.Parameter) + :rtype: spatialpy.core.parameter.Parameter | list(spatialpy.core.parameter.Parameter) - :raises ModelError: if obj is not a spatialpy.Parameter + :raises ModelError: if obj is not a spatialpy.core.parameter.Parameter """ from spatialpy.core.parameter import Parameter # pylint: disable=import-outside-toplevel if isinstance(params,list): @@ -449,7 +449,7 @@ def delete_parameter(self, obj): Remove a Parameter from model.listOfParameters. :param obj: Parameter object to be removed - :type obj: spatialpy.Model.Parameter + :type obj: spatialpy.core.parameter.Parameter """ self.listOfParameters.pop(obj) @@ -466,11 +466,11 @@ def get_parameter(self, pname): """ Return the Parameter object from model associated with 'pname' - :param pname: Name of parameter to be removed - :type pname: spatialpy.Model.Parameter + :param pname: Name of parameter to be returned + :type pname: str :returns: The Parameter object represented in the model by 'pname' - :rtype: Spatialpy.Model.Parameter + :rtype: Spatialpy.core.parameter.Parameter :raises ModelError: No parameter named {pname} """ @@ -499,12 +499,12 @@ def add_reaction(self, reacs): or a dict with name, instance pairs. :param reacs: Reaction or list of Reactions to be added. - :type reacs: spatialpy.Model.Reaction | list(spatialpy.Model.Reaction) + :type reacs: spatialpy.core.reaction.Reaction | list(spatialpy.core.reaction.Reaction) :returns: The Reaction object(s) added to the model - :rtype: spatialpy.Model.Reaction + :rtype: spatialpy.core.reaction.Reaction | list(spatialpy.core.reaction.Reaction) - :raises ModelError: Invalid input/reaction to add_reaction() + :raises ModelError: if obj is not a spatialpy.core.reaction.Reaction """ from spatialpy.core.reaction import Reaction # pylint: disable=import-outside-toplevel if isinstance(reacs, list): @@ -529,7 +529,7 @@ def delete_reaction(self, obj): Remove reaction from model.listOfReactions :param obj: Reaction to be removed. - :type obj: spatialpy.Model.Reaction + :type obj: spatialpy.core.reaction.Reaction """ self.listOfReactions.pop(obj) @@ -555,11 +555,11 @@ def get_reaction(self, rname): """ Retrieve a reaction object from the model by name - :param rname: name of Reaction to retrieve + :param rname: name of the reaction to be returned :type rname: str :returns: The Reaction Object in the model represented by 'rname' - :rtype: spatialpy.Model.Reaction + :rtype: spatialpy.core.reaction.Reaction :raises ModelError: Could not find reaction """ @@ -596,7 +596,7 @@ def run(self, number_of_trajectories=1, seed=None, timeout=None, :type profile: bool :returns: A SpatialPy Result object containing simulation data. - :rtype: spatialpy.Result.Result + :rtype: spatialpy.core.result.Result """ from spatialpy.solvers.solver import Solver # pylint: disable=import-outside-toplevel @@ -608,7 +608,7 @@ def run(self, number_of_trajectories=1, seed=None, timeout=None, def set_timesteps(self, output_interval, num_steps, timestep_size=None): - """" + """ Set the simlation time span parameters. :param output_interval: size of each output timestep in seconds @@ -668,7 +668,7 @@ def add_domain(self, domain): Add a spatial domain to the model :param domain: The Domain object to be added to the model - :type domain: spatialpy.Domain.Domain + :type domain: spatialpy.core.domain.Domain :raises ModelError: Invalid Domain object """ @@ -681,15 +681,15 @@ def add_domain(self, domain): def add_data_function(self, data_function): """ Add a scalar spatial function to the simulation. This is useful if you have a - spatially varying in put to your model. Argument is a instances of subclass of the - spatialpy.DataFunction class. It must implement a function 'map(x)' which takes a - the spatial positon 'x' as an array, and it returns a float value. + spatially varying input to your model. Argument is a instances of subclass of the + spatialpy.DataFunction class. It must implement a function 'map(point)' which takes a + the spatial positon 'point' as an array, and it returns a float value. :param data_function: Data function to be added. :type data_function: spatialpy.DataFunction :returns: DataFunction object(s) added tothe model. - :rtype: spatialpy.DataFunction | list(spatialpy.DataFunction) + :rtype: spatialpy.core.datafunction.DataFunction | list(spatialpy.core.datafunction.DataFunction) :raises ModelError: Invalid DataFunction """ @@ -711,16 +711,16 @@ def add_initial_condition(self, init_cond): Add an initial condition object to the initialization of the model. :param init_cond: Initial condition to be added - :type init_cond: spatialpy.InitialCondition.InitialCondition + :type init_cond: spatialpy.core.initialcondition.InitialCondition """ self.listOfInitialConditions.append(init_cond) def add_boundary_condition(self, bound_cond): """ - Add an BoundaryCondition object to the model. + Add an boundary condition object to the model. :param bound_cond: Boundary condition to be added - :type bound_cond: spatialpy.BoundaryCondition + :type bound_cond: spatialpy.core.boundarycondition.BoundaryCondition """ bound_cond.model = self self.listOfBoundaryConditions.append(bound_cond) diff --git a/spatialpy/core/reaction.py b/spatialpy/core/reaction.py index f72c4054..988f0823 100644 --- a/spatialpy/core/reaction.py +++ b/spatialpy/core/reaction.py @@ -42,7 +42,7 @@ class Reaction(): :type propensity_function: str :param rate: if mass action, rate is a reference to a parameter instance. - :type rate: spatialpy.model.Parameter + :type rate: spatialpy.core.parameter.Parameter :param annotation: Description of the reaction (meta) :type annotation: str @@ -177,8 +177,8 @@ def add_product(self, species, stoichiometry): """ Add a product to this reaction - :param S: Species object to be produced by the reaction - :type S: spatialpy.Model.Species + :param species: Species object to be produced by the reaction + :type species: spatialpy.core.species.Species :param stoichiometry: Stoichiometry of this product. :type stoichiometry: int @@ -195,7 +195,7 @@ def add_reactant(self, species, stoichiometry): Add a reactant to this reaction :param species: reactant Species object - :type species: spatialpy.Model.Species + :type species: spatialpy.core.species.Species :param stoichiometry: Stoichiometry of this participant reactant :type stoichiometry: int @@ -223,7 +223,7 @@ def initialize(self, model): Deferred object initialization, called by model.add_reaction(). :param model: Target SpatialPy Model for annotation. - :type model: spatialpy.Model + :type model: spatialpy.core.model.Model """ self.ode_propensity_function = self.propensity_function diff --git a/spatialpy/core/result.py b/spatialpy/core/result.py index fbc06f5f..a8408d8f 100644 --- a/spatialpy/core/result.py +++ b/spatialpy/core/result.py @@ -312,25 +312,25 @@ def get_species(self, species, timepoints=None, concentration=False, determinist one or all timepoints. Returns a numpy array containing the species population/concentration values. :param species: A species in string or dictionary form to retreive information about - :type species: str | dict + :type species: str | spatialpy.core.species.Species :param timepoints: A time point where the information should be retreived from. If 'timepoints' is None (default), a matrix of dimension: (number of timepoints) x (number of voxels) is returned. If an integer value is given, that value is used to index into the timespan, and that time point is returned - as a 1D array with size (number of voxel). - :type timepoints: int (default None) + as a 1D array with size (number of voxel). Defaults to None + :type timepoints: int :param concentration: Whether or not the species is a concentration (True) or population (False) If concentration is False (default), the integer, raw, trajectory data is returned. - If set to True, the concentration (=copy_number/volume) is returned. - :type concentration: bool (default False) + If set to True, the concentration (=copy_number/volume) is returned. Defaults to False + :type concentration: bool - :param deterministic: Whether or not the species is deterministic (True) or stochastic (False) - :type deterministic: bool (default False) + :param deterministic: Whether or not the species is deterministic (True) or stochastic (False). Defaults to False + :type deterministic: bool - :param debug: Whether or not debug information should be printed - :type debug: bool (default False) + :param debug: Whether or not debug information should be printed. Defaults to False + :type debug: bool :returns: A numpy array containing population/concentration values for target species across specified timepoints. Defaults to all timepoints. @@ -340,7 +340,7 @@ def get_species(self, species, timepoints=None, concentration=False, determinist """ num_voxel = self.model.domain.get_num_voxels() - if isinstance(species,str): + if isinstance(species, str): spec_name = species else: spec_name = species.name @@ -404,11 +404,13 @@ def plot_species(self, species, t_ndx=None, t_val=None, concentration=False, :param deterministic: Whether or not to plot the data as deterministic :type deterministic: bool - :param width: Width in pixels of output plot box - :type width: int (default 500) + :param width: Width in pixels of output plot box or for matplotlib inches of output plot box. \ + Defaults to 500 (Plotly) or 6.4 (MatPlotLib) + :type width: int - :param height: Height in pixels of output plot box - :type height: int (default 500) + :param height: Height in pixels of output plot box or for matplotlib inches of output plot box. \ + Defaults to 500 (Plotly) or 4.8 (MatPlotLib) + :type height: int :param colormap: colormap to use. Plotly specification, valid values: "Plotly3","Jet","Blues","YlOrRd", "PuRd","BuGn","YlOrBr","PuBuGn","BuPu","YlGnBu", "PuBu","GnBu","YlGn","Greens","Reds", @@ -450,7 +452,7 @@ def plot_species(self, species, t_ndx=None, t_val=None, concentration=False, :returns: A dictionary containing data for a plotly figure of species output trajectory :rtype: dict - :raises ResultsError: unable to plot species for given time + :raises ResultError: unable to plot species for given time """ time_index_list = self.get_timespan() @@ -578,7 +580,14 @@ def get_property(self, property_name, timepoints=None): given, that value is used to index into the timespan, and that time point is returned \ as a 1D array with size (number of voxel). - :param property_name: A string describing the property to be returned. + :param property_name: A string describing the property to be returned. Can be one of: { + 'v' : velocity, + 'rho': density, + 'mass': mass, + 'id': type_id, + 'type': type as str, + 'bvf_phi': boundary volume fraction, + 'nu': viscosity} :type property_name: str :param timepoints: timespan index to be returned. Default is None @@ -587,7 +596,7 @@ def get_property(self, property_name, timepoints=None): :returns: a numpy array of target property values across timepoints, defaults to all timepoints. :rtype: numpy.ndarray - :raises ResultsError: Could not get data for given timepoints. + :raises ResultError: Could not get data for given timepoints. """ l_time = len(self.get_timespan()) - 1 @@ -639,11 +648,13 @@ def plot_property(self, property_name, t_ndx=None, t_val=None, p_ndx=0, width=No :param p_ndx: The property index of the results to be plotted :type p_ndx: int - :param width: Width in pixels of output plot box or for matplotlib inches of output plot box - :type width: int (default 500) + :param width: Width in pixels of output plot box or for matplotlib inches of output plot box. \ + Defaults to 500 (Plotly) or 6.4 (MatPlotLib) + :type width: int - :param height: Height in pixels of output plot box or for matplotlib inches of output plot box - :type height: int (default 500) + :param height: Height in pixels of output plot box or for matplotlib inches of output plot box. \ + Defaults to 500 (Plotly) or 4.8 (MatPlotLib) + :type height: int :param colormap: colormap to use. Plotly specification, valid values: "Plotly3","Jet","Blues","YlOrRd", "PuRd","BuGn","YlOrBr","PuBuGn","BuPu","YlGnBu", "PuBu","GnBu","YlGn","Greens","Reds", @@ -835,9 +846,9 @@ def export_to_csv(self, folder_name=None): The columns of modelname_mesh.csv are: 'Voxel ID', 'X', 'Y', 'Z', 'Type', 'Volume', 'Mass', 'Viscosity' The columns of modelname_species_S.csv: 'Time', 'Voxel 0', Voxel 1', ... 'Voxel N'. - :type folder_name: str (default current working directory) - :param folder_name: A path where the vtk files will be written, created if non-existant. - If no path is provided current working directory is used. + :type folder_name: str + :param folder_name: A path where the vtk files will be written, created if non-existant. \ + Defaults current working directory """ if not folder_name: folder_name = os.path.abspath(os.getcwd()) @@ -866,7 +877,7 @@ def export_to_csv(self, folder_name=None): for voxel in range(num_vox): writer.writerow([voxel] + data[:,voxel].tolist()) - def export_to_vtk(self, timespan, folder_name=None): + def __export_to_vtk(self, timespan, folder_name=None): """ Write the trajectory to a collection of vtk files. The exported data is #molecules/volume, where the volume unit is implicit from the mesh dimension. diff --git a/spatialpy/core/species.py b/spatialpy/core/species.py index 11a63b53..c1f03142 100644 --- a/spatialpy/core/species.py +++ b/spatialpy/core/species.py @@ -28,7 +28,7 @@ class Species(): :param diffusion_coefficient: Non-constant coefficient of diffusion for Species. :type diffusion_coefficient: float - :param restrict_to: Set the diffusion coefficient to zero for 'species' in all types not in 'listOfTypes'. + :param restrict_to: Set the diffusion coefficient to zero for 'species' in all types not in 'listOfTypes'. \ This effectively restricts the movement of 'species' to the types specified in 'listOfTypes'. :type restrict_to: int, str, list of ints or list of strs """ @@ -71,7 +71,7 @@ def set_diffusion_coefficient(self, diffusion_coefficient): :param diffusion_coefficient: Non-constant coefficient of diffusion for Species. :type diffusion_coefficient: float - :raises SpeciesError: If diffusion_coefficient is negative. + :raises SpeciesError: If diffusion_coefficient is negative or not a valid type. """ if not (isinstance(diffusion_coefficient, (Parameter, float, int)) or \ type(diffusion_coefficient).__name__ == 'Parameter'): diff --git a/spatialpy/solvers/solver.py b/spatialpy/solvers/solver.py index 6f30f0c6..0387165f 100644 --- a/spatialpy/solvers/solver.py +++ b/spatialpy/solvers/solver.py @@ -49,7 +49,7 @@ class Solver: SpatialPy solver object. :param model: Target model of solver simulation. - :type model: spatialpy.Model.Model + :type model: spatialpy.core.model.Model :param debug_level: Target level of debugging. :type debug_level: int diff --git a/spatialpy/stochss/stochss_export.py b/spatialpy/stochss/stochss_export.py index 3bd47f6c..02ecc484 100644 --- a/spatialpy/stochss/stochss_export.py +++ b/spatialpy/stochss/stochss_export.py @@ -200,13 +200,17 @@ def export(model, path=None, return_stochss_model=False): """ SpatialPy model to StochSS converter - Args: - spatialpy_model : spatialpy.Model - SpatialPy model to be converted to StochSS - filename : str - Path to the exported stochss model - return_stochss_model : bool - Whether or not to return the model + :param model: SpatialPy model to be converted to StochSS. + :type model: spatialpy.core.model.Model + + :param filename: Path to the exported stochss model. + :type filename: str + + :param return_stochss_model: Whether or not to return the model. + :type return_stochss_model: bool + + :returns: StochSS model dict if return_stochss_model is True else path to StochSS model file. + :rtype: dict | str """ _ = model.compile_prep() if path is None: