cellsium package

CellSium - _Cell_ _Si_mulator for _micro_fluidic _m_icrocolonies

cellsium.random module

Random number generation infrastructure.

class cellsium.random.RRF(mode: str = 'callable')

Bases: object

Reproducible random function.

classmethod chain(func: KwargFunction, **kwargs) Iterator

Calls func with kwargs and yields from it.

Parameters:
  • func – Function to call

  • kwargs – Kwargs to pass

Returns:

Iterator of values

classmethod compose(func: KwargFunction, **kwargs) Iterator

Calls a function func with an element of the sequences from the kwargs as kwargs.

Parameters:
  • func – Function to be called

  • kwargs – Kwargs of sequences, of which an element each will be used for each function call

Returns:

Iterator of values

generator = <cellsium.random.RRF object>
classmethod seed(seed: Optional[int] = None) int

Set the seed for the RRF.

Parameters:

seed – Seed

Returns:

Seed

seed_sequence = SeedSequence(     entropy=1,     n_children_spawned=26, )
seed_value: int = 1
sequence = <cellsium.random.RRF object>
classmethod spawn_generator() Generator

Generates a new np.random.Generator from the seed and the configured bitgenerator.

Returns:

The Generator instance

classmethod wrap(sequence: Iterable, func: AnyFunction) Iterator

Wraps the sequence with the function func so that each returned element x becomes func(x).

Parameters:
  • sequence – Input sequence

  • func – Function to be called

Returns:

Iterator of values

class cellsium.random.RandomNumberGenerator(*args, **kwargs)

Bases: Tunable

Random number generator to be used

classmethod available_rngs() Dict[str, Type[BitGenerator]]
default: str = 'PCG64'
classmethod get() Type[BitGenerator]
classmethod test(value: str) bool
type_

alias of str

value = 'PCG64'
class cellsium.random.Seed(*args, **kwargs)

Bases: Tunable

Seed for the random number generator

default: int = 1
type_

alias of int

value = 1
cellsium.random.enforce_bounds(iterator: Iterator, minimum: float = -inf, maximum: float = inf) Iterator[Union[float, ndarray]]

Will iter thru an iterator til a value is within bounds. For arrays, all values will be considered.

Parameters:
  • iterator – Iterator

  • minimum – Minimum value

  • maximum – Maximum value

Returns:

An iterator of values within bounds

cellsium.parameters module

Main set of parameters for the simulation.

class cellsium.parameters.Calibration(*args, **kwargs)

Bases: Tunable

Calibration for outputs, micrometer per pixel

default: float = 0.065
value = 0.065
class cellsium.parameters.Height(*args, **kwargs)

Bases: Tunable

Height of the (outputted) simulation

default: float = 60.0
value = 60.0
class cellsium.parameters.NewCellBendLowerLower(*args, **kwargs)

Bases: RandomlyDistributed

Bend factor minimum for the lower part of new new cells

default: float = -0.1
value = -0.1
class cellsium.parameters.NewCellBendLowerUpper(*args, **kwargs)

Bases: RandomlyDistributed

Bend factor maximum for the lower part of new new cells

default: float = 0.1
value = 0.1
class cellsium.parameters.NewCellBendOverallLower(*args, **kwargs)

Bases: RandomlyDistributed

Bend factor minimum for new new cells

default: float = -0.1
value = -0.1
class cellsium.parameters.NewCellBendOverallUpper(*args, **kwargs)

Bases: RandomlyDistributed

Bend factor maximum for new new cells

default: float = 0.1
value = 0.1
class cellsium.parameters.NewCellBendUpperLower(*args, **kwargs)

Bases: RandomlyDistributed

Bend factor minimum for the upper part of new new cells

default: float = -0.1
value = -0.1
class cellsium.parameters.NewCellBendUpperUpper(*args, **kwargs)

Bases: RandomlyDistributed

Bend factor maximum for the upper part of new new cells

default: float = 0.1
value = 0.1
class cellsium.parameters.NewCellCount(*args, **kwargs)

Bases: Tunable

New cells to add to the simulation

default: int = 1
value = 1
class cellsium.parameters.NewCellLength1Mean(*args, **kwargs)

Bases: RandomlyDistributed

Mean cell length, subtype one

default: float = 2.5
value = 2.5
class cellsium.parameters.NewCellLength1Std(*args, **kwargs)

Bases: RandomlyDistributed

Standard deviation of the cell length, subtype one

default: float = 0.15
value = 0.15
class cellsium.parameters.NewCellLength2Mean(*args, **kwargs)

Bases: RandomlyDistributed

Mean cell length, subtype two

default: float = 1.25
value = 1.25
class cellsium.parameters.NewCellLength2Std(*args, **kwargs)

Bases: RandomlyDistributed

Standard deviation of the cell length, subtype one

default: float = 0.15
value = 0.15
class cellsium.parameters.NewCellLengthAbsoluteMax(*args, **kwargs)

Bases: Tunable

Absolute maximum length of new cells

default: float = 3.5
value = 3.5
class cellsium.parameters.NewCellLengthAbsoluteMin(*args, **kwargs)

Bases: Tunable

Absolute minimum length of new cells

default: float = 0.8
value = 0.8
class cellsium.parameters.NewCellRadiusFromCenter(*args, **kwargs)

Bases: RandomlyDistributed

Maximum radius for new cells to be spawned from the origin

default: float = 5.0
value = 5.0
class cellsium.parameters.NewCellWidthAbsoluteMax(*args, **kwargs)

Bases: Tunable

Absolute maximum width of new cells

default: float = 1.5
value = 1.5
class cellsium.parameters.NewCellWidthAbsoluteMin(*args, **kwargs)

Bases: Tunable

Absolute minimum width of new cells

default: float = 0.75
value = 0.75
class cellsium.parameters.NewCellWidthMean(*args, **kwargs)

Bases: RandomlyDistributed

Mean cell width for new cells

default: float = 1.0
value = 1.0
class cellsium.parameters.NewCellWidthStd(*args, **kwargs)

Bases: RandomlyDistributed

Standard deviation of the width of new cells

default: float = 0.1
value = 0.1
class cellsium.parameters.RandomlyDistributed(*args, **kwargs)

Bases: Tunable

Parent class for randomly distributed tunables

class cellsium.parameters.Width(*args, **kwargs)

Bases: Tunable

Width of the (outputted) simulation

default: float = 40.0
value = 40.0
cellsium.parameters.h_to_s(hours: Union[float, ndarray]) Union[float, ndarray]

Convert hours to seconds.

Parameters:

hours – Hours

Returns:

Seconds

cellsium.parameters.pixel_to_um(pix: Union[float, ndarray]) Union[float, ndarray]

Convert pixel to micrometer.

Parameters:

pix – Pixel value

Returns:

Micrometer value

cellsium.parameters.s_to_h(seconds: Union[float, ndarray]) Union[float, ndarray]

Convert seconds to hours.

Parameters:

seconds – Seconds

Returns:

Hours

cellsium.parameters.um_to_pixel(um: Union[float, ndarray]) Union[float, ndarray]

Convert micrometer to pixel.

Parameters:

um – Micrometer value

Returns:

Pixel value

cellsium.typing module

Type hints definitions.

class cellsium.typing.AnyFunction

Bases: Protocol

class cellsium.typing.KwargFunction

Bases: Protocol