This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix it_nand; no ruff dbg on fab cli; fix picker_lib
- Loading branch information
1 parent
c4517bd
commit 7fcd85b
Showing
9 changed files
with
74 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This file is part of the faebryk project | ||
# SPDX-License-Identifier: MIT | ||
|
||
import logging | ||
from abc import abstractmethod | ||
from typing import TYPE_CHECKING, Iterable | ||
|
||
from faebryk.core.trait import Trait | ||
|
||
if TYPE_CHECKING: | ||
from faebryk.core.module import Module | ||
from faebryk.core.moduleinterface import ModuleInterface | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class can_specialize(Trait): | ||
""" | ||
Marks that a module can specialize other modules next to its bases. | ||
""" | ||
|
||
@abstractmethod | ||
def get_specializable_types( | ||
self, | ||
) -> Iterable[type["Module"] | type["ModuleInterface"]]: | ||
""" | ||
Returns a list of types that can be specialized by this module (in addition to | ||
its own type and the types of its bases). | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# This file is part of the faebryk project | ||
# SPDX-License-Identifier: MIT | ||
|
||
import logging | ||
from typing import Iterable, Sequence | ||
|
||
from faebryk.core.module import Module | ||
from faebryk.core.moduleinterface import ModuleInterface | ||
from faebryk.library.can_specialize import can_specialize | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class can_specialize_defined(can_specialize.impl()): | ||
def __init__( | ||
self, specializable_types: Sequence[type["Module"] | type["ModuleInterface"]] | ||
): | ||
super().__init__() | ||
self._specializable_types = specializable_types | ||
|
||
def get_specializable_types( | ||
self, | ||
) -> Iterable[type["Module"] | type["ModuleInterface"]]: | ||
return self._specializable_types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters