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