Did I find the right examples for you? yes no

All Samples(6)  |  Call(0)  |  Derive(0)  |  Import(6)
Base class for all physical units.

Create own units like:
m = Unit("meter", "m")

src/s/y/sympy-HEAD/sympy/physics/tests/test_units.py   sympy(Download)
from sympy import integrate, Rational, sqrt, Symbol
from sympy.physics.units import (au, amu, charge, day, find_unit,
                                 foot, km, m, meter, minute, s,
                                 speed_of_light, grams, quart, inch)
 

src/s/y/sympy-HEAD/sympy/core/tests/test_expr.py   sympy(Download)
def test_has_units():
    from sympy.physics.units import m, s
 
    assert (x*m/s).has(x)
    assert (x*m/s).has(y, z) is False
def test_sort_key_atomic_expr():
    from sympy.physics.units import m, s
    assert sorted([-m, s], key=lambda arg: arg.sort_key()) == [-m, s]
 
 

src/s/y/sympy-polys-HEAD/sympy/physics/tests/test_units.py   sympy-polys(Download)
from sympy import Rational, Symbol, integrate
from sympy.physics.units import m, s, day, km, foot, meter, au, \
        speed_of_light, minute
 
def test_units():

src/s/y/sympy-polys-HEAD/sympy/integrals/tests/test_integrals.py   sympy-polys(Download)
        raises, Lambda, sstr)
from sympy.utilities.pytest import XFAIL, skip
from sympy.physics.units import m, s
 
x,y,a,t = symbols('xyat')

src/s/y/sympy-polys-HEAD/sympy/core/tests/test_expr.py   sympy-polys(Download)
    assert expr.has_any_symbols(x, y, z, t, u)  == True
 
    from sympy.physics.units import m, s
 
    assert (x*m/s).has_any_symbols(x) == True