← Back
Editing: _ni_support.cpython-311.pyc
� d�c� � �6 � d dl mZ d dlZd dlZd� Zd� Zdd�ZdS )� )�IterableNc � � | dk rdS | dk rdS | dv rdS | dk rdS | d k rd S | dk rdS | d k rdS t d� � �)zAConvert an extension mode to the corresponding integer code. �nearestr �wrap� )�reflectzgrid-mirror� �mirror� �constant� z grid-wrap� z grid-constant� zboundary mode not supported)�RuntimeError)�modes �;/usr/lib/python3/dist-packages/scipy/ndimage/_ni_support.py�_extend_mode_to_coder $ s� � � �y����q� �����q� �+� +� +��q� �� � ��q� �� � ��q� �� � ��q� �� � ��q��8�9�9�9� c �� � t | t � � }|sIt | t � � r4t | � � }t |� � |k rd}t |� � �n| g|z }|S )z�If input is a scalar, create a sequence of length equal to the rank by duplicating the input. If input is a sequence, check if its length is equal to the length of array. z6sequence argument must have length equal to input rank)� isinstance�strr �list�lenr )�input�rank�is_str� normalized�errs r �_normalize_sequencer 9 ss � � ��s� #� #�F�� $�j���1�1� $��%�[�[� ��z�?�?�d�"�"�J�C��s�#�#�#� #� �W�t�^� ��r Fc �> � |�|j }| �`|s"t j ||j j �� � } �nmt j |j t j � � }t j ||�� � } �n1t | t t j f� � ri|rPt j | � � j dk r3t j d� � t j | t j � � } t j || �� � } n�t | t � � rWt j | } |r,t j | � � j dk rt d� � �t j || �� � } n;| j |k rt d� � �|r| j j dk rt d� � �| S )N)�dtype�cz+promoting specified output dtype to complexzoutput must have complex dtypezoutput shape not correct)�shape�numpy�zerosr! �name� promote_types� complex64r �type�kind�warnings�warnr � sctypeDictr )�outputr r# �complex_output�complex_types r �_get_outputr1 I s� � ��}���� �~�� <��[��e�k�.>�?�?�?�F�F� �.�u�{�E�O�L�L�L��[��l�;�;�;�F�F� �F�T�5�;�/� 0� 0� =�� B�e�k�&�1�1�6�#�=�=��M�G�H�H�H��(����A�A�F���U�&�1�1�1��� �F�C� � � =��!�&�)��� A�e�k�&�1�1�6�#�=�=��?�@�@�@���U�&�1�1�1��� ��� � ��5�6�6�6� � =�F�L�-��4�4��;�<�<�<��Mr )NF)�collections.abcr r+ r$ r r r1 � r r �<module>r4 sg ��>