a
    ߙfbc                     @   s@  d Z ddlZddlZddlmZ ddlmZmZm	Z	m
Z
 ddlmZ ddlmZ ddlmZ ddlmZ G dd dZG d	d
 d
eZG dd dZG dd deZG dd deZG dd deZG dd dZG dd dZG dd dZG dd dZdd Zdd Zdd  Z d!d" Z!d#d$ Z"d%d& Z#d'd( Z$d)d* Z%dS )+z&Test behavior related to masked tables    N)ColumnMaskedColumnTableQTable)
BaseColumn)Time)Maskedc                   @   s   e Zd Zdd ZdS )	SetupDatac                 C   s   t dg ddd| _t dg ddd| _t d	g d
dd| _tg d| _t dg d| jd| _t| j| jgdd| _	t
dg dd| _t dg dddd| _d S )Na         r   namedata
fill_valueb         Tr   r   maskc)      	   FFTFd)r   r   r   maskedcar   r   sc))r         ?)r   g       @)r   g      @zi8,f8r   g      )r   r   dtyper   )r   r
   r   r   nparrayd_maskr   r   tr   r"   r$   )selfmethod r.   >lib/python3.9/site-packages/astropy/table/tests/test_masked.pysetup_method   s    
zSetupData.setup_methodN)__name__
__module____qualname__r0   r.   r.   r.   r/   r	      s   r	   c                   @   s   e Zd Zdd ZdS )
TestPprintc                 C   s   | j  g dksJ d S )N)z a   b z--- ---z  1  --z  2  --z  3  --)r+   Zpformatr,   r.   r.   r/   test_pformat   s    zTestPprint.test_pformatN)r1   r2   r3   r6   r.   r.   r.   r/   r4      s   r4   c                   @   s0   e Zd ZdZdd Zdd Zdd Zdd	 Zd
S )
TestFilledz0Test the filled method in MaskedColumn and Tablec                 C   sd   g d}dddgd| _ tdg dd|ddid	| _td
g dd|d| _tdg dd|d| _d S )N)TFFr   r   r   r
   r   r
   r   
   )r   r   r   r   metar   )g      @      @      @      $@)r   r   r   r   r   )7891)r:   r   r
   r   r   )r,   r-   r   r.   r.   r/   r0   $   s
    zTestFilled.setup_methodc                 C   s
  | j  }t|g dks J t|ts.J t|tr<J |jd dksNJ d|jd< d|d< | j d dksrJ | j jd dksJ | j d}t|g dksJ | j }t|g dksJ t|tsJ | j	 }t|g d	ksJ t|tsJ d S )
Nr9   r   r   r
   r   r   d      )rD   r   r   r=   r;   r<   rA   r?   r@   )
r
   filledr(   all
isinstancer   r   r:   r   r   )r,   fr.   r.   r/   test_filled_column+   s"    



zTestFilled.test_filled_columnc                 C   s   || j | j| jg| jd}| }t|ts0J |jdu s>J t	|d g dksXJ t
|d g dspJ t	|d g dksJ |jd d	d
gksJ d|jd d< |jd d	d
gksJ d|d d	< |d d	 d
ksJ d S )N)r:   Fr
   rB   r   rE   r   rF   r   r   rD   r   rC   )r
   r   r   r:   rG   rI   r   r!   r(   rH   Zallcloser,   Z
tableclassr+   rJ   r.   r.   r/   test_filled_masked_tableD   s    z#TestFilled.test_filled_masked_tablec                 C   s   |ddgd| j d}| }t|ts*J |jdu s8J t|d |d ksRJ t|d |d kslJ |j d dd	gksJ d
|j d d< |j d dd	gksJ d|d d< |d d dksJ d S )N)r   r   )34r8   )namesr:   Fr
   r   r   r   rD   r   rC   r   )r:   rG   rI   r   r!   r(   rH   rL   r.   r.   r/   test_filled_unmasked_tableU   s    z%TestFilled.test_filled_unmasked_tableN)r1   r2   r3   __doc__r0   rK   rM   rQ   r.   r.   r.   r/   r7   !   s
   r7   c                   @   sH   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dd Z
dS )TestFillValuez=Test setting and getting fill value in MaskedColumn and Tablec                 C   s4   | j jdksJ tdddgdd}|jdks0J dS )z<Check that setting fill_value in the MaskedColumn init worksr   r   xxxxyyyyZnoner   N)r
   r   r   r,   r   r.   r.   r/   test_init_set_fill_valueh   s    z&TestFillValue.test_init_set_fill_valuec                 C   s8   d| j _| j jdksJ t| j  g dks4J dS )z5Check set and get of fill value works for bare Column)r   rX   r   N)r   r   r(   rH   rG   r5   r.   r.   r/   'test_set_get_fill_value_for_bare_columnn   s    z5TestFillValue.test_set_get_fill_value_for_bare_columnc                 C   sd   t dddgddgd}d|_|jdks*J t| ddgksDJ t|d	d	dgks`J d S )
Nr   rT   rU   TFr   ZABCDEFZABCDZXY)r   r   r(   rH   rG   rV   r.   r.   r/   &test_set_get_fill_value_for_str_columnt   s
    z4TestFillValue.test_set_get_fill_value_for_str_columnc                 C   s   | j jtd| j jksJ | j  }|j dks8J dtjf|_|jtdtjf| j jksdJ t|dtj fd}|jtdtj f|jksJ d S )Nr&   )r   )	r$   r   r(   r)   r'   copyiteminfr   )r,   r$   Zsc2r.   r.   r/   -test_set_get_fill_value_for_structured_column|   s    
 z;TestFillValue.test_set_get_fill_value_for_structured_columnc                 C   s    d| j _| jd jdksJ dS )z4Table column mask is not ref of original column maskrX   r   N)r   r   r+   r5   r.   r.   r/   test_table_column_mask_not_ref   s    z,TestFillValue.test_table_column_mask_not_refc                 C   sD   d| j d _| j d jdks J t| j d  g dks@J dS )z;Check set and get of fill value works for Column in a Tabler   r   )r   r   r   N)r+   r   r(   rH   rG   r5   r.   r.   r/   (test_set_get_fill_value_for_table_column   s    z6TestFillValue.test_set_get_fill_value_for_table_columnc                 C   sV   d| j d _g d| j d _| j d jjdks2J t| j d jjg dksRJ dS )z8Check that .data attribute preserves fill_value and maskr   r   )TFTN)r+   r   r   r   r(   rH   r5   r.   r.   r/   !test_data_attribute_fill_and_mask   s    z/TestFillValue.test_data_attribute_fill_and_maskN)r1   r2   r3   rR   rW   rY   rZ   r`   ra   rb   rc   r.   r.   r.   r/   rS   e   s   	rS   c                   @   s0   e Zd ZdZdd Zdd Zdd Zdd	 Zd
S )TestMaskedColumnInitz!Initialization of a masked columnc                 C   sz   t | jj sJ t | jjs&J t | jj s:J t | jj| jksRJ d| jjd< t | jj| jkrvJ dS )z@Check that mask gets set properly and that it is a copy, not refTr   N)r(   rH   r
   r   r   r   r   r*   r5   r.   r.   r/   test_set_mask_and_not_ref   s    z.TestMaskedColumnInit.test_set_mask_and_not_refc                 C   s2   g d}t dg d|d}t|j|ks.J dS )zSet mask from a listr   r
   r   r   N)r   r(   rH   r   )r,   	mask_listr
   r.   r.   r/   test_set_mask_from_list   s    z,TestMaskedColumnInit.test_set_mask_from_listc                 C   s0   g d}t d| j|d}t|j|ks,J dS )zOverride existing mask valuesr   r   r   N)r   r   r(   rH   r   )r,   rf   r   r.   r.   r/   test_override_existing_mask   s    z0TestMaskedColumnInit.test_override_existing_maskc                 C   sF   ddg}t tj tdd|d W d   n1 s80    Y  dS )z.Incomplete mask specification raises MaskErrorFTr   r   )r   Zlengthr   N)pytestraisesmaZ	MaskErrorr   )r,   rf   r.   r.   r/   test_incomplete_mask_spec   s    z.TestMaskedColumnInit.test_incomplete_mask_specN)r1   r2   r3   rR   re   rg   rh   rl   r.   r.   r.   r/   rd      s
   	rd   c                   @   sx   e Zd ZdZejddejdddd Zejddejdddd	 Zd
d Z	dd Z
dd Zdd ZdS )TestTableInitzInitializing a tabletype_str)?r   Zi2Zf4Zc8SUOshape))r   )r   r   )r   r   r   c           	      C   s2  t td}tj||d|}| }t|g|gd}|d }|j|jksPJ t||ksbJ t	|t
u srJ t|dkrtjj|d< n2t|dkrtjj|d d< ntjj|d d d< tdd |D }t|g|gd}|d }|j|jksJ t||ksJ |j| sJ t	|tu s.J d	S )
zyTest init from list or list of lists with dtype specified, optionally
        including an np.ma.masked element.
        r   r'   col0r   r[   r   c                 s   s   | ]
}d V  qdS r[   Nr.   .0_r.   r.   r/   	<genexpr>       zKTestTableInit.test_init_from_sequence_data_numeric_typed.<locals>.<genexpr>N)listranger(   r)   reshapetolistr   r'   rH   typer   lenrk   r!   tupler   r   )	r,   rn   rs   r   np_datanp_data_listr+   collast_idxr.   r.   r/   *test_init_from_sequence_data_numeric_typed   s(    z8TestTableInit.test_init_from_sequence_data_numeric_typedc           
      C   s   t td}tj||d|}| }t|g}|d j}t|dkrVtj	j
|d< n2t|dkrttj	j
|d d< ntj	j
|d d d< tdd |D }t|g}|d }	|	j|ksJ t|	|ksJ |	j| sJ t|	tu sJ d	S )
z}Test init from list or list of lists with dtype NOT specified,
        optionally including an np.ma.masked element.
        r   rt   ru   r   r[   r   c                 s   s   | ]
}d V  qdS rv   r.   rw   r.   r.   r/   rz      r{   zMTestTableInit.test_init_from_sequence_data_numeric_untyped.<locals>.<genexpr>N)r|   r}   r(   r)   r~   r   r   r'   r   rk   r!   r   rH   r   r   r   )
r,   rn   rs   r   r   r   r+   Zdtype_expectedr   r   r.   r.   r/   ,test_init_from_sequence_data_numeric_untyped   s"    


z:TestTableInit.test_init_from_sequence_data_numeric_untypedc                    s   t | j| j| j| j| j| jg  jg dks2J  fdd D }t |} jD ]l} | j|| jksnJ t	
 | || kdt	jjfv sJ t	
t | ddt|| ddksRJ qRd S )N)r
   r   r   r   r"   r$   c                    s    g | ]  fd dj D qS )c                    s   i | ]}| | qS r.   r.   )rx   krowr.   r/   
<dictcomp>   r{   zQTestTableInit.test_initialization_with_all_columns.<locals>.<listcomp>.<dictcomp>)colnames)rx   t1r   r/   
<listcomp>   r{   zFTestTableInit.test_initialization_with_all_columns.<locals>.<listcomp>Tr   F)r   r
   r   r   r   r"   r$   r   r'   r(   rH   rk   r!   getattr)r,   Zlofdt2r   r.   r   r/   $test_initialization_with_all_columns   s     
&z2TestTableInit.test_initialization_with_all_columnsc                 C   sb   t | j| jg}|jdu sJ t | jg}|jdu s8J t | jtg dg}|jdu s^J dS )z9Masking is always False if initial masked arg is not TrueFr   N)r   r"   r
   r!   rk   r)   r,   r+   r.   r.   r/   &test_mask_false_if_input_mask_not_true  s    z4TestTableInit.test_mask_false_if_input_mask_not_truec                 C   sL   t ddggdd}t |dd}t |dd}|jr4J |js>J |jrHJ dS )z:Masking not true if not (requested or input requires mask)r   r   Fr    TN)r   r!   )r,   Zt0r   r   r.   r.   r/   "test_mask_false_if_no_input_masked  s    

z0TestTableInit.test_mask_false_if_no_input_maskedc                 C   s   | j }t|jd tg dks(J t|jd tg dksJJ tg d|jd< t|d jtg dksJ t| jgdd}|jd u sJ dD ],}||_d	D ]}t|| j|ksJ qqd S )
Nr
   )FFFr   )TTTr   Fr    )TFr8   )r+   r(   rH   r   r)   r   r"   )r,   r+   r   r   r   r.   r.   r/   test_mask_property  s    """z TestTableInit.test_mask_propertyN)r1   r2   r3   rR   ri   ZmarkZparametrizer   r   r   r   r   r   r.   r.   r.   r/   rm      s   		rm   c                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
TestAddColumnc                 C   s  t dd}|jsJ |tdg dg dd |js:J |tdg dg d	d |js`J t|d tsrJ t|d tsJ t|d tg dksJ t|d jtg dt	ksJ t|d tg dksJ t|d jtg d	t	ksJ d S )
NTr    r
   r   r   r   r   r   r   r   r   r   r   )
r   r!   
add_columnr   rI   r(   rH   r)   r   boolr   r.   r.   r/   &test_add_masked_column_to_masked_table+  s    



 $ z4TestAddColumn.test_add_masked_column_to_masked_tablec                 C   s   t dd}|jrJ |tdg dd |jr4J |tdg dg dd	 |jrZJ t|d tslJ t|d ts~J t|d tg dksJ t	|d d
rJ t|d tg dksJ t|d j
tg dtksJ d S )NFr    r
   r   r#   r   r   r   r   r   )r   r!   r   r   r   rI   r(   rH   r)   hasattrr   r   r   r.   r.   r/   *test_add_masked_column_to_non_masked_table9  s    



  z8TestAddColumn.test_add_masked_column_to_non_masked_tablec                 C   s  t dd}|jsJ |tdg dd |js4J |tdg dg dd	 |jsZJ t|d tslJ t|d ts~J t|d tg dksJ t|d j	tg d
t
ksJ t|d tg dksJ t|d j	tg dt
ksJ d S )NTr    r
   r   r#   r   r   r   r   r   r   r   )r   r!   r   r   r   rI   r(   rH   r)   r   r   r   r.   r.   r/   *test_add_non_masked_column_to_masked_tableG  s    



 $ z8TestAddColumn.test_add_non_masked_column_to_masked_tablec                 C   s   t dd}|jrJ |tdg dd |jr4J |tdg dg dd	 |jrZJ t|d tg dkszJ t|d tg dksJ d S )
NFr    r
   r   r#   r   r   r   r   )r   r!   r   r   r   r(   rH   r)   r   r.   r.   r/   .test_convert_to_masked_table_only_if_necessaryU  s    



 z<TestAddColumn.test_convert_to_masked_table_only_if_necessaryN)r1   r2   r3   r   r   r   r   r.   r.   r.   r/   r   )  s   r   c                   @   s   e Zd Zdd ZdS )TestRenameColumnc                 C   s   t dd}|tdg dg dd d|d _|dd |jsFJ t|d tg dksfJ t|d j	tg dt
ksJ |d jdksJ |jdgksJ d S )	NTr    r
   r   r   r   *   r   )r   r   r   r   Zrename_columnr!   r(   rH   r)   r   r   r   r   r.   r.   r/   test_rename_masked_columnd  s    


 $z*TestRenameColumn.test_rename_masked_columnN)r1   r2   r3   r   r.   r.   r.   r/   r   b  s   r   c                   @   s   e Zd Zdd ZdS )TestRemoveColumnc                 C   s   t dd}|tdg dg dd d|d _|tdg d	g d
d |d |js`J t|d tg dksJ t|d j	tg dt
ksJ |d jdksJ |jdgksJ d S )NTr    r
   r   r   r   r   r   r   r   )r   r   r   r   Zremove_columnr!   r(   rH   r)   r   r   r   r   r.   r.   r/   test_remove_masked_columnr  s    



 $z*TestRemoveColumn.test_remove_masked_columnN)r1   r2   r3   r   r.   r.   r.   r/   r   p  s   r   c                   @   sL   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dS )
TestAddRowc                 C   s
  t dd}|tddgdgd |tddgdgd |jd	d
gddgd |jddgddgd |jspJ tt|d tg dksJ t|d jtg dt	ksJ tt|d tg dksJ t|d jtg dt	ksJ d S )NTr    r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   
r   r   r   add_rowr!   r(   rH   r)   r   r   r   r.   r.   r/   ,test_add_masked_row_to_masked_table_iterable  s    

&$&z7TestAddRow.test_add_masked_row_to_masked_table_iterablec                 C   s  t dd}|tddgdgd |tddgdgd |jd	d
ddddd |jddddddd |jsxJ tt|d tg dksJ t|d jtg dt	ksJ tt|d tg dksJ t|d jtg dt	ksJ d S )NTr    r
   r   r   r   r   r   r   r   r   r
   r8   r   r   r   r   r   r   r   r   r   r.   r.   r/   ,test_add_masked_row_to_masked_table_mapping1  s    

&$&z7TestAddRow.test_add_masked_row_to_masked_table_mapping1c                 C   s   t dd}|tddgdgd |tddgdgd |jdd	iddid
 |jddiddid
 |jspJ |d d dkr|d d dksJ t|d jtg dt	ksJ |d d d	ksJ t|d jtg dt	ksJ d S )NTr    r
   r   r   r   r   r   r   r   r   r   r   r   
r   r   r   r   r!   r(   rH   r   r)   r   r   r.   r.   r/   ,test_add_masked_row_to_masked_table_mapping2  s    

$$z7TestAddRow.test_add_masked_row_to_masked_table_mapping2c                 C   s   t dd}|tddgdgd |tddgdgd |dd	i |dd
i |js`J |d d dkr|d d d
ksJ t|d jtg dt	ksJ |d d d	ksJ t|d jtg dt	ksJ d S )NTr    r
   r   r   r   r   r   r   r   r   r   r   r   r   r.   r.   r/   ,test_add_masked_row_to_masked_table_mapping3  s    

$$z7TestAddRow.test_add_masked_row_to_masked_table_mapping3c                 C   s   t dd}|tddgdgd |tddgdgd tt&}|jdd	iddid
 W d    n1 sp0    Y  |jjd dksJ d S )NTr    r
   r   r   r   r   r   r   r   z&keys in mask should match keys in vals)	r   r   r   ri   rj   
ValueErrorr   valueargsr,   r+   excr.   r.   r/   ,test_add_masked_row_to_masked_table_mapping4  s    
4z7TestAddRow.test_add_masked_row_to_masked_table_mapping4c                 C   s   t dd}|tddgdgd |tddgdgd tt(}|jd	d
gdddd W d    n1 sr0    Y  |jjd dksJ tt(}|jd
d	dddgd W d    n1 s0    Y  |jjd dksJ d S )NTr    r
   r   r   r   r   r   r   r   r8   r   z&Mismatch between type of vals and maskr   )	r   r   r   ri   rj   	TypeErrorr   r   r   r   r.   r.   r/   ,test_add_masked_row_to_masked_table_mismatch  s    
66z7TestAddRow.test_add_masked_row_to_masked_table_mismatchc                 C   s`  t dd}dg|d< dg|d< tdgdd|d	< td
dd}|jrFJ |d
d|g |jr`J |jdd|gg dd |jrJ t|d tu sJ t|d tu sJ t|d	 tu sJ t|d g dksJ t|d j	g dksJ t|d j
g dksJ t|d	 d d
 tdd
gddks>J t|d	 j
g dks\J d S )NFr    r   r
   r   r   cxcsecformatr   r   r   r   r   )r   r   r   r   r   r   )FFT)r   r   r!   r   r   r   r   r(   rH   r   r   )r,   r+   tmr.   r.   r/   0test_add_masked_row_to_non_masked_table_iterable  s$    





,z;TestAddRow.test_add_masked_row_to_non_masked_table_iterablec                 C   s   t  }ddgtj |d< |dtj f tt&}|jdtj fdd W d    n1 s`0    Y  |jjd 	 dd	gksJ d S )
Nr   r   r
   r   )Tr   r   z8Unable to insert row because of exception in column 'a':zFmask was supplied for column 'a' but it does not support masked values)
r   umr   ri   rj   r   r   r   
splitlinesr   r.   r.   r/   0test_add_row_cannot_mask_column_raises_typeerror  s    4z;TestAddRow.test_add_row_cannot_mask_column_raises_typeerrorN)r1   r2   r3   r   r   r   r   r   r   r   r   r.   r.   r.   r/   r     s   
r   c                  C   sJ  t g d} | tddfD ]&}tdd}tg d|d< tg d| d	|d
< tg dg dd	|d< |d | |d
 |< |d
 d |d d
 ksJ |d
 d t jju sJ |d
 d dksJ |d
 d dksJ |d
 d dksJ t |d
 j	|j	d
 ksJ |j	
 }t t||d< t |j	d
 |d
 ksJ qdS )zTest issue in #2997)TTFFr   r   Tr    )r   r   r   r   r
   )      !   ,   r   r   )o      iM  i  )TFTFr   r   r   r   r   r   r   N)r(   r)   slicer   r   r   rk   r!   rH   r   r]   Zaranger   )Zmask_bZselectr+   Zmask_before_addr.   r.   r/   test_setting_from_masked_column  s     
 
r   c                  C   s   t ddgidd} | d d t | dgtjgd}t|d jtjsJJ tdg}|d t|tjd}t|jtjs~J dS )	zU
    Test that masked column fill_value is coerced into the correct column type.
    r
   rA   Tr    0)rP   r'   rt   N)r   Zset_fill_valuer(   Zint32rI   r   r   )r+   r   r   c2r.   r.   r/   test_coercing_fill_value_type  s    

r   c                  C   s^   t ddgddgd} t | dd}d|jd< t| jddgksBJ t|jddgksZJ dS )	z@Test that the mask is copied when copying a table (issue #7362).r   r   FTr   )r]   r   N)r   r   r(   rH   )r   r   r.   r.   r/   test_mask_copy  s
    
r   c                  C   sD  t  } tddgdd| d< ddg| d< d	d
gtj | d< |  }t|tjrZt|tjj	r^J tjj
| d d< |  }t|tjj	sJ t|d jddgksJ t|d d jdsJ t|d jdksJ t|d jdksJ | j}t|d ddgksJ t|d dks(J t|d dks@J dS )zGTest that as_array() and Table.mask attr work with masked mixin columnsr   r   r   r   r
   r   r   r   r   r   r   FTr   r%   N)r   r   r   r   Zas_arrayrI   r(   ndarrayrk   MaskedArrayr!   rH   r   Ziscloser   )r+   Ztar   r.   r.   r/   test_masked_as_array_with_mixin  s"    r   c                  C   s   t tj} t }tddg|d< t|d ts2J tddgtjd|d< t|d | sZJ t|d j	dksrJ tddgtjddgd|d	< t|d	 | sJ t|d	 j	ddgksJ d
S )zOTest that adding a MaskedColumn with a unit to QTable creates a MaskedQuantity.r   r   r
   unitr   FTr   r   r   N)
r   r   Quantityr   r   rI   r   r(   rH   r   ZMaskedQuantityr+   r.   r.   r/   &test_masked_column_with_unit_in_qtable9  s    
r   c                  C   s   t tj} t }| ddgtjd|d< t|d ts8J t|d j	dksPJ | ddgtjddgd|d< t|d ts~J t|d j	ddgksJ d S )	Nr   r   r   r   FTr   r   )
r   r   r   r   r   rI   r   r(   rH   r   r   r.   r.   r/   test_masked_quantity_in_tableJ  s    
r   c                  C   sF   t ddgddgd} | j}t|tjju s.J t|jtju sBJ d S )Nr   r   FTr   )r   r   r   r(   rk   r   r   )r   Zc_datar.   r.   r/   7test_masked_column_data_attribute_is_plain_masked_arrayV  s    r   c                     s   G  fdddt  G  fdddtt } | ddgddgd	} jdksNJ |d
d
 } jdkshJ t|  jdks~J d
S )z[Check that we don't finalize MaskedColumn too often.

    Regression test for gh-6721.
    c                       s"   e Zd ZdZ fddZ  ZS )z<test_mask_slicing_count_array_finalize.<locals>.MyBaseColumnr   c                    s   t  |   jd7  _d S )Nr   )super__array_finalize__counter)r,   objMyBaseColumn	__class__r.   r/   r   g  s    zOtest_mask_slicing_count_array_finalize.<locals>.MyBaseColumn.__array_finalize__)r1   r2   r3   r   r   __classcell__r.   r   r   r/   r   d  s   r   c                       s   e Zd Z fddZ  ZS )z>test_mask_slicing_count_array_finalize.<locals>.MyMaskedColumnc                    s$   t  j| g|R i |} |_|S )N)r   __new__Z
_baseclass)clsr   kwargsr,   r   r.   r/   r   n  s    zFtest_mask_slicing_count_array_finalize.<locals>.MyMaskedColumn.__new__)r1   r2   r3   r   r   r.   r   r   r/   MyMaskedColumnm  s   r   r   r   FTr   N)r   r   r   r   repr)r   r   Zc0r.   r   r/   &test_mask_slicing_count_array_finalize]  s    	
r   )&rR   ri   Znumpyr(   Znumpy.mark   Zastropy.tabler   r   r   r   Zastropy.table.columnr   Zastropy.timer   Zastropy.utils.maskedr   Zastropy.unitsZunitsr   r	   r4   r7   rS   rd   rm   r   r   r   r   r   r   r   r   r   r   r   r   r.   r.   r.   r/   <module>   s4   D3r9n
