skidl.schematics.place module

Autoplacer for arranging symbols in a schematic.

exception skidl.schematics.place.PlacementFailure[source]

Bases: Exception

Exception raised when parts or blocks could not be placed.

class skidl.schematics.place.Placer[source]

Bases: object

Mixin to add place function to Node class.

get_attrs()[source]

Return dict of attribute sets for the parts, pins, and nets in a node.

get_snap_pt()[source]

Get a Point to use for snapping the node to the grid.

Parameters:

node (Node) – The Node to which the snapping point applies.

Returns:

The snapping point or None.

Return type:

Point

group_parts(**options)[source]

Group parts in the Node that are connected by internal nets

Parameters:
  • node (Node) – Node with parts.

  • options (dict, optional) – Dictionary of options and values. Defaults to {}.

Returns:

List of lists of Parts that are connected. list: List of internal nets connecting parts. list: List of Parts that are not connected to anything (floating).

Return type:

list

place(tool=None, **options)[source]

Place the parts and children in this node.

Parameters:
  • node (Node) – Hierarchical node containing the parts and children to be placed.

  • tool (str) – Backend tool for schematics.

  • options (dict) – Dictionary of options and values to control placement.

place_blocks(connected_parts, floating_parts, children, **options)[source]

Place blocks of parts and hierarchical sheets.

Parameters:
  • node (Node) – Node with parts.

  • connected_parts (list) – List of Part sets connected by nets.

  • floating_parts (set) – Set of Parts not connected by any of the internal nets.

  • children (list) – Child nodes in the hierarchy.

  • non_sheets (list) – Hierarchical set of Parts that are visible.

  • sheets (list) – List of hierarchical blocks.

  • options (dict) – Dict of options and values that enable/disable functions.

place_connected_parts(parts, nets, **options)[source]

Place individual parts.

Parameters:
  • node (Node) – Node with parts.

  • parts (list) – List of Part sets connected by nets.

  • nets (list) – List of internal Nets connecting the parts.

  • options (dict) – Dict of options and values that enable/disable functions.

place_floating_parts(parts, **options)[source]

Place individual parts.

Parameters:
  • node (Node) – Node with parts.

  • parts (list) – List of Parts not connected by explicit nets.

  • options (dict) – Dict of options and values that enable/disable functions.

rmv_placement_stuff()[source]

Remove attributes added to parts, pins, and nets of a node during the placement phase.

show_added_attrs()[source]

Show attributes that were added to parts, pins, and nets in a node.

skidl.schematics.place.net_force_dist(part, **options)[source]

Compute attractive force on a part from all the other parts connected to it.

Parameters:
  • part (Part) – Part affected by forces from other connected parts.

  • options (dict) – Dict of options and values that enable/disable functions.

Returns:

Force upon given part.

Return type:

Vector

skidl.schematics.place.overlap_force(part, parts, **options)[source]

Compute the repulsive force on a part from overlapping other parts.

Parameters:
  • part (Part) – Part affected by forces from other overlapping parts.

  • parts (list) – List of parts to check for overlaps.

  • options (dict) – Dict of options and values that enable/disable functions.

Returns:

Force upon given part.

Return type:

Vector

skidl.schematics.place.overlap_force_rand(part, parts, **options)[source]

Compute the repulsive force on a part from overlapping other parts.

Parameters:
  • part (Part) – Part affected by forces from other overlapping parts.

  • parts (list) – List of parts to check for overlaps.

  • options (dict) – Dict of options and values that enable/disable functions.

Returns:

Force upon given part.

Return type:

Vector