cellsium.cli.simulate package

Simulation CLI entrypoint.

class cellsium.cli.simulate.BoundariesFile(*args, **kwargs)

Bases: Tunable

Boundaries file (in DXF format) to add boundaries/geometrical constraints

default: str = ''
value = ''
class cellsium.cli.simulate.BoundariesScaleFactor(*args, **kwargs)

Bases: Tunable

Scale factor for the boundaries

default: float = 1.0
value = 1.0
class cellsium.cli.simulate.SimulationDuration(*args, **kwargs)

Bases: Tunable

Time (simulated) the simulation should run

default: float = 12.0
value = 12.0
class cellsium.cli.simulate.SimulationOutputFirstState(*args, **kwargs)

Bases: Tunable

Whether to output the first state

default: bool = False
value = False
class cellsium.cli.simulate.SimulationOutputInterval(*args, **kwargs)

Bases: Tunable

Time intervals (simulated) at which an output should be written

default: float = 0.25
value = 0.25
class cellsium.cli.simulate.SimulationTimestep(*args, **kwargs)

Bases: Tunable

Time step at which the simulation state should be calculated

default: float = 0.016666666666666666
value = 0.016666666666666666
cellsium.cli.simulate.add_boundaries_from_dxf(file_name: str, simulator: Simulator, scale_factor: float = 1.0) None

Add boundaries from a DXF file. Supported are LWPolyline and Polyline objects.

Parameters:
  • file_name – dxf file name

  • simulator – Simulator instance to add the boundaries to

  • scale_factor – Scale factor for the geometry

Returns:

None

cellsium.cli.simulate.add_boundaries_from_tunables(simulator: Simulator) Simulator

Add boundaries to a simulator if the appropriate tunables are set.

Parameters:

simulator – Simulator

Returns:

Simulator

cellsium.cli.simulate.compose(*args)

Compose callable args.

Parameters:

args – Args

Returns:

Callable

cellsium.cli.simulate.initialize_output_times_from_tunables()

Initialize the duration, output_interval and last_output variables, from tunables.

Returns:

duration, output_interval, last_output

cellsium.cli.simulate.measure_duration(iterator: Iterator[T]) Iterator[Tuple[float, T]]

Measure the (wall clock) time it takes to step forward the iterator, yielding the duration and iterator value.

Parameters:

iterator – Iterator

Returns:

Iterator of duration and iterator value

cellsium.cli.simulate.perform_outputs(world: World, simulation_time: float, outputs: Iterable[Output], output_name: Optional[str] = None, overwrite: bool = False, prefix: bool = False, output_count: int = 0) None

Performs the output operations configured.

Parameters:
  • world – World to output

  • simulation_time – Simulation timepoint

  • outputs – Outputs

  • output_name – Name to output to

  • overwrite – Whether to overwrite

  • prefix – Whether to prefix the outputs with the name of the Output type

  • output_count – The count of already outputted timesteps

Returns:

None

cellsium.cli.simulate.perform_simulation(simulator: Optional[Simulator] = None, setup: Optional[Callable[[Simulator], Simulator]] = None, time_step: float = 1.0) Iterator[Timestep]

Simple entrypoint to perform simulations. Will either accept a simulator instance or create one, call the setup callback on it if set, and then yield timesteps time_step apart indefinitely.

Parameters:
  • simulator – Simulator

  • setup – Setup callable

  • time_step – Time step

Returns:

Iterator of Timestep instances

cellsium.cli.simulate.prepare_output_name(output_name: str, output: Output, prefix: str) str

Prepare an output name.

Parameters:
  • output_name – Output name

  • output – Output object

  • prefix – Prefix

Returns:

Output name

cellsium.cli.simulate.subcommand_main(args: Namespace) None

Entry point for the ‘simulate’ subcommand.

Parameters:

args – pre-parsed arguments

Returns:

None