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.
- Loading branch information
1 parent
5c28132
commit f96d5f2
Showing
6 changed files
with
60 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# This file is part of the faebryk project | ||
# SPDX-License-Identifier: MIT | ||
|
||
import logging | ||
|
||
import faebryk.library._F as F # noqa: F401 | ||
from faebryk.libs.library import L # noqa: F401 | ||
from faebryk.libs.units import P | ||
from faebryk.libs.util import times # noqa: F401 | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class MultiCapacitor(F.Capacitor): | ||
""" | ||
TODO: Docstring describing your module | ||
""" | ||
|
||
# ---------------------------------------- | ||
# modules, interfaces, parameters | ||
# ---------------------------------------- | ||
|
||
# ---------------------------------------- | ||
# traits | ||
# ---------------------------------------- | ||
|
||
def __init__(self, count: int): | ||
self._count = count | ||
|
||
@L.rt_field | ||
def capacitors(self) -> list[F.Capacitor]: | ||
return times(self._count, F.Capacitor) | ||
|
||
def __preinit__(self): | ||
# ------------------------------------ | ||
# connections | ||
# ------------------------------------ | ||
|
||
# ------------------------------------ | ||
# parametrization | ||
# ------------------------------------ | ||
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
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
f_field, | ||
list_field, | ||
rt_field, | ||
list_f_field, | ||
) | ||
|
||
logger = logging.getLogger(__name__) | ||