[Subversion] / Trellis / test_trellis.py |
No default branch
Bookmark a link to HEAD:
(view)
(download)
(as text)
API cleanups, doc enhancements, and release prep
Get rid of the now-ancient Specification.txt and move its demos to Internals.txt
Move task-related stuff to activity module. Fleshed out docs for activity module. Tested undo support for Time service.
Simplified rollback support for collections. Only changes done to non-"future" cells need to be undo-logged, and the entire structure will be rolled back to the first point of change when *any* change to the structure is rolled back.
Refactor retry, cycle detection, and rollback to allow reentrant rollback, so we'll be able to have "todo" cells do complete data structure rollbacks. As a nice side-effect, this refactoring speeds up rule processing by making fewer attribute changes and recording fewer undo actions. The tests for Python 2.3 run about 33% faster than they did before, although they're still 7 times slower than the Python 2.5 tests. (The speedup for 2.3 is disproportionate because the cost of getting or setting controller attributes is much higher, due to threading.local being in Python instead of C.)
Restore Python 2.3 compatibility. This is of somewhat limited benefit, since the tests run (literally) 10 times slower than Python 2.4, due to the incredible slowness of the Python (i.e. non-C) version of threading.local.
Correct some of the more egregious documentation errors and terminology. Tests now pass under Python 2.4 as well as 2.5 (2.3 is still broken). Begin the split of the activity/eventlooop/task docs to a separate file. Remove some done items from the TODO section.
The new algorithm lands - version bump to 0.6a1dev. Too many changes to list!
Simplify undo by not logging undo's while undoing. This makes it possible to write code that doesn't care if it's a "do" or "undo", which should make data structures similar. i.e., the reverse of an 'add' can then be a 'remove' and vice versa, without needing to have separate 'undo_add' and 'undo_remove' operations that don't log undo information.
Improved retry algorithm to handle multiple simultaneous rollbacks, and to do them between rules. Add Observer and Cell implementations+tests.
First cut of basic Cell types based on the new algorithm. For now, they live in a different module, since they aren't fully featured yet. They do, however, perform many of the cell basics, including ReadOnlyCell->Constant, basic recalculation, etc. But read/write cell initialization is untested, observers don't exist yet, and neither do task cells. A suitable replacement for the 'future/todo' mechanism is also needed before the process of replacing the existing cell types and data structures can begin. But this is a pretty good start.
Improved commit/abort/undo logic, add dirty() method to allow listeners to skip being scheduled. (Also, schedule listeners immediately when changed() is called outside of run().)
Rule handling, with retry and cycle detection. This basically completes the core implementation of the new algorithm, on top of which Cells and other data structures and decorators can then be built.
Begin laying the foundation for the new algorithm's controller.
New algorithm: subjects, listeners, and links.
Begin work on new algorithm: STM history class. (Python 2.4 currently required)
Split advanced collection types into peak.events.collections. Add new "SubSet" type.
Event loops for tests, wx, and twisted. No docs, and only minimal testing so far, but much hacking was done to get these to work more-or-less correctly. wx needs some mocking, and it turns out that the Time service really needs to make next_event_time() dirty when new events are added, even if self._tick doesn't change. That'll have to be fixed later, though (as with the wx mocks issue).
Added List, Dict, and Set types with change events. We are now feature-complete for 0.5b1 (minus docs), weighing in at a modest 1066 lines of code. Woohoo!
Begin documentation/test refactoring; new intro, updated TODO.
High level API: Component class, decorators, properties. The tests are disorganized and the docs are non-existent, but it works, by golly. Docs and test re-orgs will begin next week.
Ensure that reads outside of propagation block until propagation is over. Drop EventLoop service; it was overkill for what's actually needed. I'm keeping the dependency on Contextual since Time, IO, and Signals will all be context.Service classes later. But the core doesn't need this service, and this way it'll be easier to write a C version later, if needed. There may still need to be a way to replace the runner to serve in other event loop systems, but for now I'm treating it as a YAGNI.
Rip out the old Trellis implementation and replace with a shiny new algorithm. This is nowhere near adequately tested, and Constant conversion doesn't work. The doctests are in horrible shape and don't describe the current algorithm at all. The fancy API described in my mailing list posts is nowhere to be found, and none of the new functionality is tested in the slightest. Experiment at your own risk; this is just a placeholder/proof-of-concept test to see if the new algorithm at least passes the old tests (except for Constant conversion.) And it does. :) So, everything from here on out should effectively be either documentation, tests, syntax sugar, or convenience/reference implementations of higher-level features.
Trellis: a new paradigm for event-driven programming, based on ideas from Gelernter's "Trellis" system, and Tilton's "Cells" for Lisp. Eventually, this will grow up to do the rest of the things that peak.events does now, only with deterministic updates and no need for explicit dependency management.
cvs-admin@eby-sarna.com Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |