Add functionality for building paths (single use wires/waveguides/etc)
This commit is contained in:
parent
afcbd315ae
commit
1c3c032434
3 changed files with 134 additions and 4 deletions
22
masque/builder/tools.py
Normal file
22
masque/builder/tools.py
Normal 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)}')
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue