Skip to content

Commit

Permalink
🚧 Add more types
Browse files Browse the repository at this point in the history
  • Loading branch information
daquintero committed Jul 30, 2024
1 parent 9ea49f1 commit 52bec1b
Show file tree
Hide file tree
Showing 22 changed files with 380 additions and 213 deletions.
11 changes: 6 additions & 5 deletions piel/experimental/models/cables.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def generic_banana(
name="OUT",
domain="DC",
connector="Male",
)
),
]

return DCCable(
Expand All @@ -26,9 +26,9 @@ def generic_banana(
)



def rg164(
length_m: float,
name: str = "RG164",
**kwargs,
) -> CoaxialCable:
geometry = CoaxialCableGeometryType(
Expand All @@ -45,13 +45,14 @@ def rg164(
name="OUT",
domain="RF",
connector="SMA",
)
),
]

return CoaxialCable(
name="RG164",
name=name,
geometry=geometry,
ports=ports,
model="RG164",
**kwargs,
)

Expand All @@ -75,7 +76,7 @@ def generic_sma(
name="OUT",
domain="RF",
connector="SMA",
)
),
]

return CoaxialCable(
Expand Down
4 changes: 3 additions & 1 deletion piel/experimental/models/multimeter.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ def DMM6500(**kwargs) -> Multimeter:
),
]

return Multimeter(name="DMM6500", ports=ports, manufacturer="Keithley", **kwargs)
return Multimeter(
name="DMM6500", ports=ports, manufacturer="Keithley", model="DMM6500", **kwargs
)
10 changes: 6 additions & 4 deletions piel/experimental/models/oscilloscope.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
from ..types import Oscilloscope


def create_two_port_oscilloscope() -> Oscilloscope:
def create_two_port_oscilloscope(
name: str = "two_port_oscilloscope", **kwargs
) -> Oscilloscope:
ports = [
PhysicalPort(
name="CH1",
Expand All @@ -17,12 +19,12 @@ def create_two_port_oscilloscope() -> Oscilloscope:
]

return Oscilloscope(
name="two_port_oscilloscope",
name=name,
ports=ports,
)


def DPO73304(**kwargs) -> Oscilloscope:
def DPO73304(name: str = "DPO73304", **kwargs) -> Oscilloscope:
ports = [
PhysicalPort(
name="CH1",
Expand All @@ -37,5 +39,5 @@ def DPO73304(**kwargs) -> Oscilloscope:
]

return Oscilloscope(
name="DPO73304", ports=ports, manufacturer="Tektronix", **kwargs
name=name, ports=ports, manufacturer="Tektronix", model="DPO73304", **kwargs
)
8 changes: 4 additions & 4 deletions piel/experimental/models/rf_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@


def short_85052D():
return Short(name="short_85052D", manufacturer="Agilent")
return Short(name="short_85052D", model="85052D", manufacturer="Agilent")


def open_85052D():
return Open(name="open_85052D", manufacturer="Agilent")
return Open(name="open_85052D", model="85052D", manufacturer="Agilent")


def load_85052D():
return Load(name="load_82052D", manufacturer="Agilent")
return Load(name="load_82052D", model="85052D", manufacturer="Agilent")


def through_85052D():
return Through(name="through_82052D", manufacturer="Agilent")
return Through(name="through_82052D", model="85052D", manufacturer="Agilent")
67 changes: 64 additions & 3 deletions piel/experimental/models/rf_passives.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
from ...types import PhysicalPort, PowerSplitter
from typing import Optional
from functools import partial
from ...types import PhysicalPort, PowerSplitter, BiasTee


def create_power_splitter_1to2():
def create_power_splitter_1to2(name: Optional[str] = None):
if name is None:
name = "power_splitter_1to2"

ports = [
PhysicalPort(
name="IN",
Expand All @@ -21,6 +26,62 @@ def create_power_splitter_1to2():
]

return PowerSplitter(
name="power_splitter_1to2",
name=name,
ports=ports,
)


def create_bias_tee(name: Optional[str] = None):
if name is None:
name = "bias_tee"

ports = [
PhysicalPort(
name="IN_RF",
domain="RF",
connector="SMA",
),
PhysicalPort(
name="IN_DC",
domain="RF",
connector="SMA",
),
PhysicalPort(
name="OUT",
domain="RF",
connector="SMA",
),
]

return BiasTee(
name=name,
ports=ports,
)


def create_attenuator(name: Optional[str] = None):
if name is None:
name = "attenuator"

ports = [
PhysicalPort(
name="RF",
domain="RF",
connector="SMA",
),
PhysicalPort(
name="OUT",
domain="RF",
connector="SMA",
),
]

return BiasTee(
name=name,
ports=ports,
)


Picosecond5575A104 = partial(
create_bias_tee, manufacturer="Picosecond Pulse Labs", model="5575A104"
)
22 changes: 17 additions & 5 deletions piel/experimental/models/sourcemeter.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
from typing import Optional
from ...types import PhysicalPort
from ..types import Sourcemeter
from ..types import Sourcemeter, SourcemeterConfiguration


def SMU2450(name: Optional[str] = None,
**kwargs) -> Sourcemeter:

def create_dc_operating_point_configuration(
voltage_V: float,
) -> SourcemeterConfiguration:
return SourcemeterConfiguration(voltage_set_V=voltage_V)


def create_dc_sweep_configuration(
voltage_range_V: tuple[float, float],
) -> SourcemeterConfiguration:
return SourcemeterConfiguration(voltage_range_V=voltage_range_V)


def SMU2450(name: Optional[str] = None, **kwargs) -> Sourcemeter:
if name is None:
name = "SMU2450"

Expand Down Expand Up @@ -37,4 +47,6 @@ def SMU2450(name: Optional[str] = None,
),
]

return Sourcemeter(name=name, manufacturer="Keithley", ports=ports, **kwargs)
return Sourcemeter(
name=name, manufacturer="Keithley", model="", ports=ports, **kwargs
)
2 changes: 1 addition & 1 deletion piel/experimental/models/vna.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def E8364A(**kwargs) -> pe.types.VNA:
return pe.types.VNA(name="E8364A", manufacturer="Agilent", **kwargs)
return pe.types.VNA(name="E8364A", manufacturer="Agilent", model="E8364A", **kwargs)
25 changes: 21 additions & 4 deletions piel/experimental/models/waveform_generator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ...types import PhysicalPort, PulseSource
from ...types import PhysicalPort, PulseSource, SignalTimeSources
from ..types import WaveformGenerator, WaveformGeneratorConfiguration


Expand Down Expand Up @@ -38,9 +38,26 @@ def create_one_port_square_wave_waveform_generator(
name="two_port_oscilloscope",
ports=ports,
configuration=configuration,
manufacturer="Tektronix",
)


def AWG70001A(**kwargs) -> WaveformGenerator:
pass
def AWG70001A(signal: SignalTimeSources, **kwargs) -> WaveformGenerator:
# Configure the waveform generator
configuration = WaveformGeneratorConfiguration(signal=signal)

# Configure the ports
ports = [
PhysicalPort(
name="CH1",
domain="RF",
connector="SMA",
),
]

return WaveformGenerator(
name="AWG70001A",
ports=ports,
configuration=configuration,
manufacturer="Tektronix",
**kwargs
)
3 changes: 2 additions & 1 deletion piel/experimental/types/cryostat.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import Optional
from ...types import Environment, Component


Expand All @@ -6,7 +7,7 @@ class TemperatureStage(Environment, Component):
Standard definition for a generic temperature stage.
"""

surface_area_m2: float # TODO move to a geometry type.
surface_area_m2: Optional[float] = None # TODO move to a geometry type.


class Cryostat(Component):
Expand Down
6 changes: 4 additions & 2 deletions piel/experimental/types/dc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ class SourcemeterConfiguration(DeviceConfiguration):
not the experimental setup connectivity.
"""

current_limit_A: float
voltage_limit_V: float
voltage_set_V: Optional[float] = None
voltage_range_V: Optional[tuple] = None
current_limit_A: Optional[float] = None
voltage_limit_V: Optional[float] = None


class Sourcemeter(Device):
Expand Down
15 changes: 13 additions & 2 deletions piel/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

from .electrical.rf_passives import (
PowerSplitter,
BiasTee,
)

from .electro_optic import (
Expand All @@ -60,7 +61,18 @@
SwitchFunctionParameter,
SParameterCollection,
)
from .electronic import HVAMetricsType, LNAMetricsType, ElectronicCircuitComponent

from .electronic.core import (
ElectronicCircuit,
ElectronicChip,
ElectronicCircuitComponent,
)
from .electronic.amplifier import RFTwoPortAmplifier
from .electronic.hva import HVAMetricsType, HighVoltageTwoPortAmplifier
from .electronic.lna import LNAMetricsType, LowNoiseTwoPortAmplifier

from .frequency import FrequencyNetworkModel

from .file_system import ProjectType
from .integration import CircuitComponent
from .materials import (
Expand All @@ -81,7 +93,6 @@
from .signal.dc_data import SignalDC, DCSweepData

from .signal.frequency import (
SParameterNetwork,
TwoPortCalibrationNetworkCollection,
)

Expand Down
5 changes: 5 additions & 0 deletions piel/types/connectivity/physical.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ class PhysicalComponent(Component):
"""
The manufacturer of the device.
"""

model: Optional[str] = None
"""
The model of the device.
"""
17 changes: 15 additions & 2 deletions piel/types/electrical/rf_passives.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
from ...types import PhysicalComponent
from ...types import PhysicalComponent, MinimumMaximumType


class PowerSplitter(PhysicalComponent):
class RFComponent(PhysicalComponent):
bandwidth: MinimumMaximumType = None


class PowerSplitter(RFComponent):
pass


class BiasTee(RFComponent):
pass


class Attenuator(RFComponent):
nominal_attenuation_dB: float = None
pass
Loading

0 comments on commit 52bec1b

Please sign in to comment.