Skip to content

Commit

Permalink
Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nala1712 authored and daquintero committed Jul 30, 2024
1 parent ad40c82 commit 97c952a
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 10 deletions.
2 changes: 1 addition & 1 deletion piel/experimental/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .cables import rg164
from .cables import rg164, generic_sma, generic_banana
from .multimeter import DMM6500
from .rf_passives import create_power_splitter_1to2
from .rf_calibration import (
Expand Down
60 changes: 59 additions & 1 deletion piel/experimental/models/cables.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
from ...types import CoaxialCable, CoaxialCableGeometryType
from ...types import CoaxialCable, CoaxialCableGeometryType, PhysicalPort, DCCable


def generic_banana(
name: str,
length_m: float,
**kwargs,
) -> DCCable:
ports = [
PhysicalPort(
name="IN",
domain="DC",
connector="Male",
),
PhysicalPort(
name="OUT",
domain="DC",
connector="Male",
)
]

return DCCable(
name=name,
ports=ports,
**kwargs,
)



def rg164(
length_m: float,
**kwargs,
) -> CoaxialCable:
geometry = CoaxialCableGeometryType(
length_m=length_m,
Expand All @@ -25,6 +52,37 @@ def rg164(
name="RG164",
geometry=geometry,
ports=ports,
**kwargs,
)


def generic_sma(
name: str,
length_m: float,
**kwargs,
) -> CoaxialCable:
geometry = CoaxialCableGeometryType(
length_m=length_m,
)

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

return CoaxialCable(
name=name,
geometry=geometry,
ports=ports,
**kwargs,
)


Expand Down
10 changes: 8 additions & 2 deletions piel/experimental/models/sourcemeter.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
from typing import Optional
from ...types import PhysicalPort
from ..types import Sourcemeter


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

if name is None:
name = "SMU2450"

ports = [
PhysicalPort(
name="FORCEHI",
Expand Down Expand Up @@ -31,4 +37,4 @@ def SMU2450(**kwargs) -> Sourcemeter:
),
]

return Sourcemeter(name="SMU2450", manufacturer="Keithley", ports=ports, **kwargs)
return Sourcemeter(name=name, manufacturer="Keithley", ports=ports, **kwargs)
12 changes: 6 additions & 6 deletions piel/types/electrical/cables.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,19 @@ class DCCable(Cable):
"""
A DC cable is a single core cable that is used to transmit direct current.
"""
geometry: DCCableGeometryType
heat_transfer: DCCableHeatTransferType
material_specification: DCCableMaterialSpecificationType
geometry: Optional[DCCableGeometryType] = None
heat_transfer: Optional[DCCableHeatTransferType] = None
material_specification: Optional[DCCableMaterialSpecificationType] = None


class CoaxialCable(Cable):
"""
A coaxial cable is a type of electrical cable that has an inner conductor surrounded by a tubular insulating layer,
surrounded by a tubular conducting shield.
"""
geometry: CoaxialCableGeometryType
heat_transfer: CoaxialCableHeatTransferType
material_specification: CoaxialCableMaterialSpecificationType
geometry: Optional[CoaxialCableGeometryType] = None
heat_transfer: Optional[CoaxialCableHeatTransferType] = None
material_specification: Optional[CoaxialCableMaterialSpecificationType] = None


CableHeatTransferTypes = Union[CoaxialCableHeatTransferType, DCCableHeatTransferType]
Expand Down

0 comments on commit 97c952a

Please sign in to comment.