Constrained tuning: Difference between revisions

Computation: update the code to handle a few exception cases
m Computation: update the code
Line 46: Line 46:
{{Databox| Code |
{{Databox| Code |
<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
# © 2020-2022 Flora Canou | Version 0.12.2
# © 2020-2022 Flora Canou | Version 0.15.1
# This work is licensed under the GNU General Public License version 3.
# This work is licensed under the GNU General Public License version 3.


Line 104: Line 104:


     if not stretch_monzo is None:
     if not stretch_monzo is None:
         if stretch_monzo.shape[1] != 1:
         if np.array (stretch_monzo).ndim > 1 and np.array (stretch_monzo).shape[1] != 1:
             raise IndexError ("only one stretch target is allowed. ")
             raise IndexError ("only one stretch target is allowed. ")
         elif (tempered_size := gen @ map @ stretch_monzo) == 0:
         elif (tempered_size := gen @ map @ stretch_monzo) == 0: