helios.layouts.base.NetworkLayoutIPCRender

class helios.layouts.base.NetworkLayoutIPCRender(network_draw, edges, weights=None)[source]

Bases: abc.ABC

An abstract class which reads the network information and creates the shared memory resources.

Parameters
  • network_draw (NetworkDraw) – A NetworkDraw object which will be used to draw the network

  • edges (ndarray) – a bi-dimensional array with the edges list

  • weights (array, optional) – a one-dimensional array with the edge weights

Methods

cleanup

Release the shared memory resources

start

This method starts the network layout algorithm creating a new subprocess.

stop

Stop the layout algorithm

update

This method updates the position of the network actor and right after that refresh the network draw

cleanup()[source]

Release the shared memory resources

start(ms=30, steps=100, iters_by_step=2, record_positions=False, without_iren_start=True)[source]

This method starts the network layout algorithm creating a new subprocess.

Right after the network layout algorithm finish the computation (ending of the related subprocess), the stop method will be called automatically.

Parameters
  • ms (float) – time interval in milleseconds to update the positions inside of the NetworkDraw

  • steps (int) – number of steps; snapshots. For example, if you set steps=3 that means the positions will be updated three times.

  • iters_by_step (int) – number of interations in each step

  • record_positions (bool, optional, default True) – Record the positions of the network

  • without_iren_start (bool, optional, default True) – Set this to False if you will start the ShowManager. That is, if you will invoke the following commands

Examples

>>> network_draw.initialize()
>>> network_draw.start()
stop()[source]

Stop the layout algorithm

update()[source]

This method updates the position of the network actor and right after that refresh the network draw