rL i8dZddlZddlZddlmZGddZy)zUnitDbl module.N)_apic eZdZdZdddddddd d Zd d d dZdZdZdZdZ dZ dZ e je ejZe je ej"Ze je ej&Ze je ej*Ze je ej.Ze je ej2ZdZe jeej8Ze jeej<ZdZ e je ejBZ"e je ejBZ#dZ$dZ%dZ&e'ddZ(dZ)y)UnitDblzClass UnitDbl in development.)gMbP?km)r)g8~߿?r)rrad)g:RFߑ?r)rsec)gN@r )ir )mrmilerdegr minhourdistanceangletime)rrr ctj|j|}t||dz|_|d|_y)aI Create a new UnitDbl object. Units are internally converted to km, rad, and sec. The only valid inputs for units are [m, km, mile, rad, deg, sec, min, hour]. The field UnitDbl.value will contain the converted value. Use the convert() method to get a specific type of units back. = ERROR CONDITIONS - If the input units are not in the allowed list, an error is thrown. = INPUT VARIABLES - value The numeric value of the UnitDbl. - units The string name of the units the value is in. unitsrrN)r check_getitemallowedfloat_value_units)selfvaluerdatas j/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/testing/jpl_units/UnitDbl.py__init__zUnitDbl.__init__#s9"!!$,,e<EDGO, 1g c|j|k(r |jStj|j|}|j|dk7rt d|d|d|j|dz S)a Convert the UnitDbl to a specific set of units. = ERROR CONDITIONS - If the input units are not in the allowed list, an error is thrown. = INPUT VARIABLES - units The string name of the units to convert to. = RETURN VALUE - Returns the value of the UnitDbl in the requested units as a floating point number. rrz[Error trying to convert to different units. Invalid conversion requested. UnitDbl: z Units:  r)rrrrr ValueError)rrrs rconvertzUnitDbl.convert8s} ;;% ;; !!$,,e< ;;$q' ! --1F3--2G278 8{{T!W$$rcTtt|j|jS)z*Return the absolute value of this UnitDbl.)rabsrrrs r__abs__zUnitDbl.__abs__Pss4;;'55rcDt|j |jS)z*Return the negative value of this UnitDbl.rrrr&s r__neg__zUnitDbl.__neg__Ts |T[[11rc,t|jS)z$Return the truth value of a UnitDbl.)boolrr&s r__bool__zUnitDbl.__bool__XsDKK  rc`|j|d||j|jS)zACheck that *self* and *rhs* share units; compare them using *op*.compare)checkSameUnitsrroprhss r_cmpz UnitDbl._cmp\s' C+$++szz**rc|j||jt||j|j|jS)zACheck that *self* and *rhs* share units; combine them using *op*.)r0__name__rrrr1s r_binop_unit_unitzUnitDbl._binop_unit_uniths6 C-r$++szz2DKK@@rcPt||j||jS)z'Combine *self* and *scalar* using *op*.r))rr2scalars r_binop_unit_scalarzUnitDbl._binop_unit_scalarpsr$++v. <d|jdd|jdS)r<zUnitDbl(r=z, 'z')r>r&s r__repr__zUnitDbl.__repr__{s!$++aDKK=;;rc4|j|jS)z Return the type of UnitDbl data.)_typesrr&s rtypez UnitDbl.types{{4;;''rNc|td|j}g}d} |||zz}||k\r |S|j||dz }')a? Generate a range of UnitDbl objects. Similar to the Python range() method. Returns the range [ start, stop) at the requested step. Each element will be a UnitDbl object. = INPUT VARIABLES - start The starting value of the range. - stop The stop value of the range. - step Optional step to use. If set to None, then a UnitDbl of value 1 w/ the units of the start is used. = RETURN VALUE - Returns a list containing the requested UnitDbl values. rr)rrappend)startstopstepelemsids rrangez UnitDbl.ranges`$ <1ell+D D ADy   LLO FA rc|j|jk7r(td|d|jd|jy)aI Check to see if units are the same. = ERROR CONDITIONS - If the units of the rhs UnitDbl are not the same as our units, an error is thrown. = INPUT VARIABLES - rhs The UnitDbl to check for the same units - func The name of the function doing the check. zCannot z units of different types. LHS: z RHS: N)rr")rr3funcs rr0zUnitDbl.checkSameUnitssM ;;#** $wtf-%%)[[M2%%(ZZL23 3 %r)N)*r6 __module__ __qualname____doc__rrCrr#r'r*r-r4 functools partialmethodoperatoreq__eq__ne__ne__lt__lt__le__le__gt__gt__ge__ge__r7add__add__sub__sub__r:mul__mul____rmul__r?rArD staticmethodrMr0rrrr s' -  G F *%062!+ %Y $ $T8;; 7F $Y $ $T8;; 7F $Y $ $T8;; 7F $Y $ $T8;; 7F $Y $ $T8;; 7F $Y $ $T8;; 7FA &i%%&6 EG%i%%&6 EG=&i%%&8(,,GG&y&&'98<<HH1<(B3rr)rRrSrU matplotlibrrrjrrrlsk3k3r