select_by_utilisation#

popo.network.select_by_utilisation(transformers, screen=None, count=30, random_state=0)#

Choose the transformers to record, held fixed across scenarios.

Given a screening result, the most heavily loaded assets are taken, which is where an operator would look and where a thermal constraint can actually bind. Without one, a uniform sample is drawn and the caller should expect the record to contain few events: on one feeder a random thirty peaked at 0.81 utilisation while the screen had found 250 of 596 above 0.8.

Holding the selection fixed across scenarios is what makes a penetration sweep a comparison of the same assets rather than a fresh draw each time.

Parameters:
  • transformers (DataFrame) – Frame from read_transformers().

  • screen (DataFrame | None) – Optional screening result carrying transformer and utilisation columns, from which peak utilisation is taken.

  • count (int) – Number of transformers to select.

  • random_state (int) – Seed for the uniform fallback, for reproducibility.

Return type:

DataFrame

Returns:

The selected subset of transformers.

Raises:

ValueError – If count is not positive.