§
    nŸr]  ã                   ó,   — d Z ddlZddlZd„ Z	 	 dd„ZdS )	z–utils.py -- Utility functions used by Gnuplot.

This module contains utility functions used by Gnuplot.py which aren't
particularly gnuplot-related.

é    Nc                 óä   — 	 t          j        | t           j        ¦  «        S # t          $ rD 	 t          j        | t           j        ¦  «        cY S # t          $ r t          d¦  «         Y Y dS w xY ww xY w)as  Return the argument as a numpy array of type at least 'Float32'.

    Leave 'Float64' unchanged, but upcast all other types to
    'Float32'.  Allow also for the possibility that the argument is a
    python native type that can be converted to a numpy array using
    'numpy.asarray()', but in that case don't worry about
    downcasting to single-precision float.

    z"Fatal: array dimensions not equal!N)ÚnumpyÚasarrayÚfloat32Ú	TypeErrorÚfloat_Úprint)Úms    ú//usr/lib/python3/dist-packages/Gnuplot/utils.pyÚfloat_arrayr      sˆ   € ðåŒ}˜Q¥¤Ñ.Ô.Ð.øÝð 
ð 
ð 
ð
	Ý”= ¥E¤LÑ1Ô1Ð1Ð1Ð1øÝð 	ð 	ð 	åÐ6Ñ7Ô7Ð7Ø�4�4�4ð	øøøð
øøøs,   ‚! ¡
A/¬AÁ
A/ÁA+Á&A/Á*A+Á+A/ú Ú ú
c           	      óê  — t          |j        ¦  «        dk    r�|j        \  }|dk    sJ ‚dg|z  }|                     |¦  «        }|                      |¦  «         |                      |t	          |                     ¦   «         ¦  «        z  ¦  «         |                      |¦  «         dS t          |j        ¦  «        dk    �r%|j        \  }	}|	dk    r|dk    sJ ‚dg|z  }|                     |¦  «        }|                      ||z   ¦  «         |                      |t	          |d                              ¦   «         ¦  «        z  ¦  «         |                      |¦  «         |dd…         D ]f}
|                      ||z   ¦  «         |                      |t	          |
                     ¦   «         ¦  «        z  ¦  «         |                      |¦  «         Œg|                      |¦  «         dS |j        d         dk    sJ ‚|                      |¦  «         t          | |d         ||||¦  «         |dd…         D ]+}|                      |¦  «         t          | |||||¦  «         Œ,|                      |¦  «         dS )a  Write an array of arbitrary dimension to a file.

    A general recursive array writer.  The last four parameters allow
    a great deal of freedom in choosing the output format of the
    array.  The defaults for those parameters give output that is
    gnuplot-readable.  But using '(",", "{", "}", ",
")' would output
    an array in a format that Mathematica could read.  'item_sep'
    should not contain '%' (or if it does, it should be escaped to
    '%%') since it is put into a format string.

    The default 2-d file organization::

        set[0,0] set[0,1] ...
        set[1,0] set[1,1] ...

    The 3-d format::

        set[0,0,0] set[0,0,1] ...
        set[0,1,0] set[0,1,1] ...

        set[1,0,0] set[1,0,1] ...
        set[1,1,0] set[1,1,1] ...

    é   r   z%sé   N)ÚlenÚshapeÚjoinÚwriteÚtupleÚtolistÚwrite_array)ÚfÚsetÚitem_sepÚnest_prefixÚnest_suffixÚnest_sepÚcolumnsÚfmt_ÚfmtÚpointsÚpointÚsubsets               r   r   r   .   s€  € õ8 ˆ3Œ9�~„~˜ÒÐØ”Y‰
ˆØ˜Š{ˆ{ˆ{ˆ{Øˆv˜ÑˆØ�mŠm˜DÑ!Ô!ˆØ	�Š�ÑÔÐØ	�Š�•e˜CŸJšJ™LœLÑ)Ô)Ñ)Ñ*Ô*Ð*Ø	�Š�ÑÔÐÐÐÝ	ˆSŒY‰Œ˜1Ò	Ñ	ð  œIÑˆ�Ø˜Šzˆz˜g¨šk˜k˜k˜kØˆv˜ÑˆØ�mŠm˜DÑ!Ô!ˆØ	�Š�˜kÑ)Ñ*Ô*Ð*Ø	�Š�•e˜C œFŸMšM™OœOÑ,Ô,Ñ,Ñ-Ô-Ð-Ø	�Š�ÑÔÐØ˜˜˜”Wð 	!ð 	!ˆEØ�GŠG�H˜{Ñ*Ñ+Ô+Ð+Ø�GŠG�C�% §¢¡¤Ñ/Ô/Ñ/Ñ0Ô0Ð0Ø�GŠG�KÑ Ô Ð Ð Ø	�Š�ÑÔÐÐÐð Œy˜Œ|˜aÒÐÐÐØ	�Š�ÑÔÐÝ�A�s˜1”vØ˜k¨;¸ñ	Bô 	Bð 	Bà˜!˜"˜"”gð 	Fð 	FˆFØ�GŠG�HÑÔÐÝ˜˜6Ø  +¨{¸HñFô Fð Fð Fà	�Š�ÑÔÐÐÐó    )r   r   r   r   )Ú__doc__Ústringr   r   r   © r&   r   ú<module>r*      sX   ððð ð €€€Ø €€€ðð ð ð6 Ø;=ð=ð =ð =ð =ð =ð =r&   