Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
iterate on jlbpcb set types/approach
Browse files Browse the repository at this point in the history
  • Loading branch information
NoR8quoh1r committed Oct 23, 2024
1 parent 3262529 commit 4cb7f84
Show file tree
Hide file tree
Showing 6 changed files with 790 additions and 731 deletions.
8 changes: 7 additions & 1 deletion src/faebryk/core/parameter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file is part of the faebryk project
# SPDX-License-Identifier: MIT

from collections.abc import Iterable
import logging
from enum import Enum, auto
from types import NotImplementedType
Expand Down Expand Up @@ -150,8 +151,13 @@ def new(self2):

self.inspect_final = new

# def inspect_num_known_supersets(self) -> int: ...
# Could be exponentially many
def inspect_num_known_supersets(self) -> int:
raise Exception("not implemented")

# def inspect_get_known_supersets(self) -> Iterable[P_Set]: ...
def inspect_get_known_superranges(self: NumberLike) -> Iterable[Ranges]:
raise Exception("not implemented")

# ----------------------------------------------------------------------------------
def __add__(self, other: NumberLike):
Expand Down
6 changes: 1 addition & 5 deletions src/faebryk/core/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,12 @@ def get_any_single(
constrain_result: bool = True,
) -> tuple[Any, list[Parameter]]: ... # TODO Any -> NumberLike?

# make at least one of the passed predicates true
# make at least one of the passed predicates true, unless that is impossible
# while trying to minimize the value of the optional minimize expression
# there is no specific order in which the predicates are solved
# suppose_constraint can be added, which by constraining the solution further can make solving easier

Check failure on line 42 in src/faebryk/core/solver.py

View workflow job for this annotation

GitHub Actions / pytest

Ruff (E501)

src/faebryk/core/solver.py:42:89: E501 Line too long (105 > 88)
# it is only in effect for the duration of the solve call
# constrain_solved will add the solutions as constraints
# returns a tuple of two lists:
# - the first list contains the predicates that were actually solved, i.e. they are true/false
# - the second list contains the expressions that remain unknown
# - the third list contains the parameters that have an empty solution set
def assert_any_predicate[ArgType](
self,
G: Graph,
Expand Down
2 changes: 2 additions & 0 deletions src/faebryk/libs/library/L.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
from faebryk.core.reference import reference # noqa: F401
from faebryk.libs.sets import ( # noqa: F401
Empty,
P_Set,
P_UnitSet,
PlainSet,
Range,
Ranges,
Expand Down
Loading

0 comments on commit 4cb7f84

Please sign in to comment.