§
    …Û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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           úG/granary/edev/quantum/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ÔCˆFØˆ>Ø7;°f¸t¸fÐ5EˆDˆDà�HÕ3°F¸1´IÑ>Ô>Ð?Ð@ˆDØˆØ	•hÔ2Ò	2Ð	2Ýð 	FÝ�#Ô<¸fÑEÔEˆFØˆ>Ø9=¸ÀÀÐ7GˆDˆDà�HÕ5°f¸Q´iÑ@Ô@ÐAÐBˆDØˆØ	•hÔ6Ò	6Ð	6Ýð 	JÝ�#Ô@À&ÑIÔIˆFØˆ>Ø=A¸FÀTÀFÈTÈFÐ;SˆDˆDå2°6¸!´9Ñ=Ô=ˆMØ�HÕ3°F¸1´IÑ>Ô>Ð?À-ÀÐQˆDØˆØ	•hÔ8Ò	8Ð	8Ýð 	LÝ�#ÔBÀFÑKÔKˆFØˆ>Ø?C¸fÀtÀfÈtÈfÐ=UˆDˆDå2°6¸!´9Ñ=Ô=ˆMØ�HÕ5°f¸Q´iÑ@Ô@ÐAÀMÀ?ÐSˆDØˆåÐ8¨YÐ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Ý�Ô9¸5ÑAÔAˆEÝ& u¨Q¤xÑ0Ô0ˆØˆ>Ø7;°f¸t¸fÐ5EˆDˆDà�HÕ3°E¸!´HÑ=Ô=Ð>Ð?ˆDØˆØ	•hÔ2Ò	2Ð	2Ýð 	DÝ�Ô;¸UÑCÔCˆEÝ& u¨Q¤xÑ0Ô0ˆØˆ>Ø9=¸ÀÀÐ7GˆDˆDà�HÕ5°e¸A´hÑ?Ô?Ð@ÐAˆDØˆØ	•hÔ/Ò	/Ð	/Ýð 	AÝ�Ô8¸%Ñ@Ô@ˆEÝ/°°a´Ñ9Ô9ˆØ28°°ˆØˆåÐ8¨YÐ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°&�N˜6 9Ñ-Ô-ÐIÐIÐIr.   )r   r   r   r   )r<   r   s    `r,   Údechunk_multi_filledrC   –   sH   ø€ õ* ˜YÑ'Ô'€Ià•XÔ'­Ô)=Ð>Ð>Ð>àÐàIÐIÐIÐI¸LÐ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.   