
    fMhL                        d dl mZ d dlmZmZ d dlmZmZ d dlm	Z	m
Z
mZmZ d dlmZmZ d dlmZmZ erd dlmZ ddZddZddZddZdS )    )annotations)TYPE_CHECKINGcast)FillTypeLineType)concat_codes_or_noneconcat_offsets_or_noneconcat_points_or_noneconcat_points_or_none_with_nan)as_fill_typeas_line_type)check_filledcheck_linesNfilledcpy.FillReturn	fill_typeFillType | strreturnc                J   t          |          }|t          j        t          j        fv r| S t	          | |           t          | d                   dk     r| S t          rt          t          j	        |           } t          | d                   }|t          j        k    rEt          rt          t          j        |           } |dgdgf}n|gt          | d                   gf}|S |t          j        k    rEt          rt          t          j        |           } |dgdgf}n|gt!          | d                   gf}|S |t          j        k    r^t          rt          t          j        |           } |	dgdgdgf}n0t!          | d                   }|gt          | d                   g|gf}|S |t          j        k    r^t          rt          t          j        |           } |	dgdgdgf}n0t!          | d                   }|gt!          | d                   g|gf}|S t+          d|           )a  Return the specified filled contours with chunked data moved into the first chunk.

    Filled contours that are not chunked (``FillType.OuterCode`` and ``FillType.OuterOffset``) and
    those that are but only contain a single chunk are returned unmodified. Individual polygons are
    unchanged, they are not geometrically combined.

    Args:
        filled (sequence of arrays): Filled contour data, such as returned by
            :meth:`.ContourGenerator.filled`.
        fill_type (FillType or str): Type of :meth:`~.ContourGenerator.filled` as enum or string
            equivalent.

    Return:
        Filled contours in a single chunk.

    .. versionadded:: 1.2.0
    r      N   zInvalid FillType )r   r   	OuterCodeOuterOffsetr   lenr   r   cpyFillReturn_Chunkr
   ChunkCombinedCodeFillReturn_ChunkCombinedCoder   ChunkCombinedOffsetFillReturn_ChunkCombinedOffsetr	   ChunkCombinedCodeOffset"FillReturn_ChunkCombinedCodeOffsetChunkCombinedOffsetOffset$FillReturn_ChunkCombinedOffsetOffset
ValueError)r   r   pointsret1ret2ret3outer_offsetsret4s           Q/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/contourpy/dechunk.pydechunk_filledr-      sF   $ Y''IX')=>>>###
6!9~~ 4c*F33"6!9--FH... 	D#:FCCF>7;ftf5EDDH3F1I>>?@D	h2	2	2 	F#<fEEF>9=7GDDH5fQi@@ABD	h6	6	6 	J#@&IIF>=AFTFTF;SDD26!9==MH3F1I>>?-QD	h8	8	8 	L#BFKKF>?Cftftf=UDD26!9==MH5fQi@@AM?SD8Y88999    linescpy.LineReturn	line_typeLineType | strc                T   t          |          }|t          j        t          j        fv r| S t	          | |           t          | d                   dk     r| S t          rt          t          j	        |           } |t          j
        k    rZt          rt          t          j        |           } t          | d                   }|dgdgf}n|gt          | d                   gf}|S |t          j        k    rZt          rt          t          j        |           } t          | d                   }|dgdgf}n|gt!          | d                   gf}|S |t          j        k    r<t          rt          t          j        |           } t'          | d                   }|gf}|S t)          d|           )a  Return the specified contour lines with chunked data moved into the first chunk.

    Contour lines that are not chunked (``LineType.Separate`` and ``LineType.SeparateCode``) and
    those that are but only contain a single chunk are returned unmodified. Individual lines are
    unchanged, they are not geometrically combined.

    Args:
        lines (sequence of arrays): Contour line data, such as returned by
            :meth:`.ContourGenerator.lines`.
        line_type (LineType or str): Type of :meth:`~.ContourGenerator.lines` as enum or string
            equivalent.

    Return:
        Contour lines in a single chunk.

    .. versionadded:: 1.2.0
    r   r   Nr   zInvalid LineType )r   r   SeparateSeparateCoder   r   r   r   r   LineReturn_Chunkr   LineReturn_ChunkCombinedCoder
   r   r   LineReturn_ChunkCombinedOffsetr	   ChunkCombinedNanLineReturn_ChunkCombinedNanr   r%   )r/   r1   r&   r'   r(   r)   s         r,   dechunk_linesr;   Z   s   $ Y''IX&(=>>>y!!!
58}}q 2S)511H... 	B95AAE&uQx00>7;ftf5EDDH3E!H==>?D	h2	2	2 	D;UCCE&uQx00>9=7GDDH5eAh??@AD	h/	/	/ 	A8%@@E/a99288Y88999r.   multi_filledlist[cpy.FillReturn]c                v    t                    t          j        t          j        fv r| S fd| D             S )a  Return multiple sets of filled contours with chunked data moved into the first chunks.

    Filled contours that are not chunked (``FillType.OuterCode`` and ``FillType.OuterOffset``) and
    those that are but only contain a single chunk are returned unmodified. Individual polygons are
    unchanged, they are not geometrically combined.

    Args:
        multi_filled (nested sequence of arrays): Filled contour data, such as returned by
            :meth:`.ContourGenerator.multi_filled`.
        fill_type (FillType or str): Type of :meth:`~.ContourGenerator.filled` as enum or string
            equivalent.

    Return:
        Multiple sets of filled contours in a single chunk.

    .. versionadded:: 1.3.0
    c                0    g | ]}t          |          S  )r-   ).0r   r   s     r,   
<listcomp>z(dechunk_multi_filled.<locals>.<listcomp>   s#    III&N69--IIIr.   )r   r   r   r   )r<   r   s    `r,   dechunk_multi_filledrC      sH    * Y''IX')=>>>IIIILIIIIr.   multi_lineslist[cpy.LineReturn]c                v    t                    t          j        t          j        fv r| S fd| D             S )a  Return multiple sets of contour lines with all chunked data moved into the first chunks.

    Contour lines that are not chunked (``LineType.Separate`` and ``LineType.SeparateCode``) and
    those that are but only contain a single chunk are returned unmodified. Individual lines are
    unchanged, they are not geometrically combined.

    Args:
        multi_lines (nested sequence of arrays): Contour line data, such as returned by
            :meth:`.ContourGenerator.multi_lines`.
        line_type (LineType or str): Type of :meth:`~.ContourGenerator.lines` as enum or string
            equivalent.

    Return:
        Multiple sets of contour lines in a single chunk.

    .. versionadded:: 1.3.0
    c                0    g | ]}t          |          S r@   )r;   )rA   r/   r1   s     r,   rB   z'dechunk_multi_lines.<locals>.<listcomp>   s#    EEEM%++EEEr.   )r   r   r4   r5   )rD   r1   s    `r,   dechunk_multi_linesrH      sH    * Y''IX&(=>>>EEEEEEEEr.   )r   r   r   r   r   r   )r/   r0   r1   r2   r   r0   )r<   r=   r   r   r   r=   )rD   rE   r1   r2   r   rE   )
__future__r   typingr   r   contourpy._contourpyr   r   contourpy.arrayr   r	   r
   r   contourpy.enum_utilr   r   contourpy.typecheckr   r   
_contourpyr   r-   r;   rC   rH   r@   r.   r,   <module>rP      s9   " " " " " " & & & & & & & & 3 3 3 3 3 3 3 3            ; : : : : : : : 9 9 9 9 9 9 9 9 '&&&&&&D: D: D: D:N9: 9: 9: 9:xJ J J J<F F F F F Fr.   