constants.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # This file is not meant for public use and will be removed in SciPy v2.0.0.
  2. # Use the `scipy.constants` namespace for importing the functions
  3. # included below.
  4. import warnings
  5. from . import _constants
  6. __all__ = [ # noqa: F822
  7. 'Avogadro', 'Boltzmann', 'Btu', 'Btu_IT', 'Btu_th', 'G',
  8. 'Julian_year', 'N_A', 'Planck', 'R', 'Rydberg',
  9. 'Stefan_Boltzmann', 'Wien', 'acre', 'alpha',
  10. 'angstrom', 'arcmin', 'arcminute', 'arcsec',
  11. 'arcsecond', 'astronomical_unit', 'atm',
  12. 'atmosphere', 'atomic_mass', 'atto', 'au', 'bar',
  13. 'barrel', 'bbl', 'blob', 'c', 'calorie',
  14. 'calorie_IT', 'calorie_th', 'carat', 'centi',
  15. 'convert_temperature', 'day', 'deci', 'degree',
  16. 'degree_Fahrenheit', 'deka', 'dyn', 'dyne', 'e',
  17. 'eV', 'electron_mass', 'electron_volt',
  18. 'elementary_charge', 'epsilon_0', 'erg',
  19. 'exa', 'exbi', 'femto', 'fermi', 'fine_structure',
  20. 'fluid_ounce', 'fluid_ounce_US', 'fluid_ounce_imp',
  21. 'foot', 'g', 'gallon', 'gallon_US', 'gallon_imp',
  22. 'gas_constant', 'gibi', 'giga', 'golden', 'golden_ratio',
  23. 'grain', 'gram', 'gravitational_constant', 'h', 'hbar',
  24. 'hectare', 'hecto', 'horsepower', 'hour', 'hp',
  25. 'inch', 'k', 'kgf', 'kibi', 'kilo', 'kilogram_force',
  26. 'kmh', 'knot', 'lambda2nu', 'lb', 'lbf',
  27. 'light_year', 'liter', 'litre', 'long_ton', 'm_e',
  28. 'm_n', 'm_p', 'm_u', 'mach', 'mebi', 'mega',
  29. 'metric_ton', 'micro', 'micron', 'mil', 'mile',
  30. 'milli', 'minute', 'mmHg', 'mph', 'mu_0', 'nano',
  31. 'nautical_mile', 'neutron_mass', 'nu2lambda',
  32. 'ounce', 'oz', 'parsec', 'pebi', 'peta',
  33. 'pi', 'pico', 'point', 'pound', 'pound_force',
  34. 'proton_mass', 'psi', 'pt', 'short_ton',
  35. 'sigma', 'slinch', 'slug', 'speed_of_light',
  36. 'speed_of_sound', 'stone', 'survey_foot',
  37. 'survey_mile', 'tebi', 'tera', 'ton_TNT',
  38. 'torr', 'troy_ounce', 'troy_pound', 'u',
  39. 'week', 'yard', 'year', 'yobi', 'yocto',
  40. 'yotta', 'zebi', 'zepto', 'zero_Celsius', 'zetta'
  41. ]
  42. def __dir__():
  43. return __all__
  44. def __getattr__(name):
  45. if name not in __all__:
  46. raise AttributeError(
  47. "scipy.constants.constants is deprecated and has no attribute "
  48. f"{name}. Try looking in scipy.constants instead.")
  49. warnings.warn(f"Please use `{name}` from the `scipy.constants` namespace, "
  50. "the `scipy.constants.constants` namespace is deprecated.",
  51. category=DeprecationWarning, stacklevel=2)
  52. return getattr(_constants, name)