Ejemplo n.º 1
0
def test_dim_simplify_dimless():
    # TODO: this should be somehow simplified on its own,
    # without the need of calling `dim_simplify`:
    assert dim_simplify(
        sin(L * L**-1)**2 *
        L).get_dimensional_dependencies() == L.get_dimensional_dependencies()
    assert dim_simplify(
        sin(L * L**(-1))**2 *
        L).get_dimensional_dependencies() == L.get_dimensional_dependencies()
Ejemplo n.º 2
0
def test_dim_simplify_dimless():
    # TODO: this should be somehow simplified on its own,
    # without the need of calling `dim_simplify`:
    with warns_deprecated_sympy():
        assert dim_simplify(sin(L*L**-1)**2*L).get_dimensional_dependencies()\
               == dimsys_default.get_dimensional_dependencies(L)
    with warns_deprecated_sympy():
        assert dim_simplify(sin(L * L**(-1))**2 * L).get_dimensional_dependencies()\
               == dimsys_default.get_dimensional_dependencies(L)
Ejemplo n.º 3
0
def test_dim_simplify_dimless():
    # TODO: this should be somehow simplified on its own,
    # without the need of calling `dim_simplify`:
    with warns_deprecated_sympy():
        assert dim_simplify(sin(L*L**-1)**2*L).get_dimensional_dependencies()\
               == dimsys_default.get_dimensional_dependencies(L)
    with warns_deprecated_sympy():
        assert dim_simplify(sin(L * L**(-1))**2 * L).get_dimensional_dependencies()\
               == dimsys_default.get_dimensional_dependencies(L)
Ejemplo n.º 4
0
def test_dim_simplify_dimless():
    # TODO: this should be somehow simplified on its own,
    # without the need of calling `dim_simplify`:
    with warnings.catch_warnings():
        warnings.filterwarnings("ignore", category=SymPyDeprecationWarning)

        assert dim_simplify(sin(L*L**-1)**2*L).get_dimensional_dependencies()\
               == dimsys_default.get_dimensional_dependencies(L)
        assert dim_simplify(sin(L * L**(-1))**2 * L).get_dimensional_dependencies()\
               == dimsys_default.get_dimensional_dependencies(L)
Ejemplo n.º 5
0
def test_dim_simplify_dimless():
    # TODO: this should be somehow simplified on its own,
    # without the need of calling `dim_simplify`:
    with warnings.catch_warnings():
        warnings.filterwarnings("ignore", category=SymPyDeprecationWarning)

        assert dim_simplify(sin(L*L**-1)**2*L).get_dimensional_dependencies()\
               == dimsys_default.get_dimensional_dependencies(L)
        assert dim_simplify(sin(L * L**(-1))**2 * L).get_dimensional_dependencies()\
               == dimsys_default.get_dimensional_dependencies(L)
Ejemplo n.º 6
0
def test_dim_simplify_rec():
    with warnings.catch_warnings():
        warnings.filterwarnings("ignore", category=SymPyDeprecationWarning)
        assert dim_simplify(Mul(Add(L, L), T)) == L * T
        assert dim_simplify((L + L) * T) == L * T
Ejemplo n.º 7
0
def test_dim_simplify_pow():
    with warnings.catch_warnings():
        warnings.filterwarnings("ignore", category=SymPyDeprecationWarning)
        assert dim_simplify(Pow(L, 2)) == L**2
        assert dim_simplify(L**2) == L**2
Ejemplo n.º 8
0
def test_dim_simplify_add():
    with warnings.catch_warnings():
        warnings.filterwarnings("ignore", category=SymPyDeprecationWarning)
        assert dim_simplify(Add(L, L)) == L
        assert dim_simplify(L + L) == L
Ejemplo n.º 9
0
def test_dim_simplify_mul():
    with warns_deprecated_sympy():
        assert dim_simplify(Mul(L, T)) == L*T
    with warns_deprecated_sympy():
        assert dim_simplify(L*T) == L*T
Ejemplo n.º 10
0
def test_dim_simplify_rec():
    with warns_deprecated_sympy():
        assert dim_simplify(Mul(Add(L, L), T)) == L * T
    with warns_deprecated_sympy():
        assert dim_simplify((L + L) * T) == L * T
Ejemplo n.º 11
0
def test_dim_simplify_mul():
    with warns_deprecated_sympy():
        assert dim_simplify(Mul(L, T)) == L * T
    with warns_deprecated_sympy():
        assert dim_simplify(L * T) == L * T
Ejemplo n.º 12
0
def test_dim_simplify_pow():
    with warnings.catch_warnings():
        warnings.filterwarnings("ignore", category=SymPyDeprecationWarning)
        assert dim_simplify(Pow(L, 2)) == L**2
        assert dim_simplify(L**2) == L**2
Ejemplo n.º 13
0
def test_dim_simplify_rec():
    assert dim_simplify(Mul(Add(L, L), T)) == L * T
    assert dim_simplify((L + L) * T) == L * T
Ejemplo n.º 14
0
def test_dim_simplify_pow():
    assert dim_simplify(Pow(L, 2)) == L**2
    assert dim_simplify(L**2) == L**2
Ejemplo n.º 15
0
def test_dim_simplify_mul():
    assert dim_simplify(L * T) == L * T
    assert dim_simplify(L * T) == L * T
Ejemplo n.º 16
0
def test_dim_simplify_add():
    assert dim_simplify(Add(L, L)) == L
    assert dim_simplify(L + L) == L
Ejemplo n.º 17
0
def test_dim_simplify_rec():
    with warns_deprecated_sympy():
        assert dim_simplify(Mul(Add(L, L), T)) == L*T
    with warns_deprecated_sympy():
        assert dim_simplify((L + L) * T) == L*T
Ejemplo n.º 18
0
def test_dim_simplify_pow():
    with warns_deprecated_sympy():
        assert dim_simplify(Pow(L, 2)) == L**2
    with warns_deprecated_sympy():
        assert dim_simplify(L**2) == L**2
Ejemplo n.º 19
0
def test_dim_simplify_add():
    with warnings.catch_warnings():
        warnings.filterwarnings("ignore", category=SymPyDeprecationWarning)
        assert dim_simplify(Add(L, L)) == L
        assert dim_simplify(L + L) == L
Ejemplo n.º 20
0
def test_dim_simplify_add():
    assert dim_simplify(Add(L, L)) == L
    assert dim_simplify(L + L) == L
Ejemplo n.º 21
0
def test_dim_simplify_rec():
    with warnings.catch_warnings():
        warnings.filterwarnings("ignore", category=SymPyDeprecationWarning)
        assert dim_simplify(Mul(Add(L, L), T)) == L*T
        assert dim_simplify((L + L) * T) == L*T
Ejemplo n.º 22
0
def test_dim_simplify_mul():
    assert dim_simplify(Mul(L, T)) == L*T
    assert dim_simplify(L*T) == L*T
Ejemplo n.º 23
0
def test_dim_simplify_add():
    with warns_deprecated_sympy():
        assert dim_simplify(Add(L, L)) == L
    with warns_deprecated_sympy():
        assert dim_simplify(L + L) == L
Ejemplo n.º 24
0
def test_dim_simplify_pow():
    assert dim_simplify(Pow(L, 2)) == L**2
    assert dim_simplify(L**2) == L**2
Ejemplo n.º 25
0
def test_dim_simplify_pow():
    with warns_deprecated_sympy():
        assert dim_simplify(Pow(L, 2)) == L**2
    with warns_deprecated_sympy():
        assert dim_simplify(L**2) == L**2
Ejemplo n.º 26
0
def test_dim_simplify_rec():
    assert dim_simplify(Mul(Add(L, L), T)) == L*T
    assert dim_simplify((L + L) * T) == L*T
Ejemplo n.º 27
0
def test_dim_simplify_dimless():
    # TODO: this should be somehow simplified on its own,
    # without the need of calling `dim_simplify`:
    assert dim_simplify(sin(L*L**-1)**2*L).get_dimensional_dependencies() == L.get_dimensional_dependencies()
    assert dim_simplify(sin(L * L**(-1))**2 * L).get_dimensional_dependencies() == L.get_dimensional_dependencies()
Ejemplo n.º 28
0
def test_dim_simplify_add():
    with warns_deprecated_sympy():
        assert dim_simplify(Add(L, L)) == L
    with warns_deprecated_sympy():
        assert dim_simplify(L + L) == L