prdtools.designer
¶
- class prdtools.designer.Designer(aspect_ratio_min: numbers.Number = 0.4, aspect_ratio_max: numbers.Number = 2.5)[source]¶
Bases:
object
A utility to assist in choosing correct values for
TableParameters
- aspect_ratio_min: numbers.Number¶
Minimum valid value for
aspect_ratio
- aspect_ratio_max: numbers.Number¶
Maximum valid value for
aspect_ratio
- is_valid() bool [source]¶
Check whether the current values are valid
aspect_ratio
must be within the range (aspect_ratio_min
,aspect_ratio_max
)prime_num
must be a prime number
- from_ncols(ncols: int) Iterable[prdtools.designer.DesignResult] [source]¶
Find possible choices for
nrows
(and thusprime_num
) with the given value forncols
Iterates through all possible values for
nrows
that are valid using the constraints listed inis_valid()
. For each valid result, aDesignResult
is yielded.
- from_prime_num(prime_num: int) Iterable[prdtools.designer.DesignResult] [source]¶
Find possible choices for
ncols
andnrows
for the given prime numberIterates through all coprime pairs of
prime_num - 1
that match the constraints listed inis_valid()
. For each valid pair, aDesignResult
is yielded.
- class prdtools.designer.DesignResult(ncols: int, nrows: int, prime_num: int)[source]¶
Bases:
object
Result from
Designer
- choose_primitive_root() int [source]¶
Find the smallest primitive root of
prime_num
- Raises
ValueError – if no primitive roots exist
- to_parameters(design_freq: int, prime_root: Optional[int] = None, well_width: Optional[float] = 3.81, speed_of_sound: Optional[int] = 343) prdtools.table.TableParameters [source]¶
Create a
TableParameters
instance using this resultAll arguments of this method will be passed to the constructor (documented
here
). If prime_root is not given, a value will be chosen bychoose_primitive_root()