관리-도구
편집 파일: test_function_base.cpython-37.pyc
B ��Fd=� � @ s* d dl mZmZmZ d dlZd dlZd dlZd dlZd dlZ d dl mZmZm Z mZmZmZmZmZmZmZmZmZmZmZ d dlmZ d dlm mZ d dlm Z d dl!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZCmDZD d dlEmFZF dd � ZGG d d� de�ZHG dd � d e�ZIG dd� de�ZJG dd� de�ZKG dd� de�ZLG dd� de�ZMG dd� de�ZNG dd� de�ZOG dd� de�ZPG dd� de�ZQG dd� de�ZRG d d!� d!e�ZSG d"d#� d#e�ZTG d$d%� d%e�ZUG d&d'� d'e�ZVG d(d)� d)e�ZWG d*d+� d+e�ZXG d,d-� d-e�ZYG d.d/� d/e�ZZG d0d1� d1e�Z[G d2d3� d3e�Z\G d4d5� d5e�Z]G d6d7� d7e�Z^G d8d9� d9e�Z_G d:d;� d;e�Z`G d<d=� d=e�ZaG d>d?� d?e�ZbG d@dA� dAe�ZcG dBdC� dCe�ZdG dDdE� dEe�ZeG dFdG� dGe�ZfG dHdI� dIe�ZgG dJdK� dKe�ZhG dLdM� dMe�ZiG dNdO� dOe�ZjG dPdQ� dQe�ZkG dRdS� dSe�ZlG dTdU� dUe�ZmG dVdW� dWe�ZnG dXdY� dYe�ZodZd[� ZpG d\d]� d]e�ZqG d^d_� d_e�ZrG d`da� dae�ZsG dbdc� dce�Zteuddk�r&e� dS )e� )�division�absolute_import�print_functionN)�run_module_suite�TestCase�assert_�assert_equal�assert_array_equal�assert_almost_equal�assert_array_almost_equal� assert_raises�assert_allclose�assert_array_max_ulp�assert_warns�assert_raises_regex�dec�suppress_warnings)�HAS_REFCOUNT)�rand)#�add_newdoc_ufunc�angle�average�bartlett�blackman�corrcoef�cov�delete�diff�digitize�extract�flipud�gradient�hamming�hanning� histogram�histogramdd�i0�insert�interp�kaiser�meshgrid�msort� piecewise�place�rot90�select�setxor1d�sinc�split�trapz� trim_zeros�unwrap�unique� vectorize)�longc C s t �| �}t j�||�}|S )N)�np�arange�add�outer)�n�data� r? ��/builddir/build/BUILDROOT/alt-python37-numpy-1.13.3-8.el8.x86_64/opt/alt/python37/lib64/python3.7/site-packages/numpy/lib/tests/test_function_base.py�get_mat s rA c @ s$ e Zd Zdd� Zdd� Zdd� ZdS )� TestRot90c C s� | � ttt�d�� tttt�d�dd� tttt�d�dd� tttt�d�dd� tttt�d�dd� d d dgddd gg}dd gd dgd dgg}d ddgdd d gg}dd gdd gd dgg}d d dgddd gg}x&tddd�D ]}tt||d�|� q�W x(tddd�D ]}tt||d�|� �q W x(tddd�D ]}tt||d�|� �q4W x(td dd�D ]}tt||d�|� �q^W ttt|dd�dd�|� tt|d dd�t|ddd�� d S )N� )� rD rD )r � rD )�axes)rD rD )r rD )rE rE )���rE r rE rD � � ���� )�krG ���)r rE )rE r )rL rF )�assertRaises� ValueErrorr. r9 �onesr �ranger )�self�a�b1�b2�b3�b4rL r? r? r@ � test_basic$ s6 zTestRot90.test_basicc C sR t �d�}tt|�jd� tt|dd�t|dd�� tt|dd�t|dd�� d S )N)�2 �( rH )rZ rY rH )r rD )rF )r rM )rE rD )rG rM )r9 rP r r. �shape)rR rS r? r? r@ � test_axesD s zTestRot90.test_axesc C s t �d��d�}ddgddggddgd d ggg}ddgddggd dgd dggg}d dgddggd dgddggg}d d gddggddgddggg}tt|dd�|� tt|d d�|� tt|dd�|� x4tdd �D ]&}tt||dd�t||d dd�� q�W d S )N� )rD rD rD rD rH � � r rE rC rI )r rE )rF )rE r )rE rD )rD r )rL rF )r9 r: �reshaper r. rQ )rR rS Z a_rot90_01Z a_rot90_12Z a_rot90_20Z a_rot90_10rL r? r? r@ �test_rotation_axesJ s. zTestRot90.test_rotation_axesN)�__name__� __module__�__qualname__rX r\ ra r? r? r? r@ rB # s rB c @ sD e Zd Zdd� Zdd� Zdd� Zdd� Zd d � Zdd� Zd d� Z dS )�TestFlipc C sR | j ttjt�d�dd� | j ttjt�d�dd� | j ttjt�d�dd� d S )NrC rE )�axis)rC rC rD rJ )rN rO r9 �fliprP )rR r? r? r@ r\ i s zTestFlip.test_axesc C sn t d�}|d d �d d d�f }tt�|d�|� dddgdddgg}dddgdddgg}tt�|d�|� d S )NrC rM rE r rD rH rI )rA r r9 rg )rR rS �br? r? r@ � test_basic_lrn s zTestFlip.test_basic_lrc C sn t d�}|d d d�d d �f }tt�|d�|� dddgdddgg}dddgdddgg}tt�|d�|� d S )NrC rM r rE rD rH rI )rA r r9 rg )rR rS rh r? r? r@ � test_basic_udx s zTestFlip.test_basic_udc C sb t �ddgddggddgddggg�}t �ddgddggddgddggg�}tt �|d�|� d S ) Nr rE rD rH rC rI r^ r_ )r9 �arrayr rg )rR rS rh r? r? r@ �test_3d_swap_axis0� s zTestFlip.test_3d_swap_axis0c C sb t �ddgddggddgddggg�}t �ddgddggddgddggg�}tt �|d�|� d S ) Nr rE rD rH rC rI r^ r_ )r9 rk r rg )rR rS rh r? r? r@ �test_3d_swap_axis1� s zTestFlip.test_3d_swap_axis1c C sb t �ddgddggddgddggg�}t �ddgddggddgddggg�}tt �|d�|� d S ) Nr rE rD rH rC rI r^ r_ )r9 rk r rg )rR rS rh r? r? r@ �test_3d_swap_axis2� s zTestFlip.test_3d_swap_axis2c C sV t �d��dddd�}x:t|j�D ],}tt �||�t �|�d|���|d�� q"W d S )N�x rD rH rC rI r ) r9 r: r` rQ �ndimr rg r �swapaxes)rR rS �ir? r? r@ �test_4d� s zTestFlip.test_4dN) rb rc rd r\ ri rj rl rm rn rs r? r? r? r@ re g s re c @ s e Zd Zdd� Zdd� ZdS )�TestAnyc C sT ddddg}ddddg}ddddg}t t�|�� t t�|�� t t�|� � d S )Nr rE )r r9 �any)rR �y1�y2�y3r? r? r@ rX � s zTestAny.test_basicc C sb dddgdddgdddgg}t t�|�� ttj|dd�dddg� ttj|dd�dddg� d S )Nr rE )rf )r r9 ru r �sometrue)rR rv r? r? r@ �test_nd� s zTestAny.test_ndN)rb rc rd rX rz r? r? r? r@ rt � s rt c @ s e Zd Zdd� Zdd� ZdS )�TestAllc C sl ddddg}ddddg}ddddg}t t�|� � t t�|�� t t�|� � t t�t�|� �� d S )Nr rE )r r9 �allrk )rR rv rw rx r? r? r@ rX � s zTestAll.test_basicc C sd dddgdddgdddgg}t t�|� � ttj|dd�dddg� ttj|dd�dddg� d S )Nr rE )rf )r r9 r| r �alltrue)rR rv r? r? r@ rz � s zTestAll.test_ndN)rb rc rd rX rz r? r? r? r@ r{ � s r{ c @ s e Zd Zdd� Zdd� ZdS )�TestCopyc C sR t �ddgddgg�}t �|�}t||� d|d<