File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -667,14 +667,23 @@ def validate_simplex_subspace_from_config(specs: dict, _) -> None:
667667 )
668668
669669 simplex_coefficients = specs .get ("simplex_coefficients" , None )
670- if simplex_coefficients is not None and len (simplex_coefficients ) != len (
671- simplex_parameters
672- ):
673- raise ValueError (
674- f"'simplex_coefficients' must have one entry per 'simplex_parameters' "
675- f"entry, but got { len (simplex_coefficients )} coefficient(s) for "
676- f"{ len (simplex_parameters )} parameter(s)."
677- )
670+ if simplex_coefficients is not None :
671+ try :
672+ simplex_coefficients = converter .structure (
673+ simplex_coefficients , list [float ]
674+ )
675+ except (IterableValidationError , TypeError , ValueError ) as exc :
676+ raise ValueError (
677+ f"'simplex_coefficients' must be a list of numeric values."
678+ ) from exc
679+
680+ if len (simplex_coefficients ) != len (simplex_parameters ):
681+ raise ValueError (
682+ f"'simplex_coefficients' must have one entry per "
683+ f"'simplex_parameters' entry, but got "
684+ f"{ len (simplex_coefficients )} coefficient(s) for "
685+ f"{ len (simplex_parameters )} parameter(s)."
686+ )
678687
679688 product_parameters = specs .get ("product_parameters" , [])
680689 if product_parameters :
You can’t perform that action at this time.
0 commit comments