Trees | Indices | Help |
|
---|
|
Contains all sort of utilities to search and manipulate nested lists in the context of strongly-typed crossover.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Author: by Mehdi Khoury
Version: 1.20
Copyright: (c) 2009 Mehdi Khoury under the mit license http://www.opensource.org/licenses/mit-license.html
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
__package__ = None
|
|
BillSubtreeIndicesgives the indexes of nested lists by depth original idea from bill at python-forum.org
|
BillSubtreeIndices2gives the indexes of nested lists by depth original idea from bill at python-forum.org
|
GetIndicesMappingFromTreereuse bill's idea to gives the indexes of all nodes (may they be a sub tree or a single leaf) gives a list of indices of every sublist. To do that, I add one thing: the last element of an index is the length of the present list. e.g.
|
GetDepthFromIndicesMappingGives the depth of the nested list from the index mapping
|
GetPackedListIndicesAtDepthgives the indexes of nested lists at a specific depth. Only works if the map of indices has been done
|
UnpackIndicesFromListunpack_indices_from_list. e.g. ([([1], 6), ([2], 4)]) gives: [[1, 1], [1, 2], [1, 3], [1, 4], [1, 5], [2, 1], [2, 2], [2, 3]]
|
GetDepthGives the depth of the nested list. Slow recursive way.
|
IndexLstToIndexStrtransform a list into an index element e.g. list named 'a' and index ref is [1,1,2], result is '[1][1][2]'
|
IndexLstToIndexStr2transform a list into an index element this version is 15% faster transform a list into an index element e.g. list named 'a' and index ref is [1,1,2], result is '[1][1][2]'
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Apr 15 11:50:09 2009 | http://epydoc.sourceforge.net |