Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: add layout transformer & simplify unpacked (#972)
* Feature: add layout transformers The existing recursively_apply implementation is designed for one-off layout modifications. There are a number of places where we might want to visit multiple contents in a layout, and transform more than one of them. This commit contains a new `LayoutTransformer` (and associated `FunctionalTransformer` which implements a getfunction-like API) to support this use case. Classes were used rather than closures in order to cleanly handle the mutual dependency of the transformer and the generic transformer routines upon one another. * Refactor: convert recursively_apply to use new transformer * Refactor: replace `_packed` with `_pack_layout` This operates on a single layout. We leverage the existing recursion mechanism in `recursively_transform` to apply this to an entire layout. * Bugfix: Py27 use `super(cls, self)` * Refactor: remove test for private function * Refactor: replace class transformer with simple function
- Loading branch information