Lumicron Documentation
DocumentationLayout APIErrors & warnings

Errors & warnings

A reference for the messages you’ll see while authoring scripts. All errors are subclasses of Exception; all warnings are subclasses of UserWarning.

Errors

RouteError

The auto-router or a chain method couldn’t proceed. The message names the concrete cause; the most common variants:

Message contains Likely cause Fix
“no entry in cell.styles” .style("name") referenced a name not in the cell’s style table. Add c.styles["name"] = RouteProfile(...) first, or pass the object directly.
“S-bend forward must be positive” .go("NW", ...) from an east-facing port - the diagonal would go backwards. Pick a diagonal that advances in the port’s direction.
“no transition registered for layer pair” Cross-layer route with no transition PCell in the registry. Pass transitions= with a registry that handles the pair, or stay on one layer.
“off-angle ports require flatten” Cell hierarchy has off-cardinal ports at a junction. Add flatten=True on the offending cell, or simplify hierarchy.

GeometryError

A shape’s parameters are inconsistent (e.g. negative dimensions, inverted bbox).

ValueError from lm.Bookmark(...) / add_bookmark(...)

  • "requires a non-empty name" - empty / whitespace-only name.
  • "requires either at= or bbox=" - neither given.
  • "bbox corners are inverted" - xmax < xmin or ymax < ymin.

TypeError

You passed the wrong kind of object to a chain method. Most common: chip.Place(some_handle) where some_handle was already a PlacementChain (call .Place on the original cell, not on a chain return value).

ValueError from CELL.Join(...)

The moving port must come from a placed handle in the current cell. The fixed port must come from another handle in that cell or from the current cell’s own ports mapping. A raw cell-definition port has no placement to move; one ArrayElementHandle cannot move independently of its shared array transform; and a consumed or foreign handle is rejected.

Warnings

Warnings don’t stop your script. They surface in the terminal and (when running inside the Lumicron app) in the Output panel.

GeometryWarning

Message contains Cause Action
“S-bend radius … below minimum” The radius you passed is too tight for the route’s forward / lateral budget. Increase radius=, lengthen the forward span, or reduce the lateral offset.
“radius … below layer min_radius” radius= is below the route layer’s min_radius rule. Increase radius=, or change to a layer with a tighter rule.
“bridge taper auto-inserted at port_b” Final width didn’t equal port_b.width. Add an explicit .end_taper(...) or finish with .width(port_b.width).

RouteWarning

Message contains Cause
“match_length_to: target shorter than current” The route is already longer than the match target - no meander added.
“amplitude= miss” A pinned amplitude= produced a length that misses the target by > 1 µm.

ProfileWarning

Message contains Cause
“radius=… overrides the profile’s radius” You passed radius= and a profile carrying its own. The kwarg wins.
“tooth strokes unsupported with custom bend PCell” A profile’s tooth segments can’t follow a PCell’s curve. Bend PCells render their own geometry.

Join warnings

CELL.Join emits ordinary Python warnings when the two ports disagree on width, layer, port type, or named route profile. The joint is still made because explicit cross-section changes can be intentional. Verify the junction geometry or insert a real transition when the mismatch is not deliberate.

Suppressing warnings

Standard Python warnings.filterwarnings works:

import warnings
import lumicron as lm
warnings.filterwarnings("ignore", category=lm.GeometryWarning)

But warnings exist for a reason - usually a silent geometry compromise. Prefer fixing the cause.

Search documentation

Type to search all guides and API references.

↑ ↓ to select · Enter to open · Esc to close