runtime module#

class Runtime(*, uri=None, project=None, client=None)[source]#

Bases: object

Overloads:
  • ()

  • *, uri (str)

  • *, project (str | Path)

  • *, client (PersistentWebSocketClient)

Parameters:
  • uri (str | None)

  • project (str | Path | None)

  • client (PersistentWebSocketClient | None)

active = <jitx.run.runtime.Runtime.__Active object>#
decouple()[source]#
async open()[source]#
async close()[source]#
static require()[source]#
async submit[T: Design](design, *, name=None)[source]#
Return type:

AsyncRuntimeDesign[T]

Parameters:
  • design (T | type[T])

  • name (str | None)

async capture[T: RuntimeDesign](design, *, name=None, wait=5.0)[source]#

Capture the runtime’s physical layout back into the design.

Parameters:
  • design (T) – The submitted design.

  • name (str | None) – The runtime’s name for the design; defaults to the design’s fully qualified name.

  • wait (float) – Seconds to wait for background tasks to finish before the layout is taken. 0 captures immediately.

Return type:

T

async issues(design, *, categories=None, satisfied=False, wait=5.0)[source]#

Query the physical-design issues of a submitted design.

Parameters:
  • design (RuntimeDesign) – The submitted design.

  • categories (Iterable[IssueCategory | int] | None) – Categories to report; all if None.

  • satisfied (bool) – Also report groups whose checks passed.

  • wait (float) – Seconds to wait for background tasks to finish before the snapshot is taken, like capture does. Categories still in progress when the wait ends are reported as pending. 0 answers immediately.

Return type:

IssueReport

class SyncRuntime(runtime)[source]#

Bases: object

Parameters:

runtime (Runtime)

runasync[T](coro)[source]#
Return type:

T

Parameters:

coro (Coroutine[None, None, T])

close()[source]#
open()[source]#
submit[T: Design](design, *, name=None)[source]#
Parameters:
  • design (T | type[T])

  • name (str | None)

capture[T: RuntimeDesign](design, *, name=None, wait=5.0)[source]#
Return type:

T

Parameters:
  • design (T)

  • name (str | None)

  • wait (float)

issues(design, *, categories=None, satisfied=False, wait=5.0)[source]#

Query the physical-design issues of a submitted design. See Runtime.issues().

Return type:

IssueReport

Parameters:
class RuntimeDesign[T: Design](state, name)[source]#

Bases: Generic[T]

A design that has been submitted to the runtime.

root is the instantiated design object. The rest of this class gives access to what the runtime knows about it: use query() to walk the design tree, nets for connectivity, and layers to resolve layer indices and board sides through placements.

Parameters:
  • state (_DesignState[T])

  • name (str)

property root: T#

The design as last captured. A capture replaces it with a new object; one held on to keeps its captured state.

property name#

The name the runtime knows this design by, either the name passed to Runtime.submit() or the fully qualified name of the design object.

query[Q](target, /, *, through=None, transform=Transform((0, 0), 0, (1, 1)), opaque=None, refs=False, filter=None)[source]#

Convenience method to query this design. See query() for details.

Return type:

Generator[tuple[Trace, Q], None, None]

Parameters:
property nets#

The connectivity of this design computed by the runtime, as a Nets instance.

property layers#

Layer index and board side arithmetic for this design’s stackup, as a Layers object.

class Net[N: Port](nets)[source]#

Bases: Generic[N]

A single net of a captured design.

nets holds the Net and TopologyNet objects that are connected, and name is their connected name.

Parameters:

nets (Sequence[Net[N] | TopologyNet[N]])

class Nets(uf)[source]#

Bases: object

A manager for looking up the net that an element belongs to.

Parameters:

uf (UnionFind[Net | TopologyNet])

find(element)[source]#

Look up the net an element belongs to.

Parameters:

element – A Net or TopologyNet, or an element the runtime assigned to a net, such as a Copper or a Via.

Return type:

Net | None

Returns:

The Net the element is on, or None if it is not on any net of this design.

class Layers(stackup)[source]#

Bases: object

A manager for layer index and board side arithmetic.

Parameters:

stackup (Stackup)

normalize(layer)[source]#

Return a 0-indexed layer counted from the top conductor.

Parameters:

layer (int) – The layer index to normalize (supports negative indexing).

Returns:

A normalized 0-indexed integer.

apply(transform, layer)[source]#

Return the conductor index, counted from the top, that an element on layer ends up on once transform is applied.

Parameters:
  • transform (Transform | Placement) – The Transform or Placement to apply.

  • layer (int) – The conductor layer index to transform.

Return type:

int

Returns:

The resulting normalized conductor layer index.

side(transform, feature)[source]#

Return the board side a SurfaceFeature ends up on with a transform applied.

Parameters:
Return type:

Side

Returns:

The resulting Side.

class AsyncRuntimeDesign[T: Design](state, name, runtime)[source]#

Bases: RuntimeDesign[T], Generic[T]

Parameters:
  • state (_DesignState[T])

  • name (str)

  • runtime (Runtime)

property layout: AsyncLayout#

The physical design (layout) of this design in the runtime: requests that change it, e.g. await design.layout.place(...), and monitor for callbacks on its changes. Changes are applied to root as the runtime reports them.

async capture(*, wait=5.0)[source]#

Capture the runtime’s physical layout back into this design. See Runtime.capture().

Parameters:

wait (float)

async issues(*, categories=None, satisfied=False, wait=5.0)[source]#

Query the physical-design issues of this design. See Runtime.issues().

Return type:

IssueReport

Parameters:
property configuration: AsyncConfiguration#

requests that change settings applied on its next load, e.g. await design.configuration.reassign_reference_designators(...).

Type:

The configuration of this design in the runtime

class SyncRuntimeDesign[T: Design](state, name, runtime, runasync)[source]#

Bases: RuntimeDesign[T], Generic[T]

Parameters:
  • state (_DesignState[T])

  • name (str)

  • runtime (Runtime)

  • runasync (_RunAsync)

property layout: SyncLayout#

The physical design (layout) of this design in the runtime: requests that change it, e.g. design.layout.place(...), and monitor for callbacks on its changes. Changes are applied to root as the runtime reports them.

capture(*, wait=5.0)[source]#

Capture the runtime’s physical layout back into this design. See Runtime.capture().

Parameters:

wait (float)

issues(*, categories=None, satisfied=False, wait=5.0)[source]#

Query the physical-design issues of this design. See Runtime.issues().

Return type:

IssueReport

Parameters:
property configuration: SyncConfiguration#

requests that change settings applied on its next load, e.g. design.configuration.reassign_reference_designators(...).

Type:

The configuration of this design in the runtime