From 531a37d693e679f6ede2a6037dd9df834f9a44c4 Mon Sep 17 00:00:00 2001 From: Jan Adler Date: Mon, 6 May 2024 13:46:47 +0000 Subject: [PATCH] Revert "Merge branch 'fix-matced-filter-port-selection' into 'master'" --- hermespy/core/duplex.py | 24 ++++++------------------ hermespy/jcas/jcas.py | 24 +++--------------------- 2 files changed, 9 insertions(+), 39 deletions(-) diff --git a/hermespy/core/duplex.py b/hermespy/core/duplex.py index f9245c79..d8f5e7a7 100644 --- a/hermespy/core/duplex.py +++ b/hermespy/core/duplex.py @@ -8,7 +8,7 @@ from __future__ import annotations from abc import abstractmethod from h5py import Group -from typing import Generic, Sequence +from typing import Generic from .device import Device, OperatorSlot, ReceptionType, Receiver, TransmissionType, Transmitter from .signal_model import Signal @@ -31,12 +31,7 @@ class DuplexOperator( __device: Device | None def __init__( - self, - device: Device | None = None, - reference: Device | None = None, - selected_transmit_ports: Sequence[int] | None = None, - selected_receive_ports: Sequence[int] | None = None, - seed: int | None = None, + self, device: Device | None = None, reference: Device | None = None, seed: int | None = None ): """ Args: @@ -45,11 +40,10 @@ def __init__( Device the duplex operator operates. """ - self.__device = None - - Transmitter.__init__(self, seed, selected_transmit_ports) - Receiver.__init__(self, seed, reference, selected_receive_ports) + Transmitter.__init__(self, seed=seed) + Receiver.__init__(self, seed=seed, reference=reference) + self.__device = None self.device = device @property @@ -63,11 +57,7 @@ def device(self) -> Device | None: @device.setter def device(self, value: Device | None) -> None: - # Abort if the device is already assigned - if self.__device is value: - return - - if value is None and self.__device is not None: + if self.__device is not None: self.__device.transmitters.remove(self) self.__device.receivers.remove(self) @@ -77,8 +67,6 @@ def device(self, value: Device | None) -> None: value.transmitters.add(self) value.receivers.add(self) - return - @Transmitter.slot.setter def slot(self, value: OperatorSlot[Transmitter]) -> None: if value is not None and self.device is not value.device: diff --git a/hermespy/jcas/jcas.py b/hermespy/jcas/jcas.py index 57a5b8fd..2fcd0cd7 100644 --- a/hermespy/jcas/jcas.py +++ b/hermespy/jcas/jcas.py @@ -2,7 +2,7 @@ from __future__ import annotations from abc import abstractmethod -from typing import Generic, Sequence, Type +from typing import Generic, Type from h5py import Group @@ -68,14 +68,7 @@ class DuplexJCASOperator( cube from the received backscattered power. """ - def __init__( - self, - device: Device | None = None, - waveform: CWT | None = None, - selected_transmit_ports: Sequence[int] | None = None, - selected_receive_ports: Sequence[int] | None = None, - **kwargs, - ) -> None: + def __init__(self, device: Device | None = None, waveform: CWT | None = None, **kwargs) -> None: """ Args: @@ -85,23 +78,12 @@ def __init__( waveform (CWT, optional): Communication waveform emitted by this operator. - - selected_transmit_ports (Sequence[int], optional): - Selected transmit ports of the device. - - selected_receive_ports (Sequence[int], optional): - Selected receive ports of the device. """ # Initialize base classes TransmittingModemBase.__init__(self) ReceivingModemBase.__init__(self, **kwargs) - RadarBase.__init__( - self, - device=device, - selected_transmit_ports=selected_transmit_ports, - selected_receive_ports=selected_receive_ports, - ) + RadarBase.__init__(self, device=device) # Initialize class attributes self.device = device