From f5946ca8be0dc069c2b59f282685889b57a3cad3 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 21 Oct 2024 10:48:32 +0100 Subject: [PATCH] add returns an AbstractSDRAM --- pacman/model/resources/constant_sdram.py | 2 +- pacman/model/resources/shared_sdram.py | 4 ++-- pacman/model/resources/variable_sdram.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pacman/model/resources/constant_sdram.py b/pacman/model/resources/constant_sdram.py index 03fd778c4..8f4f56968 100644 --- a/pacman/model/resources/constant_sdram.py +++ b/pacman/model/resources/constant_sdram.py @@ -54,7 +54,7 @@ def __eq__(self, other: Any) -> bool: return False return other.fixed == self.fixed - def __add__(self, other): + def __add__(self, other: AbstractSDRAM) -> AbstractSDRAM: if isinstance(other, ConstantSDRAM): return ConstantSDRAM( self._sdram + other.fixed) diff --git a/pacman/model/resources/shared_sdram.py b/pacman/model/resources/shared_sdram.py index cefeb2331..7a7462021 100644 --- a/pacman/model/resources/shared_sdram.py +++ b/pacman/model/resources/shared_sdram.py @@ -13,7 +13,7 @@ # limitations under the License. import math -from typing import Any, Dict, Optional, Self, TextIO, Union +from typing import Any, Dict, Optional, TextIO, Union import numpy @@ -96,7 +96,7 @@ def __eq__(self, other: Any) -> bool: return self._shared == other._shared @overrides(AbstractSDRAM.__add__) - def __add__(self, other: AbstractSDRAM) -> Self: + def __add__(self, other: AbstractSDRAM) -> AbstractSDRAM: if isinstance(other, (ConstantSDRAM, VariableSDRAM)): return SharedSDRAM(self._shared, self._per_core + other) elif isinstance(other, SharedSDRAM): diff --git a/pacman/model/resources/variable_sdram.py b/pacman/model/resources/variable_sdram.py index 03e75dd93..6fdf2b1d9 100644 --- a/pacman/model/resources/variable_sdram.py +++ b/pacman/model/resources/variable_sdram.py @@ -87,7 +87,7 @@ def __eq__(self, other: Any) -> bool: else: return False - def __add__(self, other: AbstractSDRAM) -> 'VariableSDRAM': + def __add__(self, other: AbstractSDRAM) -> AbstractSDRAM: if isinstance(other, ConstantSDRAM): return VariableSDRAM( self._fixed_sdram + other.fixed, self._per_timestep_sdram)