Add functionality for building paths (single use wires/waveguides/etc)

This commit is contained in:
Jan Petykiewicz 2022-03-01 15:18:31 -08:00 committed by jan
commit 1c3c032434
3 changed files with 134 additions and 4 deletions

22
masque/builder/tools.py Normal file
View file

@ -0,0 +1,22 @@
"""
Tools are objects which dynamically generate simple single-use devices (e.g. wires or waveguides)
"""
from typing import TYPE_CHECKING, Optional, Sequence
if TYPE_CHECKING:
from .devices import Device
class Tool:
def path(
self,
ccw: Optional[bool],
length: float,
*,
in_ptype: Optional[str] = None,
out_ptype: Optional[str] = None,
port_names: Sequence[str] = ('A', 'B'),
**kwargs,
) -> 'Device':
raise NotImplementedError(f'path() not implemented for {type(self)}')