o
    da                     @   s  d dl Zd dlZd dlm  mZ d dlZd dlm	Z	 d dl
mZ d dlmZ ejdd Zejjejdd Zejejdejejgejd	d geg d
fdgeg d
fdgeg d
fd dgeg d
g dgjfd dgeg d
g dgjfg deg d
g dg dgjfddgeg d
g dgjfddgeg d
g dgjfddgeg d
g dgjfg	dd ZdS )    N)	DataFrame)	get_arrayc                 C   s  t g dg dd}g d|d< |d d  }tdd |jjD s$J |  |jjd j s3J tt	|d	t	|d	sAJ |jjd
 j rLJ |jjd j rWJ |jjd
 j sbJ |jjd j rmJ | rd|j
d< |jjd
 j rJ |jd dksJ d S d S )N         皙?g?g333333?ab         cc                 s   s    | ]}|j  V  qd S )N)refshas_reference).0blk r   j/var/www/html/visualizacion-main/env/lib/python3.10/site-packages/pandas/tests/copy_view/test_internals.py	<genexpr>   s    z#test_consolidate.<locals>.<genexpr>r   r   r   r   g        )r   r   )r   r   r	   )r   all_mgrblocks_consolidate_inplacer   r   npshares_memoryr   ilocloc)using_copy_on_writedfsubsetr   r   r   test_consolidate   s"   
r$   c                  C   s   t ddp tg dg dd} | d d  }d|jd< | jd dks&J dt jj_tg dg dd} | d d  }d|jd< | jd d	ksJJ dt jj_tg dg dd} | d d  }d|jd< | jd dksnJ W d    d S 1 syw   Y  d S )
Nzmode.copy_on_writeFr   r   r
   r   )r   r   Tr   )pdoption_contextr   r   optionsmodecopy_on_write)r"   r#   r   r   r   test_switch_options0   s    




"r*   dtypez	locs, arr)r   r   )ir   )r   r   r   r   c           	      C   s   t g dg dg dg dg dg dd}||}| }|jd d}|jj||d	d
 t|| | rUt|jD ]\}}||vrRt	
t||t||sRJ q<d S |jD ]}t	
t||t||rhJ qXd S )Nr   r   )      	   )
         )         )r   r   r   )r   r   r   def)deepT)inplace)r   astypecopyr   isettmassert_frame_equal	enumeratecolumnsr   r   r   )	r!   locsarrr+   r"   df_origdf2icolr   r   r   test_iset_splits_blocks_inplaceN   s.   


rL   )numpyr   pytestpandas.util._test_decoratorsutil_test_decoratorstdpandasr%   r   pandas._testing_testingrB   pandas.tests.copy_view.utilr   skip_array_manager_invalid_testr$   mark
single_cpur*   parametrizeintpint8arrayTrL   r   r   r   r   <module>   s8    
#$