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