prdtools.designer¶
- class prdtools.designer.Designer(aspect_ratio_min: numbers.Number = 0.4, aspect_ratio_max: numbers.Number = 2.5)[source]¶
Bases:
objectA 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_ratiomust be within the range (aspect_ratio_min,aspect_ratio_max)prime_nummust 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 forncolsIterates through all possible values for
nrowsthat are valid using the constraints listed inis_valid(). For each valid result, aDesignResultis yielded.
- from_prime_num(prime_num: int) Iterable[prdtools.designer.DesignResult][source]¶
Find possible choices for
ncolsandnrowsfor the given prime numberIterates through all coprime pairs of
prime_num - 1that match the constraints listed inis_valid(). For each valid pair, aDesignResultis yielded.
- class prdtools.designer.DesignResult(ncols: int, nrows: int, prime_num: int)[source]¶
Bases:
objectResult 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
TableParametersinstance 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()