Skip to content

Commit

Permalink
add returns an AbstractSDRAM
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Oct 21, 2024
1 parent 7666539 commit f5946ca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pacman/model/resources/constant_sdram.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pacman/model/resources/shared_sdram.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion pacman/model/resources/variable_sdram.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f5946ca

Please sign in to comment.