;ò ŠtDc@s}dklZdklZdfd„ƒYZdfd„ƒYZdfd„ƒYZdfd „ƒYZd fd „ƒYZd S( (stext(sticks_ItextercBstZd„ZRS(NcCsdS(sâfill the label attribute of ticks - ticks is a list of instances of tick - for each element of ticks the value of the attribute label is set to a string appropriate to the attributes num and denom of that tick instance - label attributes of the tick instances are just kept, whenever they are not equal to None - the method might modify the labelattrs attribute of the ticks; be sure to not modify it in-place!N((sselfsticks((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pyslabelss (s__name__s __module__slabels(((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pys_Itexterssdecimalc BsMtZdZeZddddddddddeigd„ Zd„ZRS(sHa texter creating decimal labels (e.g. '1.234' or even '0.\overline{3}')sis.s-s \overline{%s}c Csg||_||_||_||_||_||_||_||_| |_ | |_ | |_ dS(s¯initializes the instance - prefix, infix, and suffix (strings) are added at the begin, immediately after the minus, and at the end of the label, respectively - decimalsep, thousandsep, and thousandthpartsep (strings) are used as separators - plus or minus (string) is inserted for non-negative or negative numbers - period (string) is taken as a format string generating a period; it has to contain exactly one string insert operators "%s" for the period; usually it should be r"\overline{%s}" - labelattrs is a list of attributes to be added to the label attributes given in the painterN( sprefixsselfsinfixssuffixsequalprecisions decimalseps thousandsepsthousandthpartsepsplussminussperiods labelattrs( sselfsprefixsinfixssuffixsequalprecisions decimalseps thousandsepsthousandthpartsepsplussminussperiods labelattrs((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pys__init__0s          cCsÔg} d}xƒ|D]{} | itjo | itj oU| i| ƒ| i| i f\}}|djo | }n|djo | }nt ||ƒ\} } t| ƒ} t|iƒo~t| ƒ}d| _xot|ƒD]T}| i| |7_||dd o||djo| i|i7_qáqáWn | | _| o| i|i7_ng}d| _xø| oð| id7_| |joVt| _t| iƒt|ƒ|i| ƒ} | i| |i| i| | _Pn|| g7}| d9} t | |ƒ\} } | idd o | idjo| i|i7_n| it| ƒ7_quW|| ijo | i}qŽqqW|io»x¸| D]¬} | itj o–| idjo |djo| i|i7_nx`t| i|ƒD]H}|dd o |djo| i|i7_n| id7_qÿWq£q£Wnxv| D]n} | i| i djo |i}n |i }d|i!||i"| i|i#f| _| i$|i$| _$q^WdS(Nisiii s0s %s%s%s%s%s(%s labeledtickssmaxdecprecisionsticksstickslabelsNones labellevelsappendsnumsdenomsmsnsdivmodsquotients remaindersstrslensselfs thousandsepslsrangesis decimalseps oldremaindersstemp_decprecisionsindexs periodstartsperiodsthousandthpartsepsequalprecisionsminuss plusminussplussprefixsinfixssuffixs labelattrs(sselfstickssmaxdecprecisions oldremainderss plusminussismslsns labeledtickssticks remainders periodstartsquotient((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pyslabelsLsx        %    &"  #   (( s__name__s __module__s__doc__s_Itexters__implements__stextsmathmodes__init__slabels(((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pysdecimal+s 0s exponentialc BsktZdZeZddddeddeiddfƒeiddfƒd deƒd „ Z d „Z RS( s>a texter creating labels with exponentials (e.g. '2\cdot10^5')ss-s{{%s}\cdot10^{%s}}s{%s}s {10^{%s}}s {-10^{%s}}il ic Cs–||_||_||_||_||_||_||_||_| |_ |i|i |_ |i |i|_ | |_ | |_ | |_dS(sinitializes the instance - plus or minus (string) is inserted for non-negative or negative exponents - mantissaexp (string) is taken as a format string generating the exponent; it has to contain exactly two string insert operators "%s" -- the first for the mantissa and the second for the exponent; examples are r"{{%s}\cdot10^{%s}}" and r"{{%s}{\rm e}{%s}}" - skipexp0 (string) is taken as a format string used for exponent 0; exactly one string insert operators "%s" for the mantissa; None turns off the special handling of exponent 0; an example is r"{%s}" - skipexp1 (string) is taken as a format string used for exponent 1; exactly one string insert operators "%s" for the mantissa; None turns off the special handling of exponent 1; an example is r"{{%s}\cdot10}" - nomantissaexp (string) is taken as a format string generating the exponent when the mantissa is one and should be skipped; it has to contain exactly one string insert operators "%s" for the exponent; an examples is r"{10^{%s}}" - minusnomantissaexp (string) is taken as a format string generating the exponent when the mantissa is minus one and should be skipped; it has to contain exactly one string insert operators "%s" for the exponent; None turns off the special handling of mantissa -1; an examples is r"{-10^{%s}}" - mantissamin and mantissamax are the minimum and maximum of the mantissa; they are rational instances greater than zero and mantissamin < mantissamax; the sign of the tick is ignored here - skipmantissa1 (boolean) turns on skipping of any mantissa equals one (and minus when minusnomantissaexp is set) - skipallmantissa1 (boolean) as above, but all mantissas must be 1 (or -1) - mantissatexter is the texter for the mantissa - the skipping of a mantissa is stronger than the skipping of an exponentN(splussselfsminuss mantissaexpsskipexp0sskipexp1s nomantissaexpsminusnomantissaexps mantissamins mantissamaxsmantissamindivmaxsmantissamaxdivmins skipmantissa1sskipallmantissa1smantissatexter( sselfsplussminuss mantissaexpsskipexp0sskipexp1s nomantissaexpsminusnomantissaexps mantissamins mantissamaxs skipmantissa1sskipallmantissa1smantissatexter((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pys__init__Œs'           cCs”g}xk|D]c}|itjo |itj o=|i|if\|_|_ |i |ƒd|_ |io´xUt |ƒ|ijo>|i d7_ ||i}|i|if\|_|_qtWxYt |ƒ|ijo>|i d8_ ||i}|i|if\|_|_qÌWn|i djod|i|i f|_ qpd|i|i f|_ q q W|ii|ƒ|itj o`t|ƒtgi }|D]3}t |iƒt |iƒjo||ƒq®q®~ƒj}nQt|ƒtgi }|D]'}|i|ijo||ƒqq~ƒj}xI|D]A}|io|p>|io4|i|ijp!|i|i jo |itj oA|i|ijo|i|i |_qn|i|i |_n‹|i djo |itj o|i|i|_nT|i djo |itj o|i|i|_n|i |i|i f|_|i|i f\|_|_qKWdS(Niis%s%is0s1(!s labeledtickssticksstickslabelsNones labellevelsnumsdenoms temp_orgnums temp_orgdenomsappendstemp_expsabssselfs mantissamaxsmantissamindivmaxsxs mantissaminsmantissamaxdivminsminussplussmantissatexterslabelssminusnomantissaexpslens_[1]s allmantissa1sskipallmantissa1s skipmantissa1s nomantissaexpsskipexp0sskipexp1s mantissaexp(sselfstickss_[1]s labeledtickss allmantissa1sxstick((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pyslabelsÃsJ     # '!`PR  ( s__name__s __module__s__doc__s_Itexters__implements__sNonesticksrationalsdecimals__init__slabels(((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pys exponential‡s N7smixedcBsYtZdZeZeiddfƒeiddfƒdeƒeƒd„Z d„Z RS(s/a texter creating decimal or exponential labelsiièi'cCs1||_||_||_||_||_dS(sùinitializes the instance - smallestdecimal and biggestdecimal are the smallest and biggest decimal values, where the decimal texter should be used; they are rational instances; the sign of the tick is ignored here; a tick at zero is considered for the decimal texter as well - equaldecision (boolean) uses decimal texter or exponential texter globaly (set) or for each tick separately (unset) - decimal and exponential are texters to be usedN(ssmallestdecimalsselfsbiggestdecimals equaldecisionsdecimals exponential(sselfssmallestdecimalsbiggestdecimals equaldecisionsdecimals exponential((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pys__init__÷s     cCs!g}g}x‡|D]}|itjo |itj oY|i p)t|ƒ|i jot|ƒ|i jo|i |ƒq’|i |ƒqqW|i o5t|ƒo|ii|ƒq|ii|ƒnIx!|D]}|ii|gƒqÜWx!|D]}|ii|gƒqWdS(N(sdectickssexptickssticksstickslabelsNones labellevelsnumsabssselfssmallestdecimalsbiggestdecimalsappends equaldecisionslens exponentialslabelssdecimal(sselfstickssexptickssticksdecticks((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pyslabels s$ 7  ( s__name__s __module__s__doc__s_Itexters__implements__sticksrationalsdecimals exponentials__init__slabels(((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pysmixedòs <srationalcBswtZdZeZddddddddddddddddddeigd„Zd„Zd„Z d „Z RS( sBa texter creating rational labels (e.g. 'a/b' or even 'a \over b')ss-is{{%s}\over{%s}}icCs¯||_||_||_||_||_||_||_||_| |_ | |_ | |_ | |_ | |_ ||_||_||_||_||_||_dS(sŠ initializes the instance - prefix, infix, and suffix (strings) are added at the begin, immediately after the minus, and at the end of the label, respectively - prefixnum, infixnum, and suffixnum (strings) are added to the labels numerator correspondingly - prefixdenom, infixdenom, and suffixdenom (strings) are added to the labels denominator correspondingly - plus or minus (string) is inserted for non-negative or negative numbers - minuspos is an integer, which determines the position, where the plus or minus sign has to be placed; the following values are allowed: 1 - writes the plus or minus in front of the numerator 0 - writes the plus or minus in front of the hole fraction -1 - writes the plus or minus in front of the denominator - over (string) is taken as a format string generating the fraction bar; it has to contain exactly two string insert operators "%s" -- the first for the numerator and the second for the denominator; by far the most common examples are r"{{%s}\over{%s}}" and "{{%s}/{%s}}" - usually the numerator and denominator are canceled; however, when equaldenom is set, the least common multiple of all denominators is used - skip1 (boolean) just prints the prefix, the plus or minus, the infix and the suffix, when the value is plus or minus one and at least one of prefix, infix and the suffix is present - skipnum0 (boolean) just prints a zero instead of the hole fraction, when the numerator is zero; no prefixes, infixes, and suffixes are taken into account - skipnum1 (boolean) just prints the numprefix, the plus or minus, the numinfix and the numsuffix, when the num value is plus or minus one and at least one of numprefix, numinfix and the numsuffix is present - skipdenom1 (boolean) just prints the numerator instead of the hole fraction, when the denominator is one and none of the parameters denomprefix, denominfix and denomsuffix are set and minuspos is not -1 or the fraction is positive - labelattrs is a list of attributes for a texrunners text method; None is considered as an empty list; labelattrs might be changed in the painter as wellN(sprefixsselfsinfixssuffixs numprefixsnuminfixs numsuffixs denomprefixs denominfixs denomsuffixsplussminussminuspossovers equaldenomsskip1sskipnum0sskipnum1s skipdenom1s labelattrs(sselfsprefixsinfixssuffixs numprefixsnuminfixs numsuffixs denomprefixs denominfixs denomsuffixsplussminussminuspossovers equaldenomsskip1sskipnum0sskipnum1s skipdenom1s labelattrs((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pys__init__%s(+                  cGsÊt|ƒdjom|\}}||jo||f\}}nx3|djo%|t||ƒf\}\}}qEW|Snt|ƒo9|d}x$|dD]}|i||ƒ}q¢W|SndS(sEreturns the greates common divisor of all elements in n - the elements of n must be non-negative integers - return None if the number of elements is zero - the greates common divisor is not affected when some of the elements are zero, but it becomes zero when all elements are zeroiiiN( slensnsisjsdivmodsdummysressselfsgcd(sselfsnsdummysisressj((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pysgcdes   &   cGs[t|ƒoJ|d}x5|dD])}t|||i||ƒƒd}q"W|SndS(sreturns the least common multiple of all elements in n - the elements of n must be non-negative integers - return None if the number of elements is zero - the least common multiple is zero when some of the elements are zeroiiN(slensnsressisdivmodsselfsgcd(sselfsnsisres((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pyslcmys   'cCsg} x|D]}|itjo |itj oâ| i|ƒ|i|_|i |_ d|_ |idjo|i |_ |i |_n|i djo|i |_ |i |_ n|i |i|i ƒ}t|i|ƒt|i |ƒf\\|_}\|_ } q q W|io«|igi}|D]'}|itjo||i ƒq7q7~Œ}|tj oSxP| D]D}t||i ƒ\} }| |i| |i f\|_|_ q~WqÎnxH| D]@}d}} }|i djo |i}n |i}|idjo |}nA|idjo |} n'|idjo |}n tdƒ‚|io |idjo d|_ns|ioÙ|i oÏ|idjo¿|i djo¯t!|i"ƒpt!|i#ƒp t!|i$ƒot!| ƒ oqt!|i%ƒ o`t!|i&ƒ oOt!|i'ƒ o>t!|ƒ o0t!|i(ƒ ot!|i)ƒ ot!|i*ƒ o&d|i"||i#|i$f|_ng|i+o=|idjo-t!|i%ƒpt!|i&ƒp t!|i'ƒo&d|i%| |i&|i'f|_n)d|i%| |i&|i|i'f|_|i oN|i djo>t!|ƒ o0t!|i(ƒ ot!|i)ƒ ot!|i*ƒ o |i} nBd|i(||i)|i |i*f|_ |i-|i|i f} d |i"||i#| |i$f|_|i.|i.|_.qÕWdS( Niisiÿÿÿÿsinvalid minusposs0s%s%s%s%ss %s%s%s%i%ss %s%s%s%s%s(/s labeledtickssticksstickslabelsNones labellevelsappendsnumstemp_rationalnumsdenomstemp_rationaldenomstemp_rationalminussselfsgcdsdivmodsdummy1sdummy2s equaldenomslcms_[1]sfactorsdummys rationalminussrationalnumminussrationaldenomminussminuss plusminussplussminusposs RuntimeErrorsskipnum0sskip1s skipdenom1slensprefixsinfixssuffixs numprefixsnuminfixs numsuffixs denomprefixs denominfixs denomsuffixsskipnum1srationalsovers labelattrs(sselfstickssdummysdummy1sgcds plusminussrationaldenomminuss equaldenoms_[1]s labeledtickssrationalsfactorsdummy2srationalnumminussticks rationalminus((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pyslabels…sb       D G 2       æ&J&([ (%( s__name__s __module__s__doc__s_Itexters__implements__stextsmathmodes__init__sgcdslcmslabels(((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pysrationals H@  N( spyxstextspyx.graph.axissticks_Itextersdecimals exponentialsmixedsrational(s exponentialstextsdecimals_Itextersrationalsmixedstick((sI/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/graph/axis/texter.pys?s  \k-