Parent Directory
|
Revision Log
Links to HEAD: | (view) (annotate) |
Sticky Revision: |
* Thuban/Model/transientdb.py (TransientJoinedTable.__init__): Update doc-string (TransientJoinedTable.create): Do not modify the column objects of the input tables in place and copy all columns of the input tables into the joined table after all. * test/test_transientdb.py (TestTransientTable.test_transient_joined_table_same_column_name): Update to reflect the new behavior (TestTransientTable.test_transient_joined_table_with_equal_column_names): Update to reflect the new behavior (TestTransientTable.test_transient_joined_table_name_collisions_dont_modify_in_place): New test case for a bug which modified the column objects in place
(TestTransientTable.test_transient_joined_table_same_column_name): New. Test whether joining on columns with the same names in both tables works. (TestTransientTable.test_transient_joined_table_with_equal_column_names): New. Test join of two tables with partly equal column names.
This commit was manufactured by cvs2svn to create branch 'greater-ms3'.
(TestTransientTable.run_iceland_political_tests): Fix a comment.
Give the tables titles so that the GUI can display more meaningful names. For now the titles are fixed but depend on e.g. filenames or the titles of the joined tables. * Thuban/Model/transientdb.py (TransientTable.Title) (TransientJoinedTable.Title, AutoTransientTable.Title): New. * Thuban/Model/table.py (DBFTable.Title, MemoryTable.Title): New. * test/test_transientdb.py (TestTransientTable.test_auto_transient_table_title): New. Test for the Title method (TestTransientTable.test_transient_joined_table) (TestTransientTable.test_transient_table): Add test for the Title methods * test/test_memory_table.py (TestMemoryTable.test_title): New. Test for the Title method * test/test_dbf_table.py (TestDBFTable.test_title): New. Test for the Title method
Implement a way to discover dependencies between tables and shapestores. * Thuban/Model/transientdb.py (TransientTableBase.Dependencies) (TransientJoinedTable.Dependencies) (AutoTransientTable.SimpleQuery): New. Implement the dependencies interface (TransientJoinedTable.__init__): Keep tack of the original table objects in addition to the corresponding transient tables. * Thuban/Model/table.py (DBFTable.Dependencies) (MemoryTable.Dependencies): New. Implement the dependencies interface * Thuban/Model/data.py (ShapeTable): New. Helper class for ShapefileStore (ShapefileStore.__init__): Use ShapeTable instead of AutoTransientTable (ShapefileStore.Table, ShapefileStore.Shapefile): Add doc-strings (ShapefileStore.FileName, ShapefileStore.FileType): New. Accessor methods for filename and type (ShapefileStore.Dependencies): New. Implement the dependencies interface (DerivedShapeStore): New class to replace SimpleStore. The main difference to SimpleStore is that it depends not on a shapefile but another shapestore which expresses the dependencies a bit better (SimpleStore.__init__): Add deprecation warning. * test/test_dbf_table.py (TestDBFTable.test_dependencies): New. Test for the Dependencies method. * test/test_memory_table.py (TestMemoryTable.test_dependencies): New. Test for the Dependencies method. * test/test_transientdb.py (TestTransientTable.test_auto_transient_table_dependencies): New. Test for the Dependencies method. (TestTransientTable.test_transient_joined_table): Add test for the Dependencies method. * test/test_session.py (TestSessionSimple.setUp) (TestSessionSimple.tearDown): New. Implement a better way to destroy the sessions. (TestSessionSimple.test_initial_state) (TestSessionSimple.test_add_table): Bind session to self.session so that it's destroyed by tearDown (TestSessionSimple.test_open_shapefile): New. Test for OpenShapefile and the object it returns
(TestTransientTable.test_auto_transient_table_query): Added a test for using a Column object as the "right" parameter to a query.
* Thuban/Model/transientdb.py (TransientTableBase.ReadRowAsDict): Add comments about the optimizations used. (AutoTransientTable.ReadValue, TransientTableBase.ReadValue): New. Implement the ReadValue table interface method. * test/test_transientdb.py (TestTransientTable.run_iceland_political_tests) (TestTransientTable.test_transient_joined_table): Add tests for ReadValue
(TestTransientTable.test_auto_transient_table_query): New. Test case for AutoTransientTable's SimpleQuery
(TestTransientTable.test_transient_table_read_twice): Fix doc-string (TestTransientTable.test_transient_table_query): New. Test for the SimpleQuery method
Convert all table users to use the new table interface. This only covers Thuban itself, not GREAT-ER or other applications built on Thuban yet, so the compatibility interface stays in place for the time being but it now issues DeprecationWarnings. Finally, the new Table interface has a new method, HasColumn. * Thuban/Model/table.py (OldTableInterfaceMixin): All methods issue deprecation warnings when they're. The warnings refer to the caller of the method. (OldTableInterfaceMixin.__deprecation_warning): New. Helper method for the deprecation warnings * test/test_table.py: Ignore the deprecation warnings for the old table in the tests in this module. The purpose of the tests is to test the old interface, after all. * test/test_transientdb.py (TestTransientTable.run_iceland_political_tests): Use the constants for the types. Add a test for HasColumn (TestTransientTable.test_transient_joined_table): Adapt to new table interface. Add a test for HasColumn (TestTransientTable.test_transient_table_read_twice): Adapt to new table interface * Thuban/Model/transientdb.py (TransientTableBase.HasColumn) (AutoTransientTable.HasColumn): Implement the new table interface method (AutoTransientTable.ReadRowAsDict, AutoTransientTable.ValueRange) (AutoTransientTable.UniqueValues): Adapt to new table interface * Thuban/Model/layer.py (Layer.SetShapeStore, Layer.GetFieldType): Adapt to new table interface * test/test_layer.py (TestLayer.open_shapefile): Helper method to simplify opening shapefiles a bit easier. (TestLayer.test_arc_layer, TestLayer.test_polygon_layer) (TestLayer.test_point_layer): Use the new helper method (TestLayer.test_get_field_type): New. Test for the GetFieldType method * test/test_dbf_table.py (TestDBFTable.test_has_column): Test for the new table method * test/test_memory_table.py (TestMemoryTable.test_has_column): Test for the new table method HasColumn
Convert the table implementations to a new table interface. All tables use a common mixin class to provide backwards compatibility until all table users have been updated. * Thuban/Model/table.py (OldTableInterfaceMixin): Mixin class to provide backwards compatibility for table classes implementing the new interface (DBFTable, MemoryTable): Implement the new table interface. Use OldTableInterfaceMixin as base for compatibility (DBFColumn, MemoryColumn): New. Column description for DBFTable and MemoryTable resp. * test/test_dbf_table.py: New. Test cases for the DBFTable with the new table interface. * test/test_memory_table.py: New. Test cases for the MemoryTable with the new table interface. * test/test_table.py: Document the all tests in this file as only for backwards compatibility. The equivalent tests for the new interface are in test_memory_table.py and test_dbf_table.py (MemoryTableTest.test_read): field_info should be returning tuples with four items (MemoryTableTest.test_write): Make doc-string a more precise. * Thuban/Model/transientdb.py (TransientTableBase): Convert to new table interface. Derive from from OldTableInterfaceMixin for compatibility. (TransientTableBase.create): New intance variable column_map to map from names and indices to column objects (TransientTable.create): Use the new table interface of the input table (AutoTransientTable): Convert to new table interface. Derive from from OldTableInterfaceMixin for compatibility. (AutoTransientTable.write_record): Removed. It's not implemented yet and we still have to decide how to handle writing with the new table and data framework. * test/test_transientdb.py (TestTransientTable.run_iceland_political_tests) (TestTransientTable.test_transient_joined_table): Use the new table interface
(SimpleTable): Removed. (TestTransientTable.test_transient_joined_table, (TestTransientTable.test_transient_table_read_twice): Replaced SimpleTable by MemoryTable.
* Thuban/Model/transientdb.py (TransientTableBase.__init__): New instance variable read_record_last_result (TransientTableBase.read_record): Make sure reading the same record twice works. The implementation uses the new instance variable read_record_last_result * test/test_transientdb.py (TestTransientTable.test_transient_table_read_twice): New test case for the above bug-fix.
Next step of table implementation. Introduce a transient database using SQLite that some of the data is copied to on demand. This allows us to do joins and other operations that require an index for good performance with reasonable efficiency. Thuban now needs SQLite 2.8.0 and pysqlite 0.4.1. Older versions may work but I haven't tested that. * Thuban/Model/transientdb.py: New. Transient database implementation. * test/test_transientdb.py: New. Tests for the transient DB classes. * Thuban/Model/session.py (AutoRemoveFile, AutoRemoveDir): New classes to help automatically remove temporary files and directories. (Session.__init__): New instance variables temp_dir for the temporary directory and transient_db for the SQLite database (Session.temp_directory): New. Create a temporary directory if not yet done and return its name. Use AutoRemoveDir to have it automatically deleted (Session.TransientDB): Instantiate the transient database if not done yet and return it. * Thuban/Model/data.py (ShapefileStore.__init__): Use an AutoTransientTable so that data is copied to the transient DB on demand. (SimpleStore): New class that simply combines a table and a shapefile * Thuban/Model/table.py (Table, DBFTable): Rename Table into DBFTable and update its doc-string to reflect the fact that this is only the table interface to a DBF file. Table is now an alias for DBFTable for temporary backwards compatibility. * Thuban/UI/application.py (ThubanApplication.OnExit): Make sure the last reference to the session goes away so that the temporary files are removed properly. * test/test_load.py (LoadSessionTest.tearDown): Remove the reference to the session to make sure the temporary files are removed.
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.
[email protected] | ViewVC Help |
Powered by ViewVC 1.1.26 |