![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/local/lib/python3.6/dist-packages/sympy/diffgeom/tests/ |
Upload File : |
from sympy.diffgeom import Manifold, Patch, CoordSystem, Point from sympy import symbols, Function from sympy.testing.pytest import warns_deprecated_sympy m = Manifold('m', 2) p = Patch('p', m) a, b = symbols('a b') cs = CoordSystem('cs', p, [a, b]) x, y = symbols('x y') f = Function('f') s1, s2 = cs.coord_functions() v1, v2 = cs.base_vectors() f1, f2 = cs.base_oneforms() def test_point(): point = Point(cs, [x, y]) assert point != Point(cs, [2, y]) #TODO assert point.subs(x, 2) == Point(cs, [2, y]) #TODO assert point.free_symbols == set([x, y]) def test_subs(): assert s1.subs(s1, s2) == s2 assert v1.subs(v1, v2) == v2 assert f1.subs(f1, f2) == f2 assert (x*f(s1) + y).subs(s1, s2) == x*f(s2) + y assert (f(s1)*v1).subs(v1, v2) == f(s1)*v2 assert (y*f(s1)*f1).subs(f1, f2) == y*f(s1)*f2 def test_deprecated(): with warns_deprecated_sympy(): cs_wname = CoordSystem('cs', p, ['a', 'b']) assert cs_wname == cs_wname.func(*cs_wname.args)