Legacy¶
Backwards compatibility¶
While these functions are deprecated, they are kept in the API for legacy reasons.
- pigreads.compat.run(models, inhom, weights, states, stim_signal=None, stim_shape=None, Nt=1, dt=0.001, double_precision=None)¶
Run a Pigreads simulation.
Deprecated since version 0.5.0: Use
pigreads.models.Models.run()instead.- Parameters:
models (
Models) – The models to be used in the simulation, seepigreads.models.Models.inhom (
ndarray[Any,Any]) – A 3D array with integer values, encoding which model to use at each point. Its value is zero for points outside the medium and one or more for points inside. Values larger than zero are used to select one of multiple models: 1 formodels[0], 2 formodels[1], etc.weights (
ndarray[Any,Any]) – The weights for the diffusion term, seeweights().states (
ndarray[Any,Any]) – The initial states of the simulation, a 4D array of shape (Nz, Ny, Nx, Nv), seepigreads.models.Models.resting_states().stim_signal (
ndarray[Any,Any] |None) – A 3D array with the stimulus signal at each time point for all variables, with shape (Nt, Ns, Nv). IfNone, no stimulus is applied. (default:None)stim_shape (
ndarray[Any,Any] |None) – A 4D array specifying the shape of the stimulus, with shape (Ns, Nz, Ny, Nx). IfNone, no stimulus is applied (default:None)Nt (
int) – The number of time steps to run the simulation for. (default:1)dt (
float) – The time step size. (default:0.001)double_precision (
bool|None) – IfTrue, use double precision for calculations. (default:None)
- Return type:
- Returns:
The final states of the simulation, a 4D array of shape (Nz, Ny, Nx, Nv).
- pigreads.compat.weights(dz=1.0, dy=1.0, dx=1.0, inhom=None, diffusivity=1.0, double_precision=False)¶
Calculate the weights for the diffusion term in the reaction-diffusion equation.
Deprecated since version 0.5.0: Use
pigreads.models.Models.weights()instead.- Parameters:
dz (
float) – The distance between points in the z-dimension, seepigreads.helper.deltas(). (default:1.0)dy (
float) – The distance between points in the y-dimension. (default:1.0)dx (
float) – The distance between points in the x-dimension. (default:1.0)inhom (
ndarray[Any,Any] |None) – A 3D array with integer values, encoding which model to use at each point. Its value is zero for points outside the medium and one or more for points inside. IfNone, all points are considered inside the medium. (default:None)diffusivity (
ndarray[Any,Any] |float) – The diffusivity matrix, seepigreads.diffusivity.diffusivity_matrix(). If a scalar is given, the matrix is isotropic with the same value in all directions. (default:1.0)double_precision (
bool) – IfTrue, use double precision for calculations. (default:False)
- Return type:
- Returns:
Weight matrix for the diffusion term, A 5D array of shape (1, Nz, Ny, Nx, 19).