Developer modules#
bsb.services#
Provides several services for optional dependencies.
- bsb.services.MPI = <bsb.services.mpi.MPIService object>#
MPI service
- bsb.services.MPILock = <bsb.services.mpilock.MPILockModule object>#
MPILock service
Service module. Register or access interfaces that may be provided, mocked or missing, but should always behave neatly on import.
- exception bsb.services.WorkflowError(_ExceptionGroup__message: str, _ExceptionGroup__exceptions: Sequence[_ExceptionT_co])[source]#
Bases:
ExceptionGroup
bsb.topology._layout module#
Internal layout module. Makes sure regions and partitions don’t mutate during layout.
- class bsb.topology._layout.Layout(data, owner=None, children=None, frozen=False)[source]#
Bases:
object
Container class for all types of partition data. The layout swaps the data of the partition with temporary layout associated data, and tries out experimental changes to the partition data, if the layout process fails, the original partition data is reinstated.
- property children#
- property data#
- class bsb.topology._layout.PartitionData[source]#
Bases:
ABC
The partition data is a class that stores the description of a partition for a partition. This allows the Partition interface to define mutating operations such as translate, rotate, scale; for a dry-run we only have to swap out the actual data with temporary data, and the mutation is prevented.
bsb._util#
Global internal utility module.
- bsb._util.ichain(iterable, /)#
Alternative chain() constructor taking a single iterable argument that evaluates lazily.
- bsb._util.immutable()[source]#
Decorator to mark a method as immutable, so that any calls to it return, and are performed on, a copy of the instance.
- bsb._util.listify_input(value)[source]#
Turn any non-list values into a list containing the value. Sequences will be converted to a list using list(), None will be replaced by an empty list.
- bsb._util.obj_str_insert(__str__)[source]#
Decorator to insert the return value of __str__ into ‘<classname {returnvalue} at 0x…>’
- bsb._util.rotation_matrix_from_vectors(vec1, vec2)[source]#
Find the rotation matrix that aligns vec1 to vec2
- Parameters:
vec1 – A 3d “source” vector
vec2 – A 3d “destination” vector
- Return mat:
A transform matrix (3x3) which when applied to vec1, aligns it with vec2.
- bsb._util.sanitize_ndarray(arr_input, shape, dtype=None)[source]#
Convert an object to an ndarray and shape, avoiding to copy it wherever possible.