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

Commit

Permalink
Add checks to api picker for supersets & domain
Browse files Browse the repository at this point in the history
  • Loading branch information
iopapamanoglou committed Nov 15, 2024
1 parent c0d979c commit f802a0f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/faebryk/libs/picker/api/picker_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from faebryk.core.parameter import Parameter
from faebryk.core.solver import Solver
from faebryk.libs.e_series import E_SERIES, E_SERIES_VALUES
from faebryk.libs.library import L
from faebryk.libs.picker.api.api import (
CapacitorParams,
DiodeParams,
Expand Down Expand Up @@ -176,6 +177,12 @@ def _get_footprint_candidates(module: Module) -> list[FootprintCandidate]:
def _generate_si_values(
value: Parameter, solver: Solver, e_series: E_SERIES | None = None
) -> list[SIvalue]:
if not isinstance(value.domain, L.Domains.Numbers):
raise NotImplementedError(f"Parameter {value} is not a number")

if not solver.inspect_known_supersets_are_few(value):
raise NotImplementedError(f"Parameter {value} has too many known supersets")

candidate_ranges = solver.inspect_get_known_superranges(value)
return generate_si_values(candidate_ranges, e_series=e_series)

Expand Down

0 comments on commit f802a0f

Please sign in to comment.