Permalink
Browse files

* Merged in content from old project structure's trunk/enthought.unit…

…s_3.0.
  • Loading branch information...
1 parent 99be704 commit 32448f72d7abb92f4ab3d38b1ddf816c936e333a dpeterson committed Jan 8, 2008
Showing with 6,445 additions and 3 deletions.
  1. +4 −0 TODO.txt
  2. +120 −0 enthought/units/SI.py
  3. +20 −0 enthought/units/__init__.py
  4. +43 −0 enthought/units/acceleration.py
  5. +37 −0 enthought/units/angle.py
  6. +26 −0 enthought/units/api.py
  7. +38 −0 enthought/units/area.py
  8. +112 −0 enthought/units/convert.py
  9. +41 −0 enthought/units/data/unit_families.txt
  10. +40 −0 enthought/units/data/unit_family_membership.txt
  11. +41 −0 enthought/units/data/unit_formatting.txt
  12. +41 −0 enthought/units/data/unit_ranges.txt
  13. +62 −0 enthought/units/density.py
  14. +61 −0 enthought/units/energy.py
  15. +138 −0 enthought/units/family_name_trait.py
  16. +21 −0 enthought/units/force.py
  17. +40 −0 enthought/units/frequency.py
  18. +149 −0 enthought/units/geo_units.py
  19. +96 −0 enthought/units/length.py
  20. +74 −0 enthought/units/mass.py
  21. +79 −0 enthought/units/meta_quantity.py
  22. 0 enthought/units/plugin/__init__.py
  23. 0 enthought/units/plugin/action/__init__.py
  24. +47 −0 enthought/units/plugin/action/set_unit_system_action.py
  25. BIN enthought/units/plugin/images/error.png
  26. BIN enthought/units/plugin/images/quantity.png
  27. +138 −0 enthought/units/plugin/new_quantity_resource_page.py
  28. +81 −0 enthought/units/plugin/new_quantity_wizard.py
  29. +63 −0 enthought/units/plugin/new_scalar_wizard.py
  30. +26 −0 enthought/units/plugin/quantity_node_type.py
  31. +46 −0 enthought/units/plugin/quantity_resource_editor.py
  32. +26 −0 enthought/units/plugin/quantity_resource_open_cookie.py
  33. +56 −0 enthought/units/plugin/quantity_resource_type.py
  34. +112 −0 enthought/units/plugin/resource_type_plugin_definition.py
  35. +55 −0 enthought/units/plugin/units_plugin.py
  36. +147 −0 enthought/units/plugin/units_plugin_definition.py
  37. +74 −0 enthought/units/plugin/units_resource_plugin_definition.py
  38. +114 −0 enthought/units/plugin/units_ui_plugin_definition.py
  39. +29 −0 enthought/units/power.py
  40. +51 −0 enthought/units/pressure.py
  41. +368 −0 enthought/units/quantity.py
  42. +66 −0 enthought/units/quantity_trait.py
  43. +324 −0 enthought/units/quantity_traits.py
  44. +13 −0 enthought/units/scalar.py
  45. +125 −0 enthought/units/smart_unit.py
  46. +66 −0 enthought/units/speed.py
  47. +95 −0 enthought/units/style_manager.py
  48. +27 −0 enthought/units/substance.py
  49. +43 −0 enthought/units/temperature.py
  50. +73 −0 enthought/units/tests/meta_quantity_test_case.py
  51. +318 −0 enthought/units/tests/traits_test_case.py
  52. +332 −0 enthought/units/tests/units_test_case.py
  53. +73 −0 enthought/units/time.py
  54. 0 enthought/units/ui/__init__.py
  55. +71 −0 enthought/units/ui/meta_quantity_view.py
  56. +97 −0 enthought/units/ui/quantity_view.py
  57. +258 −0 enthought/units/unit.py
  58. +273 −0 enthought/units/unit_converter.py
  59. +331 −0 enthought/units/unit_db.py
  60. +507 −0 enthought/units/unit_manager.py
  61. +209 −0 enthought/units/unit_parser.py
  62. +151 −0 enthought/units/unit_system.py
  63. +155 −0 enthought/units/unit_traits.py
  64. +7 −0 enthought/units/units_version.py
  65. +87 −0 enthought/units/volume.py
  66. +2 −0 extras.map
  67. +26 −3 setup.py
View
@@ -0,0 +1,4 @@
+* Remove the explicit usage of wx. GUI backends should be swappable.
+
+* Remove the imports of the cp library.
+
View
@@ -0,0 +1,120 @@
+#!/usr/bin/env python
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Michael A.G. Aivazis
+# California Institute of Technology
+# (C) 1998-2003 All Rights Reserved
+#
+# <LicenseText>
+#
+# Modified: 2005-5-23, inserted into enthought package...re-rooted import
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+
+
+from copy import copy
+from enthought.units.unit import unit, dimensionless, none
+
+# basic SI units
+
+meter = unit(1.0, (1, 0, 0, 0, 0, 0, 0))
+kilogram = unit(1.0, (0, 1, 0, 0, 0, 0, 0))
+second = unit(1.0, (0, 0, 1, 0, 0, 0, 0))
+ampere = unit(1.0, (0, 0, 0, 1, 0, 0, 0))
+mole = unit(1.0, (0, 0, 0, 0, 0, 1, 0))
+candela = unit(1.0, (0, 0, 0, 0, 0, 0, 1))
+# moved kelvin to temperature for now
+
+# the 22 derived SI units with special names
+
+radian = copy(dimensionless) # plane angle
+radian.label = 'radian'
+
+steradian = copy(dimensionless) # solid angle
+steradian.label = 'steradian'
+hertz = 1/second # frequency
+hertz.label = 'Hz'
+newton = meter*kilogram/second**2 # force
+newton.label = 'newton'
+
+pascal = newton/meter**2 # pressure
+pascal.label = 'pascal'
+
+joule = newton*meter # work, heat
+joule.label = 'joule'
+
+watt = joule/second # power, radiant flux
+watt.label = 'watt'
+coulomb = ampere*second # electric charge
+coulomb.label = 'coulomb'
+
+volt = watt/ampere # electric potential difference
+volt.label = 'volt'
+
+farad = coulomb/volt # capacitance
+farad.label = 'farad'
+
+ohm = volt/ampere # electric resistance
+ohm.label = 'ohm'
+
+siemens = ampere/volt # electric conductance
+siemens.label = 'siemen'
+
+weber = volt*second # magnetic flux
+weber.label = 'weber'
+
+tesla = weber/meter**2 # magnetic flux density
+tesla.label = 'tesla'
+
+henry = weber/ampere # inductance
+henry.label = 'henry'
+
+lumen = candela*steradian # luminus flux
+lumen.label = 'lumen'
+
+lux = lumen/meter**2 # illuminance
+lux.label = 'lux'
+
+becquerel = 1/second # radioactivity
+becquerel.label = 'becquerel'
+
+gray = joule/kilogram # absorbed dose
+gray.label = 'gray'
+
+sievert = joule/kilogram # dose equivalent
+sievert.label = 'sievert'
+
+katal = mole/second # catalytic activity
+katal.label = 'katal'
+
+# prefixes
+
+yotta = 1e24
+zetta = 1e21
+exa = 1e18
+peta = 1e15
+tera = 1e12
+giga = 1e9
+mega = 1e6
+kilo = 1000
+hecto = 100
+deka = 10
+deci = .1
+centi = .01
+milli = .001
+micro = 1e-6
+nano = 1e-9
+pico = 1e-12
+femto = 1e-15
+atto = 1e-18
+zepto = 1e-21
+yocto = 1e-24
+
+
+# version
+__id__ = "$Id: SI.py,v 1.1.1.1 2003/07/02 21:39:14 aivazis Exp $"
+
+#
+# End of file
@@ -0,0 +1,20 @@
+#-------------------------------------------------------------------------------
+#
+# ===========================
+# Units Library
+# ===========================
+#
+# basic units library
+# Author: Michael A.G. Aivazis
+# California Institute of Technology - (C) 1998-2003 All Rights Reserved
+#
+# Enthought physical 'units' package
+# Adds UnitManager et al
+# (c) Copyright 2005 by Enthought Inc.
+#
+#-------------------------------------------------------------------------------
+
+from convert import convert, parser
+from enthought.units.unit_manager import unit_manager
+
+#### EOF #######################################################################
@@ -0,0 +1,43 @@
+#------------------------------------------------------------------------------
+# Copyright (c) 2005, Enthought, Inc.
+# All rights reserved.
+#
+# This software is provided without warranty under the terms of the BSD
+# license included in enthought/LICENSE.txt and may be redistributed only
+# under the conditions described in the aforementioned license. The license
+# is also available online at http://www.enthought.com/licenses/BSD.txt
+# Thanks for using Enthought open source!
+#
+# Author: Travis N. Vaught
+# Date: 05/22/2005
+# Description: Define units of acceleration
+#
+# Symbols defined: feet_per_second_squared [and aliases]
+# meters_per_second_squared [and aliases]
+#
+#------------------------------------------------------------------------------
+
+#####################################################################
+# Imports:
+#####################################################################
+from length import meter, foot
+from time import second
+
+#####################################################################
+# Definitions:
+#####################################################################
+
+feet_per_second_squared = foot/second**2
+feet_per_second_squared.label = 'ft/s^2'
+meters_per_second_squared = meter/second**2
+meters_per_second_squared.label = 'm/s^2'
+
+#####################################################################
+# Aliases:
+#####################################################################
+
+ft_per_s2 = feet_per_second_squared
+f_per_s2 = feet_per_second_squared
+m_per_s2 = meters_per_second_squared
+
+#### EOF ######################################################################
View
@@ -0,0 +1,37 @@
+#------------------------------------------------------------------------------
+# Copyright (c) 2005, Enthought, Inc.
+# All rights reserved.
+#
+# This software is provided without warranty under the terms of the BSD
+# license included in enthought/LICENSE.txt and may be redistributed only
+# under the conditions described in the aforementioned license. The license
+# is also available online at http://www.enthought.com/licenses/BSD.txt
+# Thanks for using Enthought open source!
+#
+# Author: Travis N. Vaught
+# Date: 08/2/2005
+# Description: Define units of angle (dimensionless with meaning)
+#
+#
+# Symbols defined: degree and variants
+#
+#------------------------------------------------------------------------------
+
+#############################################################################
+# Imports:
+#############################################################################
+
+import math
+from SI import radian
+
+#############################################################################
+# Definitions:
+#############################################################################
+
+degree = radian * math.pi / 180.
+degree.label = 'deg'
+degrees = degree
+deg = degree
+
+radian.label = 'radians'
+radians = radian
View
@@ -0,0 +1,26 @@
+#-----------------------------------------------------------------------------
+#
+# Copyright (c) 2006 by Enthought, Inc.
+# All rights reserved.
+#
+# Author: Greg Rogers
+#
+#-----------------------------------------------------------------------------
+
+""" Public API for units system. """
+
+from enthought.units.unit_manager import unit_manager
+from enthought.units.unit_system import UnitSystem
+from enthought.units.unit_parser import unit_parser
+
+from unit_traits import UnitsTrait, UnitSystemTrait
+from family_name_trait import FamilyNameTrait
+
+from enthought.units.unit import unit
+
+from enthought.units.SI import dimensionless
+
+from quantity import Quantity
+from meta_quantity import MetaQuantity
+
+from convert import convert, parser, convert_str
View
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Michael A.G. Aivazis
+# California Institute of Technology
+# (C) 1998-2003 All Rights Reserved
+#
+# <LicenseText>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+
+from length import meter, centimeter, inch, foot, mile
+
+
+#
+# Definitions of common area units
+# Data taken from Appendix F of Halliday, Resnick, Walker, "Fundamentals of Physics",
+# fourth edition, John Willey and Sons, 1993
+
+square_meter = meter**2
+square_centimeter = centimeter**2
+
+square_foot = foot**2
+square_inch = inch**2
+square_mile = mile**2
+
+acre = 43560 * square_foot
+hectare = 10000 * square_meter
+
+barn = 1e-28 * square_meter
+
+# version
+__id__ = "$Id: area.py,v 1.1.1.1 2003/07/02 21:39:14 aivazis Exp $"
+
+#
+# End of file
Oops, something went wrong.

0 comments on commit 32448f7

Please sign in to comment.