[cig-commits] r6157 - in cs/spatialdata-0.1/trunk: . spatialdata
spatialdata/geocoords spatialdata/utils tests/pytests/spatialdb
brad at geodynamics.org
brad at geodynamics.org
Thu Mar 1 21:10:45 PST 2007
Author: brad
Date: 2007-03-01 21:10:44 -0800 (Thu, 01 Mar 2007)
New Revision: 6157
Removed:
cs/spatialdata-0.1/trunk/spatialdata/geocoords/Makefile.am
Modified:
cs/spatialdata-0.1/trunk/configure.ac
cs/spatialdata-0.1/trunk/spatialdata/Makefile.am
cs/spatialdata-0.1/trunk/spatialdata/__init__.py
cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSCart.py
cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSGeo.py
cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSGeoLocalCart.py
cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSGeoProj.py
cs/spatialdata-0.1/trunk/spatialdata/geocoords/Converter.py
cs/spatialdata-0.1/trunk/spatialdata/geocoords/CoordSys.py
cs/spatialdata-0.1/trunk/spatialdata/geocoords/Projector.py
cs/spatialdata-0.1/trunk/spatialdata/geocoords/__init__.py
cs/spatialdata-0.1/trunk/spatialdata/utils/ChangeCoordSys.py
cs/spatialdata-0.1/trunk/spatialdata/utils/ConvertApp.py
cs/spatialdata-0.1/trunk/spatialdata/utils/CppData.py
cs/spatialdata-0.1/trunk/spatialdata/utils/PointsStream.py
cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/TestGenSimpleDBApp.py
cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/gensimpledb.cfg
cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/testgen1din2d.odb
cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/testgen1din2d_one.odb
cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/testgen1din2d_two.odb
Log:
Added factory functions and did a little cleanup of source. Changed name of filters in generator to shapers.
Modified: cs/spatialdata-0.1/trunk/configure.ac
===================================================================
--- cs/spatialdata-0.1/trunk/configure.ac 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/configure.ac 2007-03-02 05:10:44 UTC (rev 6157)
@@ -148,7 +148,4 @@
AC_OUTPUT
-# version
-# $Id$
-
# End of file
Modified: cs/spatialdata-0.1/trunk/spatialdata/Makefile.am
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/Makefile.am 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/spatialdata/Makefile.am 2007-03-02 05:10:44 UTC (rev 6157)
@@ -25,8 +25,8 @@
spatialdb/SimpleIO.py \
spatialdb/SpatialDB.py \
spatialdb/__init__.py \
- spatialdb/generator/Filter.py \
- spatialdb/generator/Filters.py \
+ spatialdb/generator/Shaper.py \
+ spatialdb/generator/Shapers.py \
spatialdb/generator/GenSimpleDBApp.py \
spatialdb/generator/Geometry.py \
spatialdb/generator/Value.py \
Modified: cs/spatialdata-0.1/trunk/spatialdata/__init__.py
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/__init__.py 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/spatialdata/__init__.py 2007-03-02 05:10:44 UTC (rev 6157)
@@ -11,8 +11,12 @@
#
## @file spatialdata/__init__.py
+##
## @brief Python top-level SpatialData module initialization
-__all__ = []
+__all__ = ['geocoords',
+ 'spatialdata',
+ 'utils']
+
# End of file
Modified: cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSCart.py
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSCart.py 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSCart.py 2007-03-02 05:10:44 UTC (rev 6157)
@@ -11,18 +11,27 @@
#
## @file spatialdata/geocoords/CSCart.py
+##
## @brief Python manager for Cartesian coordinate systems.
+##
+## Factory: coordsys.
from CoordSys import CoordSys
# CSCart class
class CSCart(CoordSys):
- """Python manager for Cartesian coordinate systems."""
+ """
+ Python manager for Cartesian coordinate systems.
+ Factory: coordsys.
+ """
+
# INVENTORY //////////////////////////////////////////////////////////
class Inventory(CoordSys.Inventory):
- """Python object for managing CSCart facilities and properties."""
+ """
+ Python object for managing CSCart facilities and properties.
+ """
## @class Inventory
## Python object for managing CSCart facilities and properties.
@@ -44,9 +53,21 @@
# PUBLIC METHODS /////////////////////////////////////////////////////
+ def __init__(self, name="cscart"):
+ """Constructor."""
+ CoordSys.__init__(self, name)
+
+ import spatialdata.geocoords.geocoords as bindings
+ self.cppHandle = bindings.CSCart()
+ self.units = "m"
+ self.spaceDim = 3
+ return
+
+
def initialize(self):
- """Initialize coordinate system."""
-
+ """
+ Initialize coordinate system.
+ """
import pyre.units
uparser = pyre.units.parser()
coordUnits = uparser.parse(self.units)
@@ -58,25 +79,25 @@
return
- def __init__(self, name="cscart"):
- """Constructor."""
- CoordSys.__init__(self, name)
-
- import spatialdata.geocoords.geocoords as bindings
- self.cppHandle = bindings.CSCart()
- self.units = "m"
- self.spaceDim = 3
- return
-
-
# PRIVATE METHODS ////////////////////////////////////////////////////
def _configure(self):
- """Setup members using inventory."""
-
+ """
+ Setup members using inventory.
+ """
+ CoordSys._configure(self)
self.units = self.inventory.units
self.spaceDim = self.inventory.spaceDim
return
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def coordsys():
+ """
+ Factory associated with CoordSys.
+ """
+ return CSCart()
+
+
# End of file
Modified: cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSGeo.py
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSGeo.py 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSGeo.py 2007-03-02 05:10:44 UTC (rev 6157)
@@ -11,18 +11,27 @@
#
## @file spatialdata/geocoords/CSGeo.py
+##
## @brief Python manager for geographic coordinate systems.
+##
+## Factory: coordsys.
from CoordSys import CoordSys
# CSGeo class
class CSGeo(CoordSys):
- """Python manager for geographic coordinate systems."""
+ """
+ Python manager for geographic coordinate systems.
+ Factory: coordsys.
+ """
+
# INVENTORY //////////////////////////////////////////////////////////
class Inventory(CoordSys.Inventory):
- """Python object for managing CSGeo facilities and properties."""
+ """
+ Python object for managing CSGeo facilities and properties.
+ """
## @class Inventory
## Python object for managing CSGeo facilities and properties.
@@ -58,10 +67,30 @@
spaceDim = pyre.inventory.int("space_dim", default=3)
spaceDim.meta['tip'] = "Number of dimensions for coordinate system."
+
# PUBLIC METHODS /////////////////////////////////////////////////////
+ def __init__(self, name="csgeo"):
+ """
+ Constructor.
+ """
+ CoordSys.__init__(self, name)
+
+ import spatialdata.geocoords.geocoords as bindings
+ self.cppHandle = bindings.CSGeo()
+ self.ellipsoid = "WGS84"
+ self.datumHoriz = "WGS84"
+ self.datumVert = "ellipsoid"
+ self.isGeocentric = False
+ self.units = "m"
+ self.spaceDim = 3
+ return
+
+
def initialize(self):
- """Initialize coordinate system."""
+ """
+ Initialize coordinate system.
+ """
self.cppHandle.ellipsoid = self.ellipsoid
self.cppHandle.datumHoriz = self.datumHoriz
self.cppHandle.datumVert = self.datumVert
@@ -78,27 +107,14 @@
return
- def __init__(self, name="csgeo"):
- """Constructor."""
- CoordSys.__init__(self, name)
-
- import spatialdata.geocoords.geocoords as bindings
- self.cppHandle = bindings.CSGeo()
- self.ellipsoid = "WGS84"
- self.datumHoriz = "WGS84"
- self.datumVert = "ellipsoid"
- self.isGeocentric = False
- self.units = "m"
- self.spaceDim = 3
- return
-
-
# PRIVATE METHODS ////////////////////////////////////////////////////
def _configure(self):
- """Setup members using inventory."""
-
- self.ellipsoid = self.inventory.ellipsoid
+ """
+ Setup members using inventory.
+ """
+ CoordSys._configure(self)
+ self.ellipsoid = self.inventory.ellipsoidsys
self.datumHoriz = self.inventory.datumHoriz
self.datumVert = self.inventory.datumVert
self.isGeocentric = self.inventory.isGeocentric
@@ -107,4 +123,13 @@
return
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def coordsys():
+ """
+ Factory associated with CoordSys.
+ """
+ return CSGeo()
+
+
# End of file
Modified: cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSGeoLocalCart.py
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSGeoLocalCart.py 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSGeoLocalCart.py 2007-03-02 05:10:44 UTC (rev 6157)
@@ -11,18 +11,27 @@
#
## @file spatialdata/geocoords/CSGeoLocalCart.py
+##
## @brief Python manager for local coordinate systems.
+##
+## Factory: coordsys
from CSGeo import CSGeo
# CSGeoLocalCart class
class CSGeoLocalCart(CSGeo):
- """Python manager for local coordinate systems."""
+ """
+ Python manager for local coordinate systems.
+ Factory: coordsys
+ """
+
# INVENTORY //////////////////////////////////////////////////////////
class Inventory(CSGeo.Inventory):
- """Python object for managing CSGeoLocalCart facilities and properties."""
+ """
+ Python object for managing CSGeoLocalCart facilities and properties.
+ """
## @class Inventory
## Python object for managing CSGeoLocalCart facilities and properties.
@@ -47,19 +56,13 @@
originElev = pyre.inventory.dimensional("origin-elev", default=0.0*m)
originElev.meta['tip'] = "Elevation of origin."
+
# PUBLIC METHODS /////////////////////////////////////////////////////
- def initialize(self):
- """Initialize coordinate system."""
- self.cppHandle.origin(self.originLon, self.originLat,
- self.originElev.value)
- CSGeo.initialize(self)
-
- return
-
-
def __init__(self, name="csgeolocalcart"):
- """Constructor."""
+ """
+ Constructor.
+ """
CSGeo.__init__(self, name)
import spatialdata.geocoords.geocoords as bindings
@@ -72,11 +75,24 @@
return
+ def initialize(self):
+ """
+ Initialize coordinate system.
+ """
+ self.cppHandle.origin(self.originLon, self.originLat,
+ self.originElev.value)
+ CSGeo.initialize(self)
+
+ return
+
+
# PRIVATE METHODS ////////////////////////////////////////////////////
def _configure(self):
- """Setup members using inventory."""
-
+ """
+ Setup members using inventory.
+ """
+ CSGeo._configure(self)
self.originLon = self.inventory.originLon
self.originLat = self.inventory.originLat
self.originElev = self.inventory.originElev
@@ -84,7 +100,13 @@
return
-# version
-__id__ = "$Id$"
+# FACTORIES ////////////////////////////////////////////////////////////
+def coordsys():
+ """
+ Factory associated with CoordSys.
+ """
+ return CSGeoLocalCart()
+
+
# End of file
Modified: cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSGeoProj.py
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSGeoProj.py 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/spatialdata/geocoords/CSGeoProj.py 2007-03-02 05:10:44 UTC (rev 6157)
@@ -11,18 +11,27 @@
#
## @file spatialdata/geocoords/CSGeoProj.py
+##
## @brief Python manager for geographic coordinate systems.
+##
+## Factory: CSGeoProj
from CSGeo import CSGeo
# CoordSysGeo class
class CSGeoProj(CSGeo):
- """Python manager for projected geographic coordinate systems."""
+ """
+ Python manager for projected geographic coordinate systems.
+ Factory: CSGeoProj
+ """
+
# INVENTORY //////////////////////////////////////////////////////////
class Inventory(CSGeo.Inventory):
- """Python object for managing CSGeoProj facilities and properties."""
+ """
+ Python object for managing CSGeoProj facilities and properties.
+ """
## @class Inventory
## Python object for managing CSGeoProj facilities and properties.
@@ -36,23 +45,17 @@
import pyre.inventory
from Projector import Projector
- projector = pyre.inventory.facility("projector", factory=Projector)
+ projector = pyre.inventory.facility("projector", family="projector",
+ factory=Projector)
projector.meta['tip'] = "Geographic coordinate projector."
+
# PUBLIC METHODS /////////////////////////////////////////////////////
- def initialize(self):
- """Initialize coordinate system."""
-
- self.projector.initialize(self)
- self.cppHandle.projector = self.projector.cppHandle
-
- CSGeo.initialize(self)
- return
-
-
def __init__(self, name="csgeoproj"):
- """Constructor."""
+ """
+ Constructor.
+ """
CSGeo.__init__(self, name)
import spatialdata.geocoords.geocoords as bindings
@@ -61,13 +64,35 @@
return
+ def initialize(self):
+ """
+ Initialize coordinate system.
+ """
+ self.projector.initialize(self)
+ self.cppHandle.projector = self.projector.cppHandle
+
+ CSGeo.initialize(self)
+ return
+
+
# PRIVATE METHODS ////////////////////////////////////////////////////
def _configure(self):
- """Setup members using inventory."""
-
+ """
+ Setup members using inventory.
+ """
+ CSGeo._configure(self)
self.projector = self.inventory.projector
return
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def coordsys():
+ """
+ Factory associated with CoordSys.
+ """
+ return CSGeoProj()
+
+
# End of file
Modified: cs/spatialdata-0.1/trunk/spatialdata/geocoords/Converter.py
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/geocoords/Converter.py 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/spatialdata/geocoords/Converter.py 2007-03-02 05:10:44 UTC (rev 6157)
@@ -11,11 +11,14 @@
#
## @file spatialdata/geocoords/Converter.py
+##
## @brief Python function to convert b/t coordinate systems.
def convert(coordsSrc, csDest, csSrc):
- """Convert coordinates from source coordinate system to destination
- coordinate system. Transformation is done in place."""
+ """
+ Convert coordinates from source coordinate system to destination
+ coordinate system. Transformation is done in place.
+ """
if not csDest.spaceDim == csSrc.spaceDim:
msg = "Spatial dimensions of source (%d) and destination (%d) " \
Modified: cs/spatialdata-0.1/trunk/spatialdata/geocoords/CoordSys.py
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/geocoords/CoordSys.py 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/spatialdata/geocoords/CoordSys.py 2007-03-02 05:10:44 UTC (rev 6157)
@@ -11,14 +11,21 @@
#
## @file spatialdata/geocoords/CoordSys.py
+##
## @brief Python manager for coordinate systems.
+##
+## Factory: coordsys
from pyre.components.Component import Component
# CoordSys class
class CoordSys(Component):
- """Python manager for coordinate systems."""
+ """
+ Python manager for coordinate systems.
+ Factory: coordsys
+ """
+
# INVENTORY //////////////////////////////////////////////////////////
class Inventory(Component.Inventory):
@@ -35,28 +42,40 @@
# PUBLIC METHODS /////////////////////////////////////////////////////
- def initialize(self):
- """Initialize coordinate system."""
- self.cppHandle.initialize()
- return
-
-
def __init__(self, name="coordsys"):
- """Constructor."""
+ """
+ Constructor.
+ """
Component.__init__(self, name, facility="coordsys")
self.cppHandle = None
return
+ def initialize(self):
+ """
+ Initialize coordinate system.
+ """
+ self.cppHandle.initialize()
+ return
+
+
# PRIVATE METHODS ////////////////////////////////////////////////////
def _configure(self):
- """Setup members using inventory."""
+ """
+ Setup members using inventory.
+ """
return
-# version
-__id__ = "$Id$"
+# FACTORIES ////////////////////////////////////////////////////////////
+def coordsys():
+ """
+ Factory associated with CoordSys.
+ """
+ return CoordSys()
+
+
# End of file
Deleted: cs/spatialdata-0.1/trunk/spatialdata/geocoords/Makefile.am
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/geocoords/Makefile.am 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/spatialdata/geocoords/Makefile.am 2007-03-02 05:10:44 UTC (rev 6157)
@@ -1,29 +0,0 @@
-# -*- Makefile -*-
-#
-# ----------------------------------------------------------------------
-#
-# Brad T. Aagaard
-# U.S. Geological Survey
-#
-# <LicenseText>
-#
-# ----------------------------------------------------------------------
-#
-
-subpackage = geocoords
-include $(top_srcdir)/subpackage.am
-
-subpkgpyexec_PYTHON = \
- CoordSys.py \
- CSCart.py \
- CSGeo.py \
- CSGeoLocalCart.py \
- CSGeoProj.py \
- Converter.py \
- Projector.py \
- __init__.py
-
-# version
-# $Id$
-
-# End of file
Modified: cs/spatialdata-0.1/trunk/spatialdata/geocoords/Projector.py
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/geocoords/Projector.py 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/spatialdata/geocoords/Projector.py 2007-03-02 05:10:44 UTC (rev 6157)
@@ -11,14 +11,21 @@
#
## @file spatialdata/geocoords/Projector.py
+##
## @brief Python manager for projector.
+##
+## Factory: projector.
from pyre.components.Component import Component
# Projector class
class Projector(Component):
- """Python manager for projector."""
+ """
+ Python manager for projector.
+ Factory: projector.
+ """
+
# INVENTORY //////////////////////////////////////////////////////////
class Inventory(Component.Inventory):
@@ -48,8 +55,21 @@
# PUBLIC METHODS /////////////////////////////////////////////////////
+ def __init__(self, name="projector"):
+ """
+ Constructor.
+ """
+ Component.__init__(self, name, facility="projector")
+
+ import spatialdata.geocoords.geocoords as bindings
+ self.cppHandle = bindings.Projector()
+ return
+
+
def initialize(self, coordSys):
- """Initialize projector."""
+ """
+ Initialize projector.
+ """
self.cppHandle.projection = self.projection
self.cppHandle.units = self.units
@@ -59,36 +79,39 @@
def project(self, lonlat):
- """Project geographic coordinates."""
+ """
+ Project geographic coordinates.
+ """
return self.cppHandle.project(lonlat)
def invproject(self, xy):
- """Project geographic coordinates."""
+ """
+ Project geographic coordinates.
+ """
return self.cppHandle.invproject(xy)
- def __init__(self, name="projector"):
- """Constructor."""
- Component.__init__(self, name, facility="projector")
-
- import spatialdata.geocoords.geocoords as bindings
- self.cppHandle = bindings.Projector()
- return
-
-
# PRIVATE METHODS ////////////////////////////////////////////////////
def _configure(self):
- """Setup members using inventory."""
-
+ """
+ Setup members using inventory.
+ """
+ Component._configure(self)
self.projection = self.inventory.projection
self.units = self.inventory.units
self.projOptions = self.inventory.projOptions
return
-# version
-__id__ = "$Id$"
+# FACTORIES ////////////////////////////////////////////////////////////
+def coordsys():
+ """
+ Factory associated with CoordSys.
+ """
+ return Projector()
+
+
# End of file
Modified: cs/spatialdata-0.1/trunk/spatialdata/geocoords/__init__.py
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/geocoords/__init__.py 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/spatialdata/geocoords/__init__.py 2007-03-02 05:10:44 UTC (rev 6157)
@@ -11,6 +11,7 @@
#
## @file spatialdata/geocoords/__init__.py
+##
## @brief Python spatialdata geocoords module initialization.
__all__ = ['Converter',
@@ -21,7 +22,5 @@
'CSGeo',
'Projector']
-# version
-__id__ = "$Id$"
# End of file
Modified: cs/spatialdata-0.1/trunk/spatialdata/utils/ChangeCoordSys.py
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/utils/ChangeCoordSys.py 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/spatialdata/utils/ChangeCoordSys.py 2007-03-02 05:10:44 UTC (rev 6157)
@@ -11,7 +11,10 @@
#
## @file spatialdata/utils/ChangeCoordSys.py
+##
## @brief Python object for changing coordinate system of points.
+##
+## Factory: converter.
from pyre.components.Component import Component
@@ -19,6 +22,8 @@
class ChangeCoordSys(Component):
"""
Python object for changing coordinate system of points.
+
+ Factory: converter.
"""
# INVENTORY //////////////////////////////////////////////////////////
@@ -43,10 +48,12 @@
from spatialdata.geocoords.CSCart import CSCart
- csSrc = pyre.inventory.facility("cs_src", factory=CSCart)
+ csSrc = pyre.inventory.facility("cs_src", family="coordsys",
+ factory=CSCart)
csSrc.meta['tip'] = "Source coordinate system."
- csDest = pyre.inventory.facility("cs_dest", factory=CSCart)
+ csDest = pyre.inventory.facility("cs_dest", family="coordsys",
+ factory=CSCart)
csDest.meta['tip'] = "Destination coordinate system."
@@ -76,6 +83,7 @@
"""
Set members from inventory.
"""
+ Component._configure(self)
self.csDest = self.inventory.csDest
self.csSrc = self.inventory.csSrc
return
@@ -90,4 +98,13 @@
return
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def converter():
+ """
+ Factory associated with ChangeCoordSys.
+ """
+ return ChangeCoordSys()
+
+
# End of file
Modified: cs/spatialdata-0.1/trunk/spatialdata/utils/ConvertApp.py
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/utils/ConvertApp.py 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/spatialdata/utils/ConvertApp.py 2007-03-02 05:10:44 UTC (rev 6157)
@@ -11,6 +11,7 @@
#
## @file spatialdata/utils/pyconvert.py
+##
## @brief Python convert application driver
from pyre.components.Component import Component
@@ -20,6 +21,7 @@
Component.__init__(self, name="dummy", facility="dummy")
return
+
from pyre.applications.Script import Script
# ConvertApp class
class ConvertApp(Script):
@@ -47,15 +49,19 @@
import pyre.inventory
- reader = pyre.inventory.facility("reader", factory=Dummy)
+ reader = pyre.inventory.facility("reader", family="reader",
+ factory=Dummy)
reader.meta['tip'] = "Reader to load data."
- converter = pyre.inventory.facility("converter", factory=Dummy)
+ converter = pyre.inventory.facility("converter", family="converter",
+ factory=Dummy)
converter.meta['tip'] = "Converter to convert data."
- writer = pyre.inventory.facility("writer", factory=Dummy)
+ writer = pyre.inventory.facility("writer", family="writer",
+ factory=Dummy)
writer.meta['tip'] = "Writer to dump data."
+
# PUBLIC METHODS /////////////////////////////////////////////////////
def main(self, *args, **kwds):
Modified: cs/spatialdata-0.1/trunk/spatialdata/utils/CppData.py
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/utils/CppData.py 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/spatialdata/utils/CppData.py 2007-03-02 05:10:44 UTC (rev 6157)
@@ -11,15 +11,17 @@
#
## @file pylith/utils/CppData.py
-
+##
## @brief Python object to create C++ object holding data values.
-
+##
## Useful in unit testing of C++ objects where data is generate with
## Python code.
##
## If parent property is set, we assume object is providing only the
## data, so data is private and object needs a constructor and
## destructor. Otherwise, object just has public data and no methods.
+##
+## Factory: cpp_data
from pyre.components.Component import Component
@@ -70,7 +72,7 @@
"""
Constructor.
"""
- Component.__init__(self, name, facility="cppdata")
+ Component.__init__(self, name, facility="cpp_data")
self.scalars = []
self.arrays = []
self.app = ""
@@ -118,6 +120,7 @@
"""
Set members based using inventory.
"""
+ Component._configure(self)
self.header = self.inventory.header
self.objname = self.inventory.objname
self.namespace = self.inventory.namespace
@@ -299,4 +302,13 @@
return
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def cpp_data():
+ """
+ Factory associated with CppData.
+ """
+ return CppData()
+
+
# End of file
Modified: cs/spatialdata-0.1/trunk/spatialdata/utils/PointsStream.py
===================================================================
--- cs/spatialdata-0.1/trunk/spatialdata/utils/PointsStream.py 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/spatialdata/utils/PointsStream.py 2007-03-02 05:10:44 UTC (rev 6157)
@@ -11,7 +11,10 @@
#
## @file spatialdata/utils/PointsStream.py
+##
## @brief Python object for reading/writing points from stdin/stdout.
+##
+## Factories: reader, writer
from pyre.components.Component import Component
@@ -26,6 +29,8 @@
class Inventory(Component.Inventory):
"""
Python object for managing PointsStream facilities and properties.
+
+ Factories: reader, writer
"""
## @class Inventory
@@ -114,6 +119,22 @@
self.cppHandle.fieldWidth = self.fieldWidth
self.cppHandle.precision = self.precision
return
-
+
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def writer():
+ """
+ Factory associated with PointsStream.
+ """
+ return PointsStream()
+
+
+def reader():
+ """
+ Factory associated with PointsStream.
+ """
+ return PointsStream()
+
+
# End of file
Modified: cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/TestGenSimpleDBApp.py
===================================================================
--- cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/TestGenSimpleDBApp.py 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/TestGenSimpleDBApp.py 2007-03-02 05:10:44 UTC (rev 6157)
@@ -22,8 +22,6 @@
Test GenSimpleDBApp with 1-D data in 2-D space.
"""
from spatialdata.spatialdb.generator.GenSimpleDBApp import GenSimpleDBApp
- from spatialdata.spatialdb.generator.Value import Value
- from spatialdata.spatialdb.generator.Filter import Filter
from spatialdata.geocoords.CSCart import CSCart
from spatialdata.spatialdb.SimpleDB import SimpleDB
from spatialdata.spatialdb.SimpleIOAscii import SimpleIOAscii
Modified: cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/gensimpledb.cfg
===================================================================
--- cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/gensimpledb.cfg 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/gensimpledb.cfg 2007-03-02 05:10:44 UTC (rev 6157)
@@ -1,61 +1,61 @@
[gensimpledb]
# ----------------------------------------------------------------------
-# Journal
+# journal
# ----------------------------------------------------------------------
#journal.info.gensimpledb = 1
# ----------------------------------------------------------------------
-# Geometry
+# geometry
# ----------------------------------------------------------------------
geometry.reader = testgen1din2d
geometry.data_dim = 2
geometry.coordsys.space_dim = 2
# ----------------------------------------------------------------------
-# Values
+# values
# ----------------------------------------------------------------------
values = testgen1din2d
values.one.name = One
values.one.units = kg
-values.one.filters = testgen1din2d_one
+values.one.shapers = testgen1din2d_one
values.two.name = Two
values.two.units = m
-values.two.filters = testgen1din2d_two
+values.two.shapers = testgen1din2d_two
-values.one.filters.bg.default = 0.0
-values.one.filters.bg.operand = add
-values.one.filters.bg.db_value = One
-values.one.filters.bg.db.query_type = linear
-values.one.filters.bg.db.iohandler.filename = data/gen1Din2D_one_bg.spatialdb
-values.one.filters.add.default = 1.0
-values.one.filters.add.operand = add
-values.one.filters.add.db_value = One
-values.one.filters.add.db.query_type = linear
-values.one.filters.add.db.iohandler.filename = data/gen1Din2D_one_add.spatialdb
-values.one.filters.multiply.default = 0.0
-values.one.filters.multiply.operand = multiply
-values.one.filters.multiply.db_value = One
-values.one.filters.multiply.db.query_type = linear
-values.one.filters.multiply.db.iohandler.filename = data/gen1Din2D_one_multiply.spatialdb
+values.one.shapers.bg.default = 0.0
+values.one.shapers.bg.operand = add
+values.one.shapers.bg.db_value = One
+values.one.shapers.bg.db.query_type = linear
+values.one.shapers.bg.db.iohandler.filename = data/gen1Din2D_one_bg.spatialdb
+values.one.shapers.add.default = 1.0
+values.one.shapers.add.operand = add
+values.one.shapers.add.db_value = One
+values.one.shapers.add.db.query_type = linear
+values.one.shapers.add.db.iohandler.filename = data/gen1Din2D_one_add.spatialdb
+values.one.shapers.multiply.default = 0.0
+values.one.shapers.multiply.operand = multiply
+values.one.shapers.multiply.db_value = One
+values.one.shapers.multiply.db.query_type = linear
+values.one.shapers.multiply.db.iohandler.filename = data/gen1Din2D_one_multiply.spatialdb
-values.two.filters.bg.default = -1.0
-values.two.filters.bg.db_value = Two
-values.two.filters.bg.operand = add
-values.two.filters.bg.db.query_type = linear
-values.two.filters.bg.db.iohandler.filename = data/gen1Din2D_two_bg.spatialdb
-values.two.filters.subtract.default = 0.0
-values.two.filters.subtract.operand = subtract
-values.two.filters.subtract.db_value = Two
-values.two.filters.subtract.db.query_type = linear
-values.two.filters.subtract.db.iohandler.filename = data/gen1Din2D_two_subtract.spatialdb
-values.two.filters.divide.default = 1.0
-values.two.filters.divide.operand = divide
-values.two.filters.divide.db_value = Two
-values.two.filters.divide.db.query_type = linear
-values.two.filters.divide.db.iohandler.filename = data/gen1Din2D_two_divide.spatialdb
+values.two.shapers.bg.default = -1.0
+values.two.shapers.bg.db_value = Two
+values.two.shapers.bg.operand = add
+values.two.shapers.bg.db.query_type = linear
+values.two.shapers.bg.db.iohandler.filename = data/gen1Din2D_two_bg.spatialdb
+values.two.shapers.subtract.default = 0.0
+values.two.shapers.subtract.operand = subtract
+values.two.shapers.subtract.db_value = Two
+values.two.shapers.subtract.db.query_type = linear
+values.two.shapers.subtract.db.iohandler.filename = data/gen1Din2D_two_subtract.spatialdb
+values.two.shapers.divide.default = 1.0
+values.two.shapers.divide.operand = divide
+values.two.shapers.divide.db_value = Two
+values.two.shapers.divide.db.query_type = linear
+values.two.shapers.divide.db.iohandler.filename = data/gen1Din2D_two_divide.spatialdb
# ----------------------------------------------------------------------
-# IO
+# io
# ----------------------------------------------------------------------
iohandler.filename = data/gen1Din2D.spatialdb
Modified: cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/testgen1din2d.odb
===================================================================
--- cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/testgen1din2d.odb 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/testgen1din2d.odb 2007-03-02 05:10:44 UTC (rev 6157)
@@ -124,13 +124,11 @@
return GeometryTestGen()
-def values():
+def database_values():
"""
Factory for geometry reader.
"""
return TwoValues()
-
-
# End of file
Modified: cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/testgen1din2d_one.odb
===================================================================
--- cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/testgen1din2d_one.odb 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/testgen1din2d_one.odb 2007-03-02 05:10:44 UTC (rev 6157)
@@ -13,11 +13,11 @@
from pyre.components.Component import Component
# ----------------------------------------------------------------------
-# OneFilters class
-from spatialdata.spatialdb.generator.Filters import Filters
-class OneFilters(Filters):
+# OneShapers class
+from spatialdata.spatialdb.generator.Shapers import Shapers
+class OneShapers(Shapers):
"""
- Python object acting as Filters component for value 'one' in testing
+ Python object acting as Shapers component for value 'one' in testing
GenSimpleDBApp.
"""
@@ -25,32 +25,32 @@
class Inventory(Component.Inventory):
"""
- Python object for managing Filters facilities and properties.
+ Python object for managing Shapers facilities and properties.
"""
## @class Inventory
- ## Python object for managing Filter facilities and properties.
+ ## Python object for managing Shaper facilities and properties.
##
## \b Properties
## @li None
##
## \b Facilities
- ## @li \b bg Background filter
- ## @li \b add Addition filter
- ## @li \b multiply Multiplication filter
+ ## @li \b bg Background shaper
+ ## @li \b add Addition shaper
+ ## @li \b multiply Multiplication shaper
import pyre.inventory
- from spatialdata.spatialdb.generator.Filter import Filter
+ from spatialdata.spatialdb.generator.Shaper import Shaper
- bg = pyre.inventory.facility("bg", factory=Filter)
- bg.meta['tip'] = "Background filter."
+ bg = pyre.inventory.facility("bg", factory=Shaper)
+ bg.meta['tip'] = "Background shaper."
- add = pyre.inventory.facility("add", factory=Filter)
- add.meta['tip'] = "Addition filter."
+ add = pyre.inventory.facility("add", factory=Shaper)
+ add.meta['tip'] = "Addition shaper."
- multiply = pyre.inventory.facility("multiply", factory=Filter)
- multiply.meta['tip'] = "Addition filter."
+ multiply = pyre.inventory.facility("multiply", factory=Shaper)
+ multiply.meta['tip'] = "Addition shaper."
# PUBLIC METHODS /////////////////////////////////////////////////////
@@ -59,7 +59,7 @@
"""
Constructor.
"""
- Filters.__init__(self, name="onefilters")
+ Shapers.__init__(self, name="oneshapers")
return
@@ -69,8 +69,8 @@
"""
Setup members based on inventory.
"""
- Filters._configure(self)
- self.filters = [self.inventory.bg,
+ Shapers._configure(self)
+ self.shapers = [self.inventory.bg,
self.inventory.add,
self.inventory.multiply]
return
@@ -79,11 +79,11 @@
# ======================================================================
# Factories
-def filters():
+def shapers():
"""
- Factory for filters.
+ Factory for shapers.
"""
- return OneFilters()
+ return OneShapers()
# End of file
Modified: cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/testgen1din2d_two.odb
===================================================================
--- cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/testgen1din2d_two.odb 2007-03-02 04:55:59 UTC (rev 6156)
+++ cs/spatialdata-0.1/trunk/tests/pytests/spatialdb/testgen1din2d_two.odb 2007-03-02 05:10:44 UTC (rev 6157)
@@ -13,11 +13,11 @@
from pyre.components.Component import Component
# ----------------------------------------------------------------------
-# TwoFilters class
-from spatialdata.spatialdb.generator.Filters import Filters
-class TwoFilters(Filters):
+# TwoShapers class
+from spatialdata.spatialdb.generator.Shapers import Shapers
+class TwoShapers(Shapers):
"""
- Python object acting as Filters component for value 'one' in testing
+ Python object acting as Shapers component for value 'one' in testing
GenSimpleDBApp.
"""
@@ -25,32 +25,32 @@
class Inventory(Component.Inventory):
"""
- Python object for managing Filters facilities and properties.
+ Python object for managing Shapers facilities and properties.
"""
## @class Inventory
- ## Python object for managing Filter facilities and properties.
+ ## Python object for managing Shaper facilities and properties.
##
## \b Properties
## @li None
##
## \b Facilities
- ## @li \b bg Background filter
- ## @li \b subtract Subtraction filter
- ## @li \b divide Division filter
+ ## @li \b bg Background shaper
+ ## @li \b subtract Subtraction shaper
+ ## @li \b divide Division shaper
import pyre.inventory
- from spatialdata.spatialdb.generator.Filter import Filter
+ from spatialdata.spatialdb.generator.Shaper import Shaper
- bg = pyre.inventory.facility("bg", factory=Filter)
- bg.meta['tip'] = "Background filter."
+ bg = pyre.inventory.facility("bg", factory=Shaper)
+ bg.meta['tip'] = "Background shaper."
- subtract = pyre.inventory.facility("subtract", factory=Filter)
- subtract.meta['tip'] = "Subtraction filter."
+ subtract = pyre.inventory.facility("subtract", factory=Shaper)
+ subtract.meta['tip'] = "Subtraction shaper."
- divide = pyre.inventory.facility("divide", factory=Filter)
- divide.meta['tip'] = "Division filter."
+ divide = pyre.inventory.facility("divide", factory=Shaper)
+ divide.meta['tip'] = "Division shaper."
# PUBLIC METHODS /////////////////////////////////////////////////////
@@ -59,7 +59,7 @@
"""
Constructor.
"""
- Filters.__init__(self, name="onefilters")
+ Shapers.__init__(self, name="oneshapers")
return
@@ -69,8 +69,8 @@
"""
Setup members based on inventory.
"""
- Filters._configure(self)
- self.filters = [self.inventory.bg,
+ Shapers._configure(self)
+ self.shapers = [self.inventory.bg,
self.inventory.subtract,
self.inventory.divide]
return
@@ -79,11 +79,11 @@
# ======================================================================
# Factories
-def filters():
+def shapers():
"""
- Factory for filters.
+ Factory for shapers.
"""
- return TwoFilters()
+ return TwoShapers()
# End of file
More information about the cig-commits
mailing list