WL i- |UddlmZddlmZddlZddlmZmZm Z m Z m Z m Z m Z mZmZddlmZddlmZddlmZmZmZmZddlmZmZmZmZdd lmZm Z m!Z!erdd lm"Z"dd l#m$Z$d d l%m&Z&m'Z'gdZ(e e e e dZ)de*d< ddZ+ dddddddddejXdd ddZ-y)) annotations) TYPE_CHECKINGN) ContourGeneratorFillTypeLineTypeMpl2005ContourGeneratorMpl2014ContourGeneratorSerialContourGeneratorThreadedContourGeneratorZInterp max_threads) __version__)calc_chunk_sizes)convert_filled convert_linesconvert_multi_filledconvert_multi_lines)dechunk_filled dechunk_linesdechunk_multi_filleddechunk_multi_lines) as_fill_type as_line_type as_z_interp)Any) ArrayLike)CoordinateArray MaskArray)rcontour_generatorrrrrrrrrr rrrrr r r r )mpl2005mpl2014serialthreadedz!dict[str, type[ContourGenerator]] _class_lookupcftjj|tj}tjj |d}tjj |r tjj |}nd}tjj||fS)NdtypeF)copy)npmaasarrayfloat64masked_invalid is_maskedgetmaskgetdata)zz_arrayz_maskedmasks X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/contourpy/__init__.py_remove_z_maskr7IsveemmARZZm0Guu##G%#8H uux uu}}X& 55== "D ((r#F) name corner_mask line_type fill_type chunk_size chunk_counttotal_chunk_count quad_as_triz_interp thread_countc T tj|tj}tj|tj}t|\}} |jdk7rt d|jd|j ddks|j ddkrt d|j |j \}}|j|jk7r&t d|jd |jd |jdk(retj|tj}tj|tj}tj||\}}n!|jdk(rlt||k7rt d t|d |d t||k7rt dt|d|d tj||\}}n|jdk(r~|j |j k7r&t d|j d|j d|j |j k7r?t d|j d|j dt d|jd| $| j |j k7r td|tvrtd|t||| ||\}}t|}||j}n |r|jst|d| |j}n t|}|j!|st|d|| |j"}n t%|}|j'|st|d|| r|j)st|d| t*j,} n t/| } | t*j,k7r |j1st|d| | dvr |j3st|d| |||| g}||d}|dvr ||d <||d!<|jr||d"<|j)r| |d#<|j1r| |d$<|j3r| |d%<||i|S)&aCreate and return a :class:`~.ContourGenerator` object. The class and properties of the returned :class:`~.ContourGenerator` are determined by the function arguments, with sensible defaults. Args: x (array-like of shape (ny, nx) or (nx,), optional): The x-coordinates of the ``z`` values. May be 2D with the same shape as ``z.shape``, or 1D with length ``nx = z.shape[1]``. If not specified are assumed to be ``np.arange(nx)``. Must be ordered monotonically. y (array-like of shape (ny, nx) or (ny,), optional): The y-coordinates of the ``z`` values. May be 2D with the same shape as ``z.shape``, or 1D with length ``ny = z.shape[0]``. If not specified are assumed to be ``np.arange(ny)``. Must be ordered monotonically. z (array-like of shape (ny, nx), may be a masked array): The 2D gridded values to calculate the contours of. May be a masked array, and any invalid values (``np.inf`` or ``np.nan``) will also be masked out. name (str): Algorithm name, one of ``"serial"``, ``"threaded"``, ``"mpl2005"`` or ``"mpl2014"``, default ``"serial"``. corner_mask (bool, optional): Enable/disable corner masking, which only has an effect if ``z`` is a masked array. If ``False``, any quad touching a masked point is masked out. If ``True``, only the triangular corners of quads nearest these points are always masked out, other triangular corners comprising three unmasked points are contoured as usual. If not specified, uses the default provided by the algorithm ``name``. line_type (LineType or str, optional): The format of contour line data returned from calls to :meth:`~.ContourGenerator.lines`, specified either as a :class:`~.LineType` or its string equivalent such as ``"SeparateCode"``. If not specified, uses the default provided by the algorithm ``name``. The relationship between the :class:`~.LineType` enum and the data format returned from :meth:`~.ContourGenerator.lines` is explained at :ref:`line_type`. fill_type (FillType or str, optional): The format of filled contour data returned from calls to :meth:`~.ContourGenerator.filled`, specified either as a :class:`~.FillType` or its string equivalent such as ``"OuterOffset"``. If not specified, uses the default provided by the algorithm ``name``. The relationship between the :class:`~.FillType` enum and the data format returned from :meth:`~.ContourGenerator.filled` is explained at :ref:`fill_type`. chunk_size (int or tuple(int, int), optional): Chunk size in (y, x) directions, or the same size in both directions if only one value is specified. chunk_count (int or tuple(int, int), optional): Chunk count in (y, x) directions, or the same count in both directions if only one value is specified. total_chunk_count (int, optional): Total number of chunks. quad_as_tri (bool): Enable/disable treating quads as 4 triangles, default ``False``. If ``False``, a contour line within a quad is a straight line between points on two of its edges. If ``True``, each full quad is divided into 4 triangles using a virtual point at the centre (mean x, y of the corner points) and a contour line is piecewise linear within those triangles. Corner-masked triangles are not affected by this setting, only full unmasked quads. z_interp (ZInterp or str, optional): How to interpolate ``z`` values when determining where contour lines intersect the edges of quads and the ``z`` values of the central points of quads, specified either as a :class:`~contourpy.ZInterp` or its string equivalent such as ``"Log"``. Default is ``ZInterp.Linear``. thread_count (int): Number of threads to use for contour calculation, default 0. Threads can only be used with an algorithm ``name`` that supports threads (currently only ``name="threaded"``) and there must be at least the same number of chunks as threads. If ``thread_count=0`` and ``name="threaded"`` then it uses the maximum number of threads as determined by the C++11 call ``std::thread::hardware_concurrency()``. If ``name`` is something other than ``"threaded"`` then the ``thread_count`` will be set to ``1``. Return: :class:`~.ContourGenerator`. Note: A maximum of one of ``chunk_size``, ``chunk_count`` and ``total_chunk_count`` may be specified. Warning: The ``name="mpl2005"`` algorithm does not implement chunking for contour lines. r'zInput z must be 2D, not Drrz>Input z must be at least a (2, 2) shaped array, but has shape zNumber of dimensions of x (z ) and y (z) do not matchz Length of x (z%) must match number of columns in z ()z Length of y (z") must match number of rows in z (z Shapes of x z and z z do not matchz Shapes of y z+Inputs x and y must be None, 1D or 2D, not z=If mask is set it must be a 2D array with the same shape as zz%Unrecognised contour generator name: z4 contour generator does not support corner_mask=Truez. contour generator does not support line_type z. contour generator does not support fill_type z4 contour generator does not support quad_as_tri=Truez- contour generator does not support z_interp )rrz1 contour generator does not support thread_count ) x_chunk_size y_chunk_size)r!r"r;r<r:r@rArB)r*r,r-r7ndim TypeErrorshapearangemeshgridlen ValueErrorr%rsupports_corner_maskdefault_line_typersupports_line_typedefault_fill_typersupports_fill_typesupports_quad_as_trir Linearrsupports_z_interpsupports_threads)xyr2r9r:r;r<r=r>r?r@rArBr5nynxrHrGclsargskwargss r6r r Xsd 1BJJ'A 1BJJ'AQGAt vv{2166(!<==wwqzA~aXYZY`Y`Xabcc WWFB vv5affXYqvvhn]^^vv{ IIb + IIb +{{1a 1 1 q6R<mCF83XY[X\\]^_ _ q6R<mCF83UVXUYYZ[\ \{{1a 1 1 77agg l177)7177)=QR R 77agg l177)7177)=QR REaffXQOPP DJJ!''1XYY = @GHH"2K!2B"<L,  C..0 S557D6!UVWW))  +  ! !) ,D6!OPY{[\\))  +  ! !) ,D6!OPY{[\\3335D6!UVWW>>x(7>>!#*?*?*AD6!NxjYZZ6!#*>*>*@D6!RS_R`abb q!T?D$$EF  ))'{'{ ! +} ! +} %z !-~   r8)r2.ArrayLike | np.ma.MaskedArray[Any, Any] | Nonereturnz(tuple[CoordinateArray, MaskArray | None])NNN)rYArrayLike | NonerZrbr2r`r9strr:z bool | Noner;zLineType | str | Noner<zFillType | str | Noner=int | tuple[int, int] | Noner>rdr?z int | Noner@boolrAzZInterp | str | NonerBintrar). __future__rtypingrnumpyr*contourpy._contourpyrrrrr r r r r contourpy._versionrcontourpy.chunkrcontourpy.convertrrrrcontourpy.dechunkrrrrcontourpy.enum_utilrrrr numpy.typingr _contourpyrr__all__r%__annotations__r7rVr r8r6rusX"    +,  HG&6 2'&$( 4 0 )5 )- ) 8<E #'+'+/304$(%,^^E E E 6E  E  E %E %E -E .E "E E #E E E r8