
    gL                        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y)    )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_linesNc                   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(  r>t        rt        t        j                  |       } |dgdgf}|S |gt        | d         gf}|S |t        j                  k(  r>t        rt        t        j                  |       } |dgdgf}|S |gt!        | d         gf}|S |t        j"                  k(  rPt        rt        t        j$                  |       } |
dgdgdgf}|S t!        | d         }|gt        | d         g|gf}|S |t        j&                  k(  rPt        rt        t        j(                  |       } |
dgdgdgf}|S t!        | 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)filled	fill_typepointsret1ret2ret3outer_offsetsret4s           N/var/www/dash_apps/app1/venv/lib/python3.12/site-packages/contourpy/dechunk.pydechunk_filledr*      s!   $ Y'IX'')=)=>>#
6!9~c**F3"6!9-FH...#::FCF>7;ftf5ED  H3F1I>?@D	h22	2#<<fEF>9=7GD  H5fQi@ABD	h66	6#@@&IF>=AFTFTF;SD  36!9=MH3F1I>?-QD	h88	8#BBFKF>?Cftftf=UD  36!9=MH5fQi@AM?SD,YK899    c                   t        |      }|t        j                  t        j                  fv r| S t	        | |       t        | d         dk  r| S t        rt        t        j                  |       } |t        j                  k(  rLt        rt        t        j                  |       } t        | d         }|dgdgf}|S |gt        | d         gf}|S |t        j                  k(  rLt        rt        t        j                  |       } t        | d         }|dgdgf}|S |gt!        | d         gf}|S |t        j"                  k(  r4t        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    )lines	line_typer#   r$   r%   r&   s         r)   dechunk_linesr6   Z   s   $ Y'IX&&(=(=>>y!
58}qS))51H...995AE&uQx0>7;ftf5ED  H3E!H=>?D	h22	2;;UCE&uQx0>9=7GD  H5eAh?@AD	h//	/88%@E/a928,YK899r+   c                    t        |      }|t        j                  t        j                  fv r| S | D cg c]  }t	        ||       c}S c c}w )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
    )r   r   r   r   r*   )multi_filledr"   r!   s      r)   dechunk_multi_filledr9      sH    * Y'IX'')=)=>><HI&N69-III   A
c                    t        |      }|t        j                  t        j                  fv r| S | D cg c]  }t	        ||       c}S c c}w )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
    )r   r   r-   r.   r6   )multi_linesr5   r4   s      r)   dechunk_multi_linesr=      sH    * Y'IX&&(=(=>>9DEM%+EEEr:   )r!   cpy.FillReturnr"   FillType | strreturnr>   )r4   cpy.LineReturnr5   LineType | strr@   rA   )r8   list[cpy.FillReturn]r"   r?   r@   rC   )r<   list[cpy.LineReturn]r5   rB   r@   rD   )
__future__r   typingr   r   contourpy._contourpyr   r   contourpy.arrayr   r	   r
   r   contourpy.enum_utilr   r   contourpy.typecheckr   r   
_contourpyr   r*   r6   r9   r=    r+   r)   <module>rM      sy    " & 3  ; 9&D:N9:xJ&JJ J<F%FF Fr+   