OwlCyberSecurity - MANAGER
Edit File: UnitDbl.cpython-38.pyc
U ��]o � @ s d Z ddlZG dd� de�ZdS )zUnitDbl module.� Nc @ s� e Zd ZdZdddddddd d �Zddd d�Zdd� Zdd� Zdd� Zdd� Z dd� Z dd� Zdd� Zdd� Z dd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� Zd)d*� Zd+d,� Zd-d.� Zd/d0� Zd1d2� Zd3d4� Zd5d6� Zd>d8d9�Zee�Zd:d;� Zd<d=� Zd7S )?�UnitDblz"Class UnitDbl in development. )g����MbP?�km)� r )g�8�~߿�?r )r �rad)g:�R�Fߑ?r )r �sec)g N@r )i r )�mr Zmiler Zdegr �minZhourZdistanceZangle�time)r r r c C s4 | � |� | j| }t||d �| _|d | _dS )a@ 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. r r N)� checkUnits�allowed�float�_value�_units)�self�value�units�data� r �F/usr/lib/python3/dist-packages/matplotlib/testing/jpl_units/UnitDbl.py�__init__ s zUnitDbl.__init__c C sX | j |kr| jS | �|� | j| }| j |d krJdt| �|f }t|��| j|d 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. r zoError trying to convert to different units. Invalid conversion requested. UnitDbl: %s Units: %s r )r r r r �str� ValueError)r r r �msgr r r �convert6 s �zUnitDbl.convertc C s t t| j�| j�S )z*Return the absolute value of this UnitDbl.)r �absr r �r r r r �__abs__R s zUnitDbl.__abs__c C s t | j | j�S )z*Return the negative value of this UnitDbl.�r r r r r r r �__neg__V s zUnitDbl.__neg__c C s t | j�S )z$Return the truth value of a UnitDbl.)�boolr r r r r �__bool__Z s zUnitDbl.__bool__c C s | � |tj�S �N)�_cmp�operator�eq�r �rhsr r r �__eq__^ s zUnitDbl.__eq__c C s | � |tj�S r! )r"