Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(113)  |  Call(109)  |  Derive(0)  |  Import(4)

src/a/s/astropy-0.3.1/astropy/units/si.py   astropy(Download)
 
from ..constants import si as _si
from .core import UnitBase, Unit, def_unit
 
import numpy as _numpy
# DIMENSIONLESS
 
def_unit(['percent', 'pct'], Unit(0.01), namespace=_ns, prefixes=False,
         doc="percent: one hundredth of unity, factor 0.01",
         format={'generic': '%', 'console': '%', 'cds': '%',
# LENGTH
 
def_unit(['m', 'meter'], namespace=_ns, prefixes=True,
         doc="meter: base unit of length in SI")
 
def_unit(['micron'], um, namespace=_ns,
         doc="micron: alias for micrometer (um)",
         format={'latex': r'\mu m', 'unicode': 'μm'})
 
def_unit(['Angstrom', 'AA', 'angstrom'], 0.1 * nm, namespace=_ns,

src/a/s/astropy-0.3.1/astropy/units/astrophys.py   astropy(Download)
from . import si
from ..constants import si as _si
from .core import UnitBase, def_unit
 
import numpy as _numpy
# LENGTH
 
def_unit((['AU', 'au'], []), _si.au.value * si.m, namespace=_ns, prefixes=True,
         doc="astronomical unit: approximately the mean Earth--Sun "
         "distance.")
 
def_unit(['pc', 'parsec'], _si.pc.value * si.m, namespace=_ns, prefixes=True,
         doc="parsec: approximately 3.26 light-years.")
 
def_unit(['solRad', 'R_sun', 'Rsun'], _si.R_sun.value * si.m, namespace=_ns,
         doc="Solar radius",
         format={'latex': r'R_{\odot}', 'unicode': 'R⊙'})
def_unit(['lyr', 'lightyear'], _si.c.value * si.yr.to(si.s) * si.m, namespace=_ns,
         doc="Light year")
 

src/a/s/astropy-0.3.1/astropy/units/cgs.py   astropy(Download)
 
from . import si
from .core import UnitBase, def_unit
 
 
_ns = globals()
 
def_unit(['cm', 'centimeter'], si.cm, namespace=_ns, prefixes=False)
# ACCELERATION
 
def_unit(['Gal', 'gal'], cm / s ** 2, namespace=_ns, prefixes=True,
         doc="Gal: CGS unit of acceleration")
 
 
# Use CGS definition of erg
def_unit(['erg'], g * cm ** 2 / s ** 2, namespace=_ns, prefixes=True,
         doc="erg: CGS unit of energy")
 
 
##########################################################################
# FORCE
 
def_unit(['dyn', 'dyne'], g * cm / s ** 2, namespace=_ns,

src/a/s/astropy-0.3.1/astropy/units/imperial.py   astropy(Download)
                        unicode_literals)
 
from .core import UnitBase, def_unit
from . import si
 
# LENGTH
 
def_unit(['inch'], 2.54 * si.cm, namespace=_ns,
         doc="International inch")
def_unit(['ft', 'foot'], 12 * inch, namespace=_ns,
         doc="International foot")
def_unit(['yd', 'yard'], 3 * ft, namespace=_ns,
         doc="International yard")
def_unit(['mi', 'mile'], 5280 * ft, namespace=_ns,