
    Tid                          d dl Zd dlmZ d ZdS )    N)Boundsc           
      j   | at          j        t           j         g|z  t           j                  }t          j        t           j        g|z  t           j                  }||fS t	          | t
                    rt          j        | j        t           j                  }t          j        | j        t           j                  }t          j        |t           j         t          j	        |t          |          z
            z  f          }t          j        |t           j        t          j	        |t          |          z
            z  f          }||fS t          j        d | D             t           j                  }t          j        d | D             t           j                  }t          j        |t           j         t          j	        |t          |          z
            z  f          }t          j        |t           j        t          j	        |t          |          z
            z  f          }||fS )a  
    `bounds` can either be an object with the properties lb and ub, or a list of tuples
    indicating a lower bound and an upper bound for each variable. If the list contains
    fewer entries than the length of x0, the remaining entries will generated as -/+ infinity.
    Some examples of valid lists of tuple, assuming len(x0) == 3:
    [(0, 1), (2, 3), (4, 5)] -> returns [0, 2, 4], [1, 3, 5]
    [(0, 1), (None, 3)]      -> returns [0, -inf, -inf], [1, 3, inf]
    [(0, 1), (-np.inf, 3)]   -> returns [0, -inf, -inf], [1, 3, inf]
    N)dtypec                 H    g | ]}|d          |d          nt           j          S )r   npinf.0bounds     y/var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/scipy/_lib/pyprima/common/_bounds.py
<listcomp>z"process_bounds.<locals>.<listcomp>   s-    UUUUuQx3588"&UUU    c                 F    g | ]}|d          |d          nt           j        S )   r   r
   s     r   r   z"process_bounds.<locals>.<listcomp>   s+    TTTEuQx3588TTTr   )r   arrayr	   float64
isinstancer   lbubconcatenateoneslen)boundslenx0r   r   s       r   process_boundsr      s    ~XwioRZ888XrvhunBJ7772v&&!! Xfirz222Xfirz222^R"&R)A)A!ABCC^RB(@(@!@ABB2v 
UUfUUU]_]g	h	h	hB	TTVTTT\^\f	g	g	gB	bfWRWUSWW_%=%==>	?	?B	RVBGECGGO$<$<<=	>	>Br6Mr   )numpyr   scipy.optimizer   r    r   r   <module>r       s<        ! ! ! ! ! !    r   