get_magnet_by_id (method)

get_magnet_by_id(self, index)[source]

Return the magnet at the corresponding index returns None is the magnet is None Raise error if the hole doesn’t have a magnet for the corresponding index

Parameters
  • self (Hole) – A Hole object

  • index (int) – Index of the magnet to return

Returns

magnet – Magnet object (or None)

Return type

Magnet