Additional Helper functions
get_union
Gives the union of a single reference and a single target group, allowing \(G(r,t)\) to be split into \(G_s(r,t)\) and \(G_t(r,t)\).
PARAMETER | DESCRIPTION |
---|---|
ref |
The array containing the indices of the reference particles.
TYPE:
|
target |
The array containing the indices of the target particles.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
union
|
List containing the indices contained in both the reference and the target group.
TYPE:
|
Source code in speadi/common_tools/get_union.py
get_all_unions
Gives the union of all reference groups and all target groups, allowing \(G(r,t)\) to be split into \(G_s(r,t)\) and \(G_t(r,t)\).
PARAMETER | DESCRIPTION |
---|---|
g1 |
List object containing arrays of reference groups.
TYPE:
|
g2 |
List object containing arrays of target groups.
TYPE:
|
g1_lens |
Integer number of elements in each reference group contained in g1.
TYPE:
|
g2_lens |
Integer number of elements in each target group contained in g2.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
unions
|
Dictionary containing the overlapping indices in each combination of groups in g1 and g2.
TYPE:
|
Source code in speadi/common_tools/get_union.py
check_jax
Checks the availability of jax
and the jaxlib
library in the current python environment.
RETURNS | DESCRIPTION |
---|---|
JAX_AVAILABLE
|
Boolean variable that other functions can use to import the correct accelerated versions of code.
TYPE:
|
Source code in speadi/common_tools/check_acceleration.py
check_numba
Checks the availability of numba
in the current python environment.
RETURNS | DESCRIPTION |
---|---|
NUMBA_AVAILABLE
|
Boolean variable that other functions can use to import the correct accelerated versions of code.
TYPE:
|