Esempio 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()
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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
Esempio 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
Esempio 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
Esempio 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
Esempio 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
Esempio 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
Esempio 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
Esempio 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
Esempio n. 14
0
def test_dim_simplify_pow():
    assert dim_simplify(Pow(L, 2)) == L**2
    assert dim_simplify(L**2) == L**2
Esempio n. 15
0
def test_dim_simplify_mul():
    assert dim_simplify(L * T) == L * T
    assert dim_simplify(L * T) == L * T
Esempio n. 16
0
def test_dim_simplify_add():
    assert dim_simplify(Add(L, L)) == L
    assert dim_simplify(L + L) == L
Esempio 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
Esempio 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
Esempio 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
Esempio n. 20
0
def test_dim_simplify_add():
    assert dim_simplify(Add(L, L)) == L
    assert dim_simplify(L + L) == L
Esempio 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
Esempio n. 22
0
def test_dim_simplify_mul():
    assert dim_simplify(Mul(L, T)) == L*T
    assert dim_simplify(L*T) == L*T
Esempio 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
Esempio n. 24
0
def test_dim_simplify_pow():
    assert dim_simplify(Pow(L, 2)) == L**2
    assert dim_simplify(L**2) == L**2
Esempio 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
Esempio 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
Esempio 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()
Esempio 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