Databaser

Doc


A Databaser rises to the DatabaserClass. This latter is the deepest class for instancing Variables able to store values in hierarchic tables. Here, as a first step, the database method helps to set the in the dict


View the Databaser notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Databaser.ipynb)

Code



# -*- coding: utf-8 -*-
"""


<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>


A Databaser rises to the DatabaserClass. This latter is the deepest class for instancing
Variables able to store values in hierarchic tables. Here, as a first step,
the database method helps to set the <ModelingKeyStr> in the __dict__

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Noders.Structurer"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
#</ImportSpecificModules>

#<DefineClass>
@DecorationClass(**{'ClassingSwitchMethodStrsList':['database']})
class DatabaserClass(
                        BaseClass
                ):

    #Definition
    RepresentingKeyStrsList=[
                                'ModeledSuffixStr',
                                'ModeledCollectionStr',
                                'ModeledSuffixStr',
                                'ModelDeriveControllerVariable'
                            ]

    def default_init(self,
                    _ModelingKeyStr="",
                    _ModeledCollectionStr="",
                    _ModeledSuffixStr="",
                    _ModelDeriveControllerVariable=None,
                    **_KwargVariablesDict
                ):

        #Call the parent __init__ method
        BaseClass.__init__(self,**_KwargVariablesDict)

    def do_database(self):

        #set
        if hasattr(self,'NodeKeyStr'):
            self.ModelingKeyStr=self.NodeKeyStr
            self.ModeledCollectionStr=self.NodeCollectionStr

        #set
        self.ModeledSuffixStr=self.ModelingKeyStr+'Model'

        #
        if hasattr(self,'NodePointDeriveNoder'):
            self.point(
                self.NodePointDeriveNoder,
                'ModelDeriveControllerVariable'
            )

#</DefineClass>

View the Databaser sources on Github

Example

Let's create an empty class, which will automatically receive special attributes from the decorating ClassorClass, specially the NameStr, that should be the ClassStr without the TypeStr in the end.


In [3]:
#ImportModules
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Controllers import Storer
from ShareYourSystem.Standards.Modelers import Databaser

#Definition of a Storer instance with a noded databaser
MyStorer=Storer.StorerClass().collect(
    "Datome",
    "Things",
    Databaser.DatabaserClass()
)

#database
MyStorer['<Datome>ThingsDatabaser'].database()
    
#Definition the AttestedStr
SYS._attest(
    [
        'MyStorer is '+SYS._str(
        MyStorer,
        **{
            'RepresentingBaseKeyStrsListBool':False,
            'RepresentingAlineaIsBool':False
        }
        )
    ]
)

#Print



*****Start of the Attest *****

MyStorer is < (StorerClass), 4565658960>
   /{ 
   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /{ 
   /   /  'ThingsDatabaser' : < (DatabaserClass), 4565657936>
   /   /   /{ 
   /   /   /  '<New><Instance>IdInt' : 4565657936
   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /  '<New><Instance>NodeKeyStr' : ThingsDatabaser
   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (StorerClass), 4565658960>
   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4565725264>
   /   /   /  '<Spe><Instance>ModeledCollectionStr' : Datome
   /   /   /  '<Spe><Instance>ModelDeriveControllerVariable' : {...}< (StorerClass), 4565658960>
   /   /   /  '<Spe><Instance>ModeledSuffixStr' : ThingsDatabaserModel
   /   /   /}
   /   /}
   /  '<New><Instance>IdInt' : 4565658960
   /  '<New><Instance>NewtorkAttentionStr' : 
   /  '<New><Instance>NewtorkCatchStr' : 
   /  '<New><Instance>NewtorkCollectionStr' : 
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopStorer
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<Spe><Class>StoringOrganizeIsBool' : False
   /}

*****End of the Attest *****


Modeler

Doc


The Modeler defines the model to be stored in a database like Django or PyTable. Here are defined the relations between attributes of an instance and their corresponding types in the databased structures.


View the Modeler notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Modeler.ipynb)

Code



# -*- coding: utf-8 -*-
"""


<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>


The Modeler defines the model to be stored in a database like Django or PyTable.
Here are defined the relations between attributes of an instance and their corresponding
types in the databased structures.

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Modelers.Databaser"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
import collections
import copy
import tables
from ShareYourSystem.Standards.Classors import Doer
#</ImportSpecificModules>

#<DefineLocals>
AnalyzingColStrsList=[
                            'Int',
                            'Float',
                            'Str'
                    ]
ModelingJoinStr='__'
ModelingLinkStr='_'
#</DefineLocals>

#<DefineFunctions>
def getModeledColWithGetKeyStr(_GetKeyStr):

    #Definition
    global AnalyzingColStrsList

    #Definition
    ModeledColStr=SYS._filter(
        lambda __AnalyzingColStr:
        _GetKeyStr.endswith(__AnalyzingColStr),
        AnalyzingColStrsList
        )[0]

    #Get the Col Class
    ModeledColClass=getattr(tables,ModeledColStr+'Col')

    #Return
    if _GetKeyStr=='Str':
        return ModeledColClass(length=100)
    else:
        return ModeledColClass() 

def getModelingColumnTupleWithGetKeyStr(_GetKeyStr):
    return (_GetKeyStr,_GetKeyStr,getModeledColWithGetKeyStr(_GetKeyStr))

#</DefineFunctions>

#<DefineClass>
@DecorationClass(**{
    'ClassingSwitchMethodStrsList':["model"]
})
class ModelerClass(BaseClass):

    #Definition
    RepresentingKeyStrsList=[
                                    'ModelingDescriptionTuplesList',                                    
                                    'ModeledDescriptionClassesOrderedDict',                                                             
                                    'ModeledDescriptionClass',                                                  
                                    'ModeledKeyStr'
                                ]

    def default_init(
                    self,
                    _ModelingDescriptionTuplesList={
                                'DefaultValueType':property,
                                'PropertyInitVariable':[],
                                'PropertyDocStr':''
                        },                              
                    _ModeledDescriptionClassesOrderedDict=None,                                                             
                    _ModeledDescriptionClass=None,                                                  
                    _ModeledKeyStr="",
                    **_KwargVariablesDict
                ):

        #Call the parent __init__ method
        BaseClass.__init__(self,**_KwargVariablesDict)

    def do_model(self):
        """ """

        #debug
        '''
        self.debug(('self.',self,['ModelingDescriptionTuplesList']))
        '''

        #<NotHook>
        #database first
        self.database()
        #</NotHook>

        #set a name if it was not already
        if self.ModeledKeyStr=="":

            #debug
            '''
            self.debug(('self.',self,['ModelingKeyStr','ModeledSuffixStr']))
            '''

            #Link set
            self.ModeledKeyStr=self.ModeledSuffixStr

        #Definition the ModelClass
        class ModeledDescriptionClass(tables.IsDescription):

            #Add a tabulared Int (just like a unique KEY in mysql...) 
            RowInt=tables.Int64Col()

        #debug
        '''
        self.debug(('self.',self,['ModeledGetStrToColumnStrOrderedDict']))
        '''

        #set the cols in the ModelClass
        map(
                lambda __ModelingColumnTuple:
                ModeledDescriptionClass.columns.__setitem__(
                    __ModelingColumnTuple[1],
                    __ModelingColumnTuple[2]
                    ),
                self.ModelingDescriptionTuplesList
            )

        #Give a name
        ModeledDescriptionClass.__name__=SYS.getClassStrWithNameStr(self.ModeledKeyStr)

        #set the ModelClass
        if self.ModeledDescriptionClassesOrderedDict==None:
            self.ModeledDescriptionClassesOrderedDict=collections.OrderedDict()
        self.ModeledDescriptionClassesOrderedDict[self.ModeledKeyStr]=ModeledDescriptionClass

        #set the ModeledDescriptionClass
        self.ModeledDescriptionClass=ModeledDescriptionClass

#</DefineClass>

View the Modeler sources on Github

Example

Let's create an empty class, which will automatically receive special attributes from the decorating ClassorClass, specially the NameStr, that should be the ClassStr without the TypeStr in the end.


In [7]:
#ImportModules
import tables
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Noders import Collecter
from ShareYourSystem.Standards.Modelers import Modeler

#Definition of a Collecter instance with a noded datar
MyCollecter=Collecter.CollecterClass().collect(
    "Datome",
    "Things",
    Modeler.ModelerClass()
)

#Definition a Modeler instance
MyCollecter['<Datome>ThingsModeler'].model([
                                        #GetStr #ColumnStr #Col
                                        ('MyInt','MyInt',tables.Int64Col()),
                                        ('MyStr','MyStr',tables.StringCol(10)),
                                        ('MyIntsList','MyIntsList',tables.Int64Col(shape=3))
                                ])
                        
    
#Definition the AttestedStr
SYS._attest(
    [
        'MyCollecter is '+SYS._str(
        MyCollecter,
        **{
            'RepresentingBaseKeyStrsListBool':False,
            'RepresentingAlineaIsBool':False
        }
        ),
        'MyCollecter["<Datome>ThingsModeler"].ModeledDescriptionClass.__dict__ is '+SYS._str(
        dict(MyCollecter['<Datome>ThingsModeler'].ModeledDescriptionClass.__dict__.items()
            ) if MyCollecter['<Datome>ThingsModeler'
        ].ModeledDescriptionClass!=None else {},**{'RepresentingAlineaIsBool':False}
        )
    ]
) 

#Print



*****Start of the Attest *****

MyCollecter is < (CollecterClass), 4565029840>
   /{ 
   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /{ 
   /   /  'ThingsModeler' : < (ModelerClass), 4565029008>
   /   /   /{ 
   /   /   /  '<New><Instance>IdInt' : 4565029008
   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /  '<New><Instance>NodeKeyStr' : ThingsModeler
   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (CollecterClass), 4565029840>
   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4565725560>
   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /[
   /   /   /   /  0 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyInt
   /   /   /   /   /  1 : MyInt
   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /  1 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyStr
   /   /   /   /   /  1 : MyStr
   /   /   /   /   /  2 : StringCol(itemsize=10, shape=(), dflt='', pos=None)
   /   /   /   /   /)
   /   /   /   /  2 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyIntsList
   /   /   /   /   /  1 : MyIntsList
   /   /   /   /   /  2 : Int64Col(shape=(3,), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /]
   /   /   /  '<Spe><Class>ModelingDescriptionTuplesList' : {...}< (list), 4559840176>
   /   /   /  '<Spe><Instance>ModeledDescriptionClass' : <class 'tables.description.ThingsModelerModelClass'>
   /   /   /  '<Spe><Instance>ModeledDescriptionClassesOrderedDict' : 
   /   /   /   /{ 
   /   /   /   /  'ThingsModelerModel' : {...}< (MetaIsDescription), 140476487361216>
   /   /   /   /}
   /   /   /  '<Spe><Instance>ModeledKeyStr' : ThingsModelerModel
   /   /   /}
   /   /}
   /  '<New><Instance>IdInt' : 4565029840
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopCollecter
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<Spe><Instance>CollectedGetStr' : <Datome>
   /  '<Spe><Instance>CollectedSetTagStr' : <Datome>ThingsModeler
   /  '<Spe><Instance>CollectedSuffixStr' : Modeler
   /  '<Spe><Instance>CollectingCollectionStr' : Datome
   /  '<Spe><Instance>CollectingNodeKeyStr' : Things
   /  '<Spe><Instance>CollectingNodeVariable' : {...}< (ModelerClass), 4565029008>
   /}

------

MyCollecter["<Datome>ThingsModeler"].ModeledDescriptionClass.__dict__ is 
   /{ 
   /  '__doc__' : None
   /  '__module__' : tables.description
   /  'columns' : 
   /   /{ 
   /   /  'RowInt' : Int64Col(shape=(), dflt=0, pos=None)
   /   /  'MyInt' : Int64Col(shape=(), dflt=0, pos=None)
   /   /  'MyIntsList' : Int64Col(shape=(3,), dflt=0, pos=None)
   /   /  'MyStr' : StringCol(itemsize=10, shape=(), dflt='', pos=None)
   /   /}
   /}

*****End of the Attest *****


Tabularer

Doc


The Tabularer helps to define names for setting Tables in a hdf5 structure, given the names of predefined models.


View the Tabularer notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Tabularer.ipynb)

Code



# -*- coding: utf-8 -*-
"""


<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>


The Tabularer helps to define names for setting Tables in a hdf5 structure,
given the names of predefined models.

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Modelers.Modeler"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
import collections
import importlib
#</ImportSpecificModules>

#<DefineClass>
@DecorationClass(**{'ClassingSwitchMethodStrsList':['tabular']})
class TabularerClass(
                    BaseClass
                ):

    #Definition
    RepresentingKeyStrsList=[
                                    'TabularedGroupVariable',   
                                    'TabularedTopFileVariable',                                 
                                    'TabularedSuffixStr',                                                               
                                    'TabularedTableKeyStrsList',                                                    
                                    'TabularedTablesOrderedDict'
                                ]

    def default_init(self,
                    _TabularedGroupVariable=None,
                    _TabularedTopFileVariable=None,
                    _TabularedSuffixStr="",
                    _TabularedTableKeyStrsList=None,
                    _TabularedTablesOrderedDict=None,
                    **_KwargVariablesDict
                ):

        #Call the parent __init__ method
        BaseClass.__init__(self,**_KwargVariablesDict)


    def do_tabular(self):
        """ """

        #debug
        '''
        self.debug(
                [
                    ('self.',self,[
                            'ModelingDescriptionTuplesList',
                            'ModeledDescriptionClass',
                            'WatchModelWithModelerBool',
                            'WatchModelWithJoinerBool'
                        ]),
                    'self.model is '+SYS._str(self.model)
                ]
            )
        '''

        #<NotHook>
        #model first
        self.model()
        #</NotHook>

        #debug
        '''
        self.debug(
                    [
                        ('self.',self,['ModelingDescriptionTuplesList','ModeledDescriptionClass']),
                        ('self.ModelDeriveControllerVariable!=None is '+str(self.ModelDeriveControllerVariable!=None))
                    ]
                )
        '''

        #Maybe we have to hdformat first
        if self.ModelDeriveControllerVariable!=None:

            #Check
            if self.ModelDeriveControllerVariable.HdformatedFileVariable==None:

                #debug
                '''
                self.debug('We have to hdformat first...')
                '''

                #Hdformat
                self.ModelDeriveControllerVariable.hdformat()
                #self.ModelDeriveControllerVariable.structure()

            #Link
            self.TabularedTopFileVariable=self.ModelDeriveControllerVariable.HdformatedFileVariable
            self.HdfGroupPathStr=self.ModelDeriveControllerVariable.HdfGroupPathStr

            #debug
            '''
            self.debug(('self.',self,[
                                        'HdformatedFileVariable',
                                        'ModelingDescriptionTuplesList',
                                        'ModeledDescriptionClass'
                                    ]))
            '''

            #Check
            if self.TabularedTopFileVariable!=None:

                #debug
                '''
                self.debug(
                            [   
                                'Looking for names of tables here',
                                ('self.',self,['HdfGroupPathStr'])
                            ]
                        )
                '''

                #Definition Tabulared attributes
                self.TabularedGroupVariable=self.TabularedTopFileVariable.getNode(
                    self.HdfGroupPathStr)

                #debug
                '''
                self.debug(('self.',self,['ModeledSuffixStr']))
                '''

                #set
                self.TabularedSuffixStr='Model'.join(self.ModeledSuffixStr.split('Model')[:-1])+'Table'

                #debug
                '''
                self.debug(
                            [
                                ('looking for tables with the same suffix Str as : '),
                                ('self.',self,['TabularedSuffixStr'])
                            ]
                        )
                '''

                #Get and sort
                self.TabularedTableKeyStrsList=sorted(
                    filter(
                            lambda __KeyStr:
                            __KeyStr.endswith(self.TabularedSuffixStr),
                            self.TabularedGroupVariable._v_leaves.keys()
                        )
                )

                self.TabularedTablesOrderedDict.update(
                    map(
                            lambda __TabularedKeyStr:
                            (
                                __TabularedKeyStr,
                                self.TabularedGroupVariable._f_getChild(__TabularedKeyStr)
                            ),
                            self.TabularedTableKeyStrsList
                        )
                )

                #debug
                '''
                self.debug(("self.",self,[
                                            'TabularedSuffixStr',
                                            'TabularedTableKeyStrsList'
                                            ]))
                '''

        #<NotHook>
        #Return 
        #return self
        #</NotHook>

#</DefineClass>

View the Tabularer sources on Github

Example

Let's create an empty class, which will automatically receive special attributes from the decorating ClassorClass, specially the NameStr, that should be the ClassStr without the TypeStr in the end.


In [11]:
#ImportModules
import tables
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Noders import Structurer
from ShareYourSystem.Standards.Modelers import Tabularer

#Definition of a Storer instance with a noded datar
MyStructurer=Structurer.StructurerClass().collect(
    "Datome",
    "Things",
    Tabularer.TabularerClass().__setitem__(
        'Attr_ModelingDescriptionTuplesList',
        [
            #GetStr #ColumnStr #Col
            ('MyInt','MyInt',tables.Int64Col()),
            ('MyStr','MyStr',tables.StringCol(10)),
            ('MyIntsList','MyIntsList',(tables.Int64Col(shape=3)))
        ]
    )
)

#Build a structure with a database
MyStructurer['<Datome>ThingsTabularer'].tabular()
    
#Definition the AttestedStr
SYS._attest(
    [
        'MyStructurer is '+SYS._str(
        MyStructurer,
        **{
            'RepresentingBaseKeyStrsListBool':False,
            'RepresentingAlineaIsBool':False
        }
        ),
        'hdf5 file is : '+MyStructurer.hdfview().hdfclose().HdformatedConsoleStr
    ]
) 

#Print



*****Start of the Attest *****

MyStructurer is < (StructurerClass), 4565029712>
   /{ 
   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /{ 
   /   /  'ThingsTabularer' : < (TabularerClass), 4565030032>
   /   /   /{ 
   /   /   /  '<New><Instance>IdInt' : 4565030032
   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /  '<New><Instance>NodeKeyStr' : ThingsTabularer
   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (StructurerClass), 4565029712>
   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4565726152>
   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /[
   /   /   /   /  0 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyInt
   /   /   /   /   /  1 : MyInt
   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /  1 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyStr
   /   /   /   /   /  1 : MyStr
   /   /   /   /   /  2 : StringCol(itemsize=10, shape=(), dflt='', pos=None)
   /   /   /   /   /)
   /   /   /   /  2 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyIntsList
   /   /   /   /   /  1 : MyIntsList
   /   /   /   /   /  2 : Int64Col(shape=(3,), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /]
   /   /   /  '<Spe><Instance>TabularedTopFileVariable' : File(filename=/Users/ledoux/Documents/ShareYourSystem/Structures.hdf5, title='', mode='r+', root_uep='/', filters=Filters(complevel=0, shuffle=False, fletcher32=False, least_significant_digit=None))
/ (RootGroup) ''
/xx0xxThingsFindoerTable (Table(3,)) 'This is the ThingsFindoerModelClass'
  description := {
  "RowInt": Int64Col(shape=(), dflt=0, pos=0),
  "MyInt": Int64Col(shape=(), dflt=0, pos=1),
  "MyIntsList": Int64Col(shape=(3,), dflt=0, pos=2),
  "MyStr": StringCol(itemsize=10, shape=(), dflt='', pos=3)}
  byteorder := 'little'
  chunkshape := (1310,)
/xx0xxThingsInserterTable (Table(2,)) 'This is the ThingsInserterModelClass'
  description := {
  "RowInt": Int64Col(shape=(), dflt=0, pos=0),
  "MyInt": Int64Col(shape=(), dflt=0, pos=1),
  "MyIntsList": Int64Col(shape=(3,), dflt=0, pos=2),
  "MyStr": StringCol(itemsize=10, shape=(), dflt='', pos=3)}
  byteorder := 'little'
  chunkshape := (1310,)
/xx0xxThingsRecovererTable (Table(3,)) 'This is the ThingsRecovererModelClass'
  description := {
  "RowInt": Int64Col(shape=(), dflt=0, pos=0),
  "MyInt": Int64Col(shape=(), dflt=0, pos=1),
  "MyIntsList": Int64Col(shape=(3,), dflt=0, pos=2),
  "MyStr": StringCol(itemsize=10, shape=(), dflt='', pos=3)}
  byteorder := 'little'
  chunkshape := (1310,)
/xx0xxThingsRetrieverTable (Table(2,)) 'This is the ThingsRetrieverModelClass'
  description := {
  "RowInt": Int64Col(shape=(), dflt=0, pos=0),
  "MyInt": Int64Col(shape=(), dflt=0, pos=1),
  "MyIntsList": Int64Col(shape=(3,), dflt=0, pos=2),
  "MyStr": StringCol(itemsize=10, shape=(), dflt='', pos=3)}
  byteorder := 'little'
  chunkshape := (1310,)
/xx0xxThingsRowerTable (Table(0,)) 'This is the ThingsRowerModelClass'
  description := {
  "RowInt": Int64Col(shape=(), dflt=0, pos=0),
  "MyInt": Int64Col(shape=(), dflt=0, pos=1),
  "MyIntsList": Int64Col(shape=(3,), dflt=0, pos=2),
  "MyStr": StringCol(itemsize=10, shape=(), dflt='', pos=3)}
  byteorder := 'little'
  chunkshape := (1310,)
/xx0xxThingsTablerTable (Table(0,)) 'This is the ThingsTablerModelClass'
  description := {
  "RowInt": Int64Col(shape=(), dflt=0, pos=0),
  "MyInt": Int64Col(shape=(), dflt=0, pos=1),
  "MyIntsList": Int64Col(shape=(3,), dflt=0, pos=2),
  "MyStr": StringCol(itemsize=10, shape=(), dflt='', pos=3)}
  byteorder := 'little'
  chunkshape := (1310,)
/xx0xx__UnitsInt_3__ThingsMergerTable (Table(2,)) 'This is the __UnitsInt_3__ThingsMergerModelClass'
  description := {
  "RowInt": Int64Col(shape=(), dflt=0, pos=0),
  "MyInt": Int64Col(shape=(), dflt=0, pos=1),
  "MyIntsList": Int64Col(shape=(3,), dflt=0, pos=2),
  "MyStr": StringCol(itemsize=10, shape=(), dflt='', pos=3)}
  byteorder := 'little'
  chunkshape := (1310,)
/xx0xx__UnitsInt_3__ThingsShaperTable (Table(2,)) 'This is the __UnitsInt_3__ThingsShaperModelClass'
  description := {
  "RowInt": Int64Col(shape=(), dflt=0, pos=0),
  "MyInt": Int64Col(shape=(), dflt=0, pos=1),
  "MyIntsList": Int64Col(shape=(3,), dflt=0, pos=2),
  "MyStr": StringCol(itemsize=10, shape=(), dflt='', pos=3)}
  byteorder := 'little'
  chunkshape := (1310,)
/xx1xx__UnitsInt_2__ThingsMergerTable (Table(1,)) 'This is the __UnitsInt_2__ThingsMergerModelClass'
  description := {
  "RowInt": Int64Col(shape=(), dflt=0, pos=0),
  "MyInt": Int64Col(shape=(), dflt=0, pos=1),
  "MyIntsList": Int64Col(shape=(2,), dflt=0, pos=2),
  "MyStr": StringCol(itemsize=10, shape=(), dflt='', pos=3)}
  byteorder := 'little'
  chunkshape := (1560,)
/xx1xx__UnitsInt_2__ThingsShaperTable (Table(1,)) 'This is the __UnitsInt_2__ThingsShaperModelClass'
  description := {
  "RowInt": Int64Col(shape=(), dflt=0, pos=0),
  "MyInt": Int64Col(shape=(), dflt=0, pos=1),
  "MyIntsList": Int64Col(shape=(2,), dflt=0, pos=2),
  "MyStr": StringCol(itemsize=10, shape=(), dflt='', pos=3)}
  byteorder := 'little'
  chunkshape := (1560,)
/TopStructurer (Group) ''
/TopStructurer/FirstChildStructurer (Group) ''
/TopStructurer/SecondChildStructurer (Group) ''
/TopStructurer/SecondChildStructurer/OtherGrandChildStructurer (Group) ''
/TopStructurer/FirstChildStructurer/GrandChildStructurer (Group) ''

   /   /   /  '<Spe><Instance>TabularedGroupVariable' : / (RootGroup) ''
  children := ['xx1xx__UnitsInt_2__ThingsMergerTable' (Table), 'xx0xx__UnitsInt_3__ThingsShaperTable' (Table), 'xx0xxThingsRetrieverTable' (Table), 'xx0xxThingsInserterTable' (Table), 'xx1xx__UnitsInt_2__ThingsShaperTable' (Table), 'xx0xx__UnitsInt_3__ThingsMergerTable' (Table), 'TopStructurer' (Group), 'xx0xxThingsRecovererTable' (Table), 'xx0xxThingsFindoerTable' (Table), 'xx0xxThingsRowerTable' (Table), 'xx0xxThingsTablerTable' (Table)]
   /   /   /  '<Spe><Instance>TabularedTableKeyStrsList' : []
   /   /   /  '<Spe><Instance>TabularedTablesOrderedDict' : 
   /   /   /   /{ 
   /   /   /   /}
   /   /   /  '<Spe><Instance>TabularedSuffixStr' : ThingsTabularerTable
   /   /   /}
   /   /}
   /  '<New><Instance>IdInt' : 4565029712
   /  '<New><Instance>NewtorkAttentionStr' : 
   /  '<New><Instance>NewtorkCatchStr' : 
   /  '<New><Instance>NewtorkCollectionStr' : 
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopStructurer
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<Spe><Class>StructuringBeforeUpdateList' : None
   /  '<Spe><Class>StructuringNodeCollectionStrsList' : []
   /}

------

hdf5 file is : /                        Group
/TopStructurer           Group
/TopStructurer/FirstChildStructurer Group
/TopStructurer/FirstChildStructurer/GrandChildStructurer Group
/TopStructurer/SecondChildStructurer Group
/TopStructurer/SecondChildStructurer/OtherGrandChildStructurer Group
/xx0xxThingsFindoerTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsInserterTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="hello"}
/xx0xxThingsRecovererTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsRetrieverTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="guten tag"}
/xx0xxThingsRowerTable   Dataset {0/Inf}
    Data:

/xx0xxThingsTablerTable  Dataset {0/Inf}
    Data:

/xx0xx__UnitsInt_3__ThingsMergerTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx0xx__UnitsInt_3__ThingsShaperTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx1xx__UnitsInt_2__ThingsMergerTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}
/xx1xx__UnitsInt_2__ThingsShaperTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}


*****End of the Attest *****


Tabler

Doc


The Tabler defines TablesClass instances able to set in a hdf5 structure a table at a certain node, taking in account the order of already created tables.


View the Tabler notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Tabler.ipynb)

Code



# -*- coding: utf-8 -*-
"""


<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>


The Tabler defines TablesClass instances able to set in a hdf5 structure
a table at a certain node, taking in account the order of already created tables.

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Modelers.Tabularer"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
#</ImportSpecificModules>

#<DefineLocals>
TablingOrderStr='xx'
#</DefineLocals>

#<DefineClass>
@DecorationClass(**{'ClassingSwitchMethodStrsList':['table']})
class TablerClass(
                    BaseClass,
                ):

    #Definition
    RepresentingKeyStrsList=[
                                    'TabledKeyStr',                                         
                                    'TabledInt',                                                                
                                    'TabledTable'
                                ]

    def default_init(self,
                        _TabledKeyStr="",   
                        _TabledInt=-1,          
                        _TabledTable=None,  
                        **_KwargVariablesDict
                        ):

        #Call the parent init method
        BaseClass.__init__(self,**_KwargVariablesDict)

    def do_table(self):

        #debug
        '''
        self.debug(('self.',self,['ModelingDescriptionTuplesList']))
        '''

        #<NotHook>
        #tabular first
        self.tabular()
        #</NotHook>

        #debug
        '''
        self.debug(
                    [
                        'We are going to look if this is a new table or not...In order to index it',
                        ('self.',self,[
                                            'ModeledKeyStr',
                                            'ModeledDescriptionClass',
                                            'TabularedTableKeyStrsList',
                                            'TabularedSuffixStr',
                                            'TabledKeyStr'
                                        ])
                    ]
                )
        '''

        #Get the suffix Strs of all the tables and their index
        TabledList=SYS.unzip(map(
                lambda __StrsList:
                (
                    __StrsList[1],
                    TablingOrderStr.join(__StrsList[2:])
                ),
                map(
                        lambda __TabledKeyStr:
                        __TabledKeyStr.split(TablingOrderStr),
                        self.TabularedTableKeyStrsList
                    )
            ),[0,1])

        #debug
        '''
        self.debug(('vars ',vars(),['TabledList']))
        '''

        #Unpack if it is possible
        if len(TabledList)>0:

            #Unpack
            [TabledIntsTuple,TabledSuffixStrsList]=TabledList

            #debug
            '''
            self.debug(
                        [
                            'There are already some tables',
                            'TabledSuffixStrsList is '+str(TabledSuffixStrsList),
                            "self.TabularedSuffixStr is "+str(
                                self.TabularedSuffixStr)
                        ]
                    )
            '''

            if self.TabularedSuffixStr not in TabledSuffixStrsList:

                #Increment the IndexStr
                IndexInt=max(map(int,TabledIntsTuple))+1

                #Strify
                IndexStr=str(IndexInt)

                #debug
                '''
                self.debug('IndexStr of this new table is '+str(IndexStr))
                '''

            else:

                #Get the already setted one
                IndexStr=self.TabularedTableKeyStrsList[
                    TabledSuffixStrsList.index(self.TabularedSuffixStr)
                    ].split(TablingOrderStr)[1]

                #Intify
                IndexInt=(int)(IndexStr)

                #debug
                '''
                self.debug('IndexStr of this not new table is '+str(IndexStr))
                '''

        else:

            #debug
            '''
            self.debug('There are no tables here')
            '''

            #set to empty lists 
            [TabledIntsTuple,TabledSuffixStrsList]=[[],[]]

            #Init the list
            IndexInt=0

            #Strify
            IndexStr="0"

        #Bind with TabledKeyStr setting
        self.TabledKeyStr=TablingOrderStr+IndexStr+TablingOrderStr+self.TabularedSuffixStr

        #set the TabularedInt
        self.TabledInt=IndexInt

        #debug
        '''
        self.debug("self.TabledKeyStr is "+str(self.TabledKeyStr))
        '''

        #debug
        '''
        self.debug(
                    [
                        'Here we create the table or get it depending if it is new or not',
                        'self.TabledKeyStr is '+self.TabledKeyStr,
                        'self.TabularedTopFileVariable!=None is '+str(self.TabularedTopFileVariable!=None)
                    ]
                )
        '''

        #Check
        if self.TabledKeyStr!="" and self.TabularedTopFileVariable!=None:

            #debug
            '''
            self.debug(
                        [
                            ('self.',self,['TabledKeyStr','TabularedTableKeyStrsList'])
                        ]
                    )
            '''

            #Create the Table if not already
            if self.TabledKeyStr not in self.TabularedTableKeyStrsList:

                #debug
                '''
                self.debug(
                            [
                                'The table not exists',
                            ]
                        )
                '''

                #Create the Table in the hdf5
                self.TabledTable=self.TabularedTopFileVariable.create_table(
                                            self.TabularedGroupVariable,
                                            self.TabledKeyStr,
                                            self.ModeledDescriptionClass,
                                            self.ModeledDescriptionClass.__doc__ 
                                            if self.ModeledDescriptionClass.__doc__!=None 
                                            else "This is the "+self.ModeledDescriptionClass.__name__
                                        )

                #Append in the self.ModeledDict['TabularedTableKeyStrsList']
                self.TabularedTableKeyStrsList.append(self.TabledKeyStr)

            else:

                #debug
                '''
                self.debug(
                                [
                                    'The table exists',
                                    "self.TabularedGroupVariable is "+str(self.TabularedGroupVariable)
                                ]
                            )
                '''

                #Else just get it 
                self.TabledTable=self.TabularedGroupVariable._f_getChild(self.TabledKeyStr)

            #set the in the TablesOrderedDict
            self.TabularedTablesOrderedDict[self.TabledKeyStr]=self.TabledTable

            #debug
            '''
            self.debug("self.TabularedTablesOrderedDict is "+str(self.TabularedTablesOrderedDict))
            '''

        #debug
        '''
        self.debug(
                    [
                        'Table is done here...',
                        ('self.',self,['TabledTable','TabularedTopFileVariable'])
                    ]
                )
        '''

        #<NotHook>
        #Return 
        #return self
        #</NotHook>

#</DefineClass>

View the Tabler sources on Github

Example

Let's create an empty class, which will automatically receive special attributes from the decorating ClassorClass, specially the NameStr, that should be the ClassStr without the TypeStr in the end.


In [15]:
#ImportModules
import tables
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Noders import Structurer
from ShareYourSystem.Standards.Modelers import Tabler

#Definition of a Structurer instance with a noded datar
MyStructurer=Structurer.StructurerClass().collect(
    "Datome",
    "Things",
    Tabler.TablerClass().__setitem__(
        'Attr_ModelingDescriptionTuplesList',
        [
            #GetStr #ColumnStr #Col
            ('MyInt','MyInt',tables.Int64Col()),
            ('MyStr','MyStr',tables.StringCol(10)),
            ('MyIntsList','MyIntsList',(tables.Int64Col(shape=3)))
        ]
    )
)

#Tabular in it
MyStructurer['<Datome>ThingsTabler'].table()
    
#Definition the AttestedStr
SYS._attest(
    [
        'MyStructurer is '+SYS._str(
        MyStructurer,
        **{
            'RepresentingBaseKeyStrsListBool':False,
            'RepresentingAlineaIsBool':False
        }
        ),
        'hdf5 file is : '+MyStructurer.hdfview().hdfclose().HdformatedConsoleStr
    ]
) 

#Print



*****Start of the Attest *****

MyStructurer is < (StructurerClass), 4565343056>
   /{ 
   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /{ 
   /   /  'ThingsTabler' : < (TablerClass), 4565343120>
   /   /   /{ 
   /   /   /  '<New><Instance>IdInt' : 4565343120
   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /  '<New><Instance>NodeKeyStr' : ThingsTabler
   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (StructurerClass), 4565343056>
   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4565726744>
   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /[
   /   /   /   /  0 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyInt
   /   /   /   /   /  1 : MyInt
   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /  1 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyStr
   /   /   /   /   /  1 : MyStr
   /   /   /   /   /  2 : StringCol(itemsize=10, shape=(), dflt='', pos=None)
   /   /   /   /   /)
   /   /   /   /  2 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyIntsList
   /   /   /   /   /  1 : MyIntsList
   /   /   /   /   /  2 : Int64Col(shape=(3,), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /]
   /   /   /  '<Spe><Instance>TabledInt' : 0
   /   /   /  '<Spe><Instance>TabledKeyStr' : xx0xxThingsTablerTable
   /   /   /  '<Spe><Instance>TabledTable' : /xx0xxThingsTablerTable (Table(0,)) 'This is the ThingsTablerModelClass'
  description := {
  "RowInt": Int64Col(shape=(), dflt=0, pos=0),
  "MyInt": Int64Col(shape=(), dflt=0, pos=1),
  "MyIntsList": Int64Col(shape=(3,), dflt=0, pos=2),
  "MyStr": StringCol(itemsize=10, shape=(), dflt='', pos=3)}
  byteorder := 'little'
  chunkshape := (1310,)
   /   /   /}
   /   /}
   /  '<New><Instance>IdInt' : 4565343056
   /  '<New><Instance>NewtorkAttentionStr' : 
   /  '<New><Instance>NewtorkCatchStr' : 
   /  '<New><Instance>NewtorkCollectionStr' : 
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopStructurer
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<Spe><Class>StructuringBeforeUpdateList' : None
   /  '<Spe><Class>StructuringNodeCollectionStrsList' : []
   /}

------

hdf5 file is : /                        Group
/TopStructurer           Group
/TopStructurer/FirstChildStructurer Group
/TopStructurer/FirstChildStructurer/GrandChildStructurer Group
/TopStructurer/SecondChildStructurer Group
/TopStructurer/SecondChildStructurer/OtherGrandChildStructurer Group
/xx0xxThingsFindoerTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsInserterTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="hello"}
/xx0xxThingsRecovererTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsRetrieverTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="guten tag"}
/xx0xxThingsRowerTable   Dataset {0/Inf}
    Data:

/xx0xxThingsTablerTable  Dataset {0/Inf}
    Data:

/xx0xx__UnitsInt_3__ThingsMergerTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx0xx__UnitsInt_3__ThingsShaperTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx1xx__UnitsInt_2__ThingsMergerTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}
/xx1xx__UnitsInt_2__ThingsShaperTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}


*****End of the Attest *****


Rower

Doc


The Rower helps to set rowed lines in a Databaser from pointed attributes, ready then to be inserted in a table.


View the Rower notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Rower.ipynb)

Code



# -*- coding: utf-8 -*-
"""


<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>


The Rower helps to set rowed lines in a Databaser from pointed attributes,
ready then to be inserted in a table.

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Modelers.Tabler"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
import collections
import copy

#</ImportSpecificModules>

#<DefineFunctions>
def getRowedDictsListWithTable(_Table):
    return map(
            lambda __Row:
            dict(
                zip(
                    _Table.colnames,
                    map(
                        lambda __ColumnStr:
                        __Row[__ColumnStr],
                        _Table.colnames
                    )
                )
            ),
            _Table.iterrows()
        )
#</DefineFunctions>


#<DefineClass>
@DecorationClass(
    #**{'ClassingSwitchMethodStrsList':["row"]}
)
class RowerClass(
                    BaseClass
                ):

    #Definition
    RepresentingKeyStrsList=[
                                'RowingKeyStrsList',
                                'RowedGetStrToColumnStrOrderedDict',
                                'RowedColumnStrsList',                                                                                                      
                                'RowedPickOrderedDict',
                                'RowedIsBoolsList',
                                'RowedIsBool',
                                'RowedIndexInt'
                            ]

    def default_init(
                    self,
                    _RowingKeyStrsList={
                            'DefaultValueType':property,
                            'PropertyInitVariable':[],
                            'PropertyDocStr':''
                    },
                    _RowedGetStrToColumnStrOrderedDict=None,
                    _RowedColumnStrsList=None,                                                              
                    _RowedPickOrderedDict=None, 
                    _RowedIsBoolsList=None, 
                    _RowedIsBool=False,
                    _RowedIndexInt=-1,
                    **_KwargVariablesDict
                ):

        #Call the parent init method
        BaseClass.__init__(self,**_KwargVariablesDict)

    def setModelingDescriptionTuplesList(self,_SettingValueVariable):

        #debug
        '''
        self.debug(
                    [
                        'Before setting ModelingDescriptionTuplesList',
                        ('self.',self,['ModelingDescriptionTuplesList']),
                        '_SettingValueVariable is '+str(_SettingValueVariable)
                    ]
                )
        '''

        #set
        self._ModelingDescriptionTuplesList=_SettingValueVariable

        #debug
        '''
        self.debug(
                    [
                        'After',
                        ('self.',self,['ModelingDescriptionTuplesList']),
                        'We bind with RowedGetStrToColumnStrOrderedDict setting',
                    ]
                )
        '''

        #Bind with RowedGetStrToColumnStrOrderedDict setting
        self.RowedGetStrToColumnStrOrderedDict=collections.OrderedDict(
                map(
                    lambda _ModelingSealTuple:
                    (_ModelingSealTuple[0],_ModelingSealTuple[1]),
                    self._ModelingDescriptionTuplesList
                    )
                )

        #debug
        '''
        self.debug(
                    [
                        ('self.',self,['RowedGetStrToColumnStrOrderedDict'])
                    ]
                )
        '''

    ModelingDescriptionTuplesList=property(
                                    BaseClass.ModelingDescriptionTuplesList.fget,
                                    setModelingDescriptionTuplesList,
                                    BaseClass.ModelingDescriptionTuplesList.fdel,
                                    BaseClass.ModelingDescriptionTuplesList.__doc__
                                )

    def setRowingKeyStrsList(self,_SettingValueVariable):

        #debug
        '''
        self.debug('_SettingValueVariable '+str(_SettingValueVariable))
        '''

        #set
        self._RowingKeyStrsList=_SettingValueVariable

        #debug
        '''
        self.debug(
                        [
                            'bind with RowedColumnStrsList setting',
                            ('self.',self,['RowedGetStrToColumnStrOrderedDict'])
                        ]
                    )
        '''

        #Bind with 
        self.RowedColumnStrsList=map(
                lambda __RowingGetStr:
                self.RowedGetStrToColumnStrOrderedDict[__RowingGetStr],
                _SettingValueVariable
            )

        #debug
        '''
        self.debug(('self.',self,['RowedColumnStrsList']))
        '''

    #@Alerter.AlerterClass()
    #@Hooker.HookerClass(**{'HookingBeforeVariablesList':[{'CallingMethodStr':"table"}]})
    def do_row(self):
        """"""

        #<NotHook>
        #table then
        self.table()
        #</NotHook>

        #Check  
        if self.NodePointDeriveNoder!=None:

            #debug
            '''
            self.NodePointDeriveNoder.debug('ParentSpeaking...')
            '''

            #Update
            self.RowedPickOrderedDict.update(
                zip(
                    self.RowedColumnStrsList,
                    self.NodePointDeriveNoder.pick(self.RowingKeyStrsList)
                )
            )

            #debug
            '''
            self.debug(('self.',self,[
                                    'RowedPickOrderedDict',
                                    'TabledTable'
                                ]))
            '''

            #Check if it was already rowed
            self.RowedIsBoolsList=map(
                    lambda __Row:
                    all(
                        map(
                                lambda __RowedItemTuple:
                                SYS.getIsEqualBool(
                                                    __Row[__RowedItemTuple[0]],
                                                    __RowedItemTuple[1]
                                                ),
                                self.RowedPickOrderedDict.items()
                            )
                        ),
                    self.TabledTable.iterrows()
                )

            #debug
            '''
            self.debug(('self.',self,['RowedIsBoolsList']))
            '''

            #set
            if len(self.RowedIsBoolsList)==0:
                self.RowedIsBool=False
            else:
                self.RowedIsBool=any(self.RowedIsBoolsList)

            #Init to the len of the table
            self.RowedIndexInt=self.TabledTable.nrows

            #But maybe find a last index
            if self.RowedIsBool: 
                if len(self.RowedIsBoolsList)>0:
                    self.RowedIndexInt=self.RowedIsBoolsList.index(True)

            #debug
            '''
            self.debug(('self.',self,['RowedIsBool','RowedIndexInt']))
            ''' 

        #<NotHook>
        #Return self
        #return self
        #</NotHook>

#</DefineClass>

View the Rower sources on Github

Example

Let's create an empty class, which will automatically receive special attributes from the decorating ClassorClass, specially the NameStr, that should be the ClassStr without the TypeStr in the end.


In [19]:
#ImportModules
import tables
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Noders import Structurer
from ShareYourSystem.Standards.Modelers import Rower

#Definition of a Structurer instance with a noded datar
MyStructurer=Structurer.StructurerClass().collect(
    "Datome",
    "Things",
    Rower.RowerClass().update(
        [
            (
                'Attr_ModelingDescriptionTuplesList',
                [
                    #GetStr #ColumnStr #Col
                    ('MyInt','MyInt',tables.Int64Col()),
                    ('MyStr','MyStr',tables.StringCol(10)),
                    ('MyIntsList','MyIntsList',(tables.Int64Col(shape=3)))
                ]
            ),
            ('Attr_RowingKeyStrsList',['MyInt'])
        ]
    )
)

#Tabular in it
MyStructurer.update(                            
[
    ('MyInt',0),
    ('MyStr',"hello"),
    ('MyIntsList',[2,4,1])
])['<Datome>ThingsRower'].row()
    
#Definition the AttestedStr
SYS._attest(
    [
        'MyStructurer is '+SYS._str(
        MyStructurer,
        **{
            'RepresentingBaseKeyStrsListBool':False,
            'RepresentingAlineaIsBool':False
        }
        ),
        'hdf5 file is : '+MyStructurer.hdfview().hdfclose().HdformatedConsoleStr
    ]
) 

#Print



*****Start of the Attest *****

MyStructurer is < (StructurerClass), 4565342480>
   /{ 
   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /{ 
   /   /  'ThingsRower' : < (RowerClass), 4565342288>
   /   /   /{ 
   /   /   /  '<New><Instance>IdInt' : 4565342288
   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /  '<New><Instance>NodeKeyStr' : ThingsRower
   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (StructurerClass), 4565342480>
   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4565727336>
   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /[
   /   /   /   /  0 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyInt
   /   /   /   /   /  1 : MyInt
   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /  1 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyStr
   /   /   /   /   /  1 : MyStr
   /   /   /   /   /  2 : StringCol(itemsize=10, shape=(), dflt='', pos=None)
   /   /   /   /   /)
   /   /   /   /  2 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyIntsList
   /   /   /   /   /  1 : MyIntsList
   /   /   /   /   /  2 : Int64Col(shape=(3,), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /]
   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['MyInt']
   /   /   /  '<Spe><Class>RowingKeyStrsList' : {...}< (list), 4557028168>
   /   /   /  '<Spe><Instance>RowedColumnStrsList' : ['MyInt']
   /   /   /  '<Spe><Instance>RowedGetStrToColumnStrOrderedDict' : 
   /   /   /   /{ 
   /   /   /   /  'MyInt' : MyInt
   /   /   /   /  'MyStr' : MyStr
   /   /   /   /  'MyIntsList' : MyIntsList
   /   /   /   /}
   /   /   /  '<Spe><Instance>RowedIndexInt' : 0
   /   /   /  '<Spe><Instance>RowedIsBool' : False
   /   /   /  '<Spe><Instance>RowedIsBoolsList' : []
   /   /   /  '<Spe><Instance>RowedPickOrderedDict' : 
   /   /   /   /{ 
   /   /   /   /  'MyInt' : 0
   /   /   /   /}
   /   /   /}
   /   /}
   /  '<New><Instance>IdInt' : 4565342480
   /  '<New><Instance>MyInt' : 0
   /  '<New><Instance>MyIntsList' : [2, 4, 1]
   /  '<New><Instance>MyStr' : hello
   /  '<New><Instance>NewtorkAttentionStr' : 
   /  '<New><Instance>NewtorkCatchStr' : 
   /  '<New><Instance>NewtorkCollectionStr' : 
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopStructurer
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<Spe><Class>StructuringBeforeUpdateList' : None
   /  '<Spe><Class>StructuringNodeCollectionStrsList' : []
   /}

------

hdf5 file is : /                        Group
/TopStructurer           Group
/TopStructurer/FirstChildStructurer Group
/TopStructurer/FirstChildStructurer/GrandChildStructurer Group
/TopStructurer/SecondChildStructurer Group
/TopStructurer/SecondChildStructurer/OtherGrandChildStructurer Group
/xx0xxThingsFindoerTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsInserterTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="hello"}
/xx0xxThingsRecovererTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsRetrieverTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="guten tag"}
/xx0xxThingsRowerTable   Dataset {0/Inf}
    Data:

/xx0xxThingsTablerTable  Dataset {0/Inf}
    Data:

/xx0xx__UnitsInt_3__ThingsMergerTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx0xx__UnitsInt_3__ThingsShaperTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx1xx__UnitsInt_2__ThingsMergerTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}
/xx1xx__UnitsInt_2__ThingsShaperTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}


*****End of the Attest *****


Inserter

Doc


Inserter instances can insert a RowedVariablesList into a table checking maybe before if this line is new in the table or not depending on identifying items.


View the Inserter notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Inserter.ipynb)

Code



# -*- coding: utf-8 -*-
"""

<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>


Inserter instances can insert a RowedVariablesList into a table
checking maybe before if this line is new in the table or not
depending on identifying items.

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
import collections
BaseModuleStr="ShareYourSystem.Standards.Modelers.Rower"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
#</ImportSpecificModules>

#<DefineClass>
@DecorationClass()
class InserterClass(
                    BaseClass,
                ):

    #Definition
    RepresentingKeyStrsList=[                                       
                                    'InsertedNotRowGetStrsList',
                                    'InsertedNotRowColumnStrsList',
                                    'InsertedNotRowPickOrderedDict',
                                    'InsertedIndexInt'
                                ]

    def default_init(self,
                    _InsertedNotRowGetStrsList=None,
                    _InsertedNotRowColumnStrsList=None,
                    _InsertedNotRowPickOrderedDict=None,
                    _InsertedIndexInt=-1,       
                    **_KwargVariablesDict
                    ):

        #Call the parent init method
        BaseClass.__init__(self,**_KwargVariablesDict)

    def setRowingKeyStrsList(self,_SettingValueVariable):

        #Hook
        BaseClass.setRowingKeyStrsList(self,_SettingValueVariable)

        #Bind 
        self.InsertedNotRowGetStrsList=list(set(SYS.unzip(
            self.ModelingDescriptionTuplesList,[0]
        ))-set(self.RowingKeyStrsList))

        #set
        self.InsertedNotRowColumnStrsList=map(
            lambda __NotRowGetStr:
            self.RowedGetStrToColumnStrOrderedDict[__NotRowGetStr],
            self.InsertedNotRowGetStrsList
        )
    RowingKeyStrsList=property(
                                    BaseClass.RowingKeyStrsList.fget,
                                    setRowingKeyStrsList,
                                    BaseClass.RowingKeyStrsList.fdel,
                                    BaseClass.RowingKeyStrsList.__doc__
                                )


    def do_insert(self):
        """ """

        #debug
        '''
        self.debug('row maybe before...')
        '''

        #<NotHook>
        #row first
        self.row()
        #</NotHook>

        #debug
        '''
        self.debug(
                    ('self.',self,['RowedIsBool'])
                )
        self.NodePointDeriveNoder.debug([
                ('NOTE : ...ParentSpeaking...')
            ])
        '''

        """
        map(
                lambda __InitVariable:
                setattr(
                    self,
                    __KeyStr,
                    SYS.getInitiatedVariableWithKeyStr(__KeyStr)    
                ) if __InitVariable==None else None,
                map(
                        lambda __KeyStr:
                        (
                            __KeyStr,
                            getattr(self,__KeyStr)
                        ),
                        [
                            'InsertedNotRowPickOrderedDict',
                            'InsertedNotRowGetStrsList',
                            'InsertedNotRowGetStrsList',
                            'InsertedNotRowPickOrderedDict'
                        ]
                    )
            )
        """

        #debug
        '''
        self.debug(('self.',self,['InsertedNotRowPickOrderedDict']))
        '''

        #Append and row if it is new
        if self.RowedIsBool==False:

            #Check
            if self.TabledTable!=None:

                #debug
                '''
                self.debug('This is a new row')
                '''

                #Get the row
                Row=None
                Row=self.TabledTable.row

                #debug
                '''
                self.debug(('self.',self,['InsertedNotRowPickOrderedDict']))
                '''

                #Pick and update                
                self.InsertedNotRowPickOrderedDict.update(
                zip(
                    self.InsertedNotRowColumnStrsList,
                    self.NodePointDeriveNoder.pick(
                        self.InsertedNotRowGetStrsList
                        )
                    )
                )

                #debug
                '''
                self.debug(('self.',self,[
                                            'RowedPickOrderedDict',
                                            'InsertedNotRowPickOrderedDict'
                                        ]))
                '''

                #Definition the InsertedItemTuplesList
                InsertedItemTuplesList=[
                                        ('RowInt',self.RowedIndexInt)
                                    ]+self.RowedPickOrderedDict.items(
                                    )+self.InsertedNotRowPickOrderedDict.items()

                #import tables
                #print(tables.tableextension.Row)

                #debug
                '''
                self.debug(
                            [
                                'This is a new row',
                                'Colnames are : '+str(self.TabledTable.colnames),
                                'InsertedItemTuplesList is '+str(InsertedItemTuplesList),
                                'self.TabledTable is '+str(dir(self.TabledTable)),
                                'self.ModeledDescriptionClass is '+(str(self.ModeledDescriptionClass.columns) if hasattr(self.ModeledDescriptionClass,'columns') else ""),
                                'Row is '+str(dir(Row)),
                                'Row.table is '+str(Row.table),
                                'TabularedTablesOrderedDict is '+str(self.TabularedTablesOrderedDict)
                            ]
                        )
                '''

                #set
                map(
                        lambda __InsertingTuple:
                        Row.__setitem__(*__InsertingTuple),
                        InsertedItemTuplesList
                    )

                #debug
                '''
                self.debug('The Row setting was good, so append insert')
                '''

                #Append and Insert
                Row.append()
                self.TabledTable.insert()

        else:

            #debug
            '''
            self.debug(
                        [
                            'This is maybe not an IdentifyingInserter',
                            'Or it is already rowed',
                            'self.InsertedIsBoolsList is '+str(self.InsertedIsBoolsList)
                        ]
                    )
            '''
            pass

        #<NotHook>
        #Return self
        #return self
        #</NotHook>

#</DefineClass>

View the Inserter sources on Github

Example

Let's create an empty class, which will automatically receive special attributes from the decorating ClassorClass, specially the NameStr, that should be the ClassStr without the TypeStr in the end.


In [23]:
#ImportModules
import tables
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Noders import Structurer
from ShareYourSystem.Standards.Modelers import Inserter

#Definition of a Structurer instance with a noded datar
MyStructurer=Structurer.StructurerClass().collect(
    "Datome",
    "Things",
    Inserter.InserterClass().update(
        [
            (
                'Attr_ModelingDescriptionTuplesList',
                [
                    #GetStr #ColumnStr #Col
                    ('MyInt','MyInt',tables.Int64Col()),
                    ('MyStr','MyStr',tables.StringCol(10)),
                    ('MyIntsList','MyIntsList',(tables.Int64Col(shape=3)))
                ]
            ),
            ('Attr_RowingKeyStrsList',['MyInt'])
        ]
    )
)

#Definition a structure with a db
MyStructurer.update(
            [
                ('MyInt',1),
                ('MyStr',"bonjour"),
                ('MyIntsList',[2,4,6])
            ]
).command(
    _UpdateList=[('insert',{'LiargVariablesList':[]})],
    **{'GatheringVariablesList':['<Datome>ThingsInserter']}    
).update(
            [
                ('MyInt',0),
                ('MyStr',"hello"),
                ('MyIntsList',[0,0,0])
            ]
).command(
    _UpdateList=[('insert',{'LiargVariablesList':[]})],    
)

#Definition the AttestedStr
SYS._attest(
    [
        'MyStructurer is '+SYS._str(
        MyStructurer,
        **{
            'RepresentingBaseKeyStrsListBool':False,
            'RepresentingAlineaIsBool':False
        }
        ),
        'hdf5 file is : '+MyStructurer.hdfview().hdfclose().HdformatedConsoleStr
    ]
) 

#Print



*****Start of the Attest *****

MyStructurer is < (StructurerClass), 4565259152>
   /{ 
   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /{ 
   /   /  'ThingsInserter' : < (InserterClass), 4565260880>
   /   /   /{ 
   /   /   /  '<New><Instance>IdInt' : 4565260880
   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /  '<New><Instance>NodeKeyStr' : ThingsInserter
   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (StructurerClass), 4565259152>
   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4565728520>
   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /[
   /   /   /   /  0 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyInt
   /   /   /   /   /  1 : MyInt
   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /  1 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyStr
   /   /   /   /   /  1 : MyStr
   /   /   /   /   /  2 : StringCol(itemsize=10, shape=(), dflt='', pos=None)
   /   /   /   /   /)
   /   /   /   /  2 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyIntsList
   /   /   /   /   /  1 : MyIntsList
   /   /   /   /   /  2 : Int64Col(shape=(3,), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /]
   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['MyInt']
   /   /   /  '<Spe><Class>InsertedIndexInt' : -1
   /   /   /  '<Spe><Instance>InsertedNotRowColumnStrsList' : ['MyStr', 'MyIntsList']
   /   /   /  '<Spe><Instance>InsertedNotRowGetStrsList' : ['MyStr', 'MyIntsList']
   /   /   /  '<Spe><Instance>InsertedNotRowPickOrderedDict' : 
   /   /   /   /{ 
   /   /   /   /}
   /   /   /}
   /   /}
   /  '<New><Instance>IdInt' : 4565259152
   /  '<New><Instance>MyInt' : 0
   /  '<New><Instance>MyIntsList' : [0, 0, 0]
   /  '<New><Instance>MyStr' : hello
   /  '<New><Instance>NewtorkAttentionStr' : 
   /  '<New><Instance>NewtorkCatchStr' : 
   /  '<New><Instance>NewtorkCollectionStr' : 
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopStructurer
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<Spe><Class>StructuringBeforeUpdateList' : None
   /  '<Spe><Class>StructuringNodeCollectionStrsList' : []
   /}

------

hdf5 file is : /                        Group
/TopStructurer           Group
/TopStructurer/FirstChildStructurer Group
/TopStructurer/FirstChildStructurer/GrandChildStructurer Group
/TopStructurer/SecondChildStructurer Group
/TopStructurer/SecondChildStructurer/OtherGrandChildStructurer Group
/xx0xxThingsFindoerTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsInserterTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="hello"}
/xx0xxThingsRecovererTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsRetrieverTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="guten tag"}
/xx0xxThingsRowerTable   Dataset {0/Inf}
    Data:

/xx0xxThingsTablerTable  Dataset {0/Inf}
    Data:

/xx0xx__UnitsInt_3__ThingsMergerTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx0xx__UnitsInt_3__ThingsShaperTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx1xx__UnitsInt_2__ThingsMergerTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}
/xx1xx__UnitsInt_2__ThingsShaperTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}


*****End of the Attest *****


Retriever

Doc


Retriever instances can retrieve InsertedVariablesList given their IndexInt of their corresponding table and their RowInt (ie their index of their inserted line).


View the Retriever notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Retriever.ipynb)

Code



# -*- coding: utf-8 -*-
"""


<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>


Retriever instances can retrieve InsertedVariablesList given their 
IndexInt of their corresponding table and their RowInt 
(ie their index of their inserted line).

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Modelers.Inserter"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
import collections
#</ImportSpecificModules>

#<DefineClass>
@DecorationClass()
class RetrieverClass(BaseClass):

    #Definition
    RepresentingKeyStrsList=[
                                    'RetrievingIndexesList',
                                    'RetrievedColumnStrToGetStrOrderedDict',
                                    'RetrievedRowInt',          
                                    'RetrievedTable',           
                                    'RetrievedPickOrderedDict'
                                ]

    def default_init(self,
                        _RetrievingIndexesList=None,
                        _RetrievedColumnStrToGetStrOrderedDict=None,
                        _RetrievedRowInt=-1,            
                        _RetrievedTable=None,           
                        _RetrievedPickOrderedDict=None,     
                        **_KwargVariablesDict
            ):

        #Call the parent init method
        BaseClass.__init__(self,**_KwargVariablesDict)

    def setModelingDescriptionTuplesList(self,_SettingValueVariable):

        #debug
        '''
        self.debug('Before we call the parent setModelingDescriptionTuplesList method ')
        '''

        #Hook
        BaseClass.setModelingDescriptionTuplesList(self,_SettingValueVariable)

        #Bind with RetrievedColumnStrToGetStrOrderedDict setting
        if self.RetrievedColumnStrToGetStrOrderedDict==None:
            self.RetrievedColumnStrToGetStrOrderedDict=collections.OrderedDict()
        map(
            lambda __ModelingColumnTuple:
            self.RetrievedColumnStrToGetStrOrderedDict.__setitem__(
                __ModelingColumnTuple[1],
                __ModelingColumnTuple[0]
            ),
            self.ModelingDescriptionTuplesList
        )

        #Init
        if self.RetrievedPickOrderedDict==None:
            self.RetrievedPickOrderedDict=collections.OrderedDict()

        #debug
        '''
        self.debug(('self.',self,['RetrievedColumnStrToGetStrOrderedDict']))
        '''

    ModelingDescriptionTuplesList=property(
                                    BaseClass.ModelingDescriptionTuplesList.fget,
                                    setModelingDescriptionTuplesList,
                                    BaseClass.ModelingDescriptionTuplesList.fdel,
                                    BaseClass.ModelingDescriptionTuplesList.__doc__
                                )

    #@Hooker.HookerClass(**{'HookingAfterVariablesList':[{"CallingMethodStr":"table"}]})
    def do_retrieve(self):

        #debug
        '''
        self.debug(
                    [
                        ('self.',self,[
                                        'TabularedTableKeyStrsList',
                                        'RetrievingIndexesList'
                                    ])
                    ]
                )
        '''

        #<NotHook>
        #table first
        self.table()
        #</NotHook>

        #debug
        '''
        self.debug(
                    [
                        ('Ok table is done'),
                        ('self.',self,['TabularedTablesOrderedDict','TabularedTableKeyStrsList'])
                    ]
                )
        '''

        #set the RetrievedRowInt
        self.RetrievedRowInt=self.RetrievingIndexesList[1]

        #Definition the RetrievedTable
        self.RetrievedTable=self.TabularedTablesOrderedDict[
            self.TabularedTableKeyStrsList[
                self.RetrievingIndexesList[0]
            ]
        ]

        #debug
        '''
        self.debug(('self.',self,['RetrievedRowInt','RetrievedTable']))
        '''

        #Definition the RetrievedRowsList
        for __RetrievedRow in self.RetrievedTable.iterrows():
            if __RetrievedRow['RowInt']==self.RetrievedRowInt:

                #debug
                '''
                self.debug('self.RetrievedTable.colnames is '+str(self.RetrievedTable.colnames))
                '''

                #Init
                if self.RetrievedPickOrderedDict==None:
                    self.RetrievedPickOrderedDict=collections.OrderedDict()

                #set
                map(
                    lambda __ColumnStr:
                    self.RetrievedPickOrderedDict.__setitem__(
                        self.RetrievedColumnStrToGetStrOrderedDict[__ColumnStr],
                        __RetrievedRow[__ColumnStr]
                        ) if __ColumnStr in self.RetrievedColumnStrToGetStrOrderedDict else None
                    ,
                    self.RetrievedTable.colnames
                )

                #debug
                '''
                self.debug('RetrievedPickOrderedDict is setted')
                '''

        #debug
        '''
        self.debug(
                    [
                        ('self.',self,['RetrievedPickOrderedDict'])
                    ]
                )
        '''

        #Update
        self.NodePointDeriveNoder.update(
            self.RetrievedPickOrderedDict.items(),
            **{'RestrictingIsBool':True}
        )
        self.NodePointDeriveNoder.RestrictingIsBool=False

        #debug
        '''
        self.debug('Update was done')
        '''

        #<NotHook>
        #Return self
        #return self
        #</NotHook>

#</DefineClass>

View the Retriever sources on Github

Example

Let's create an empty class, which will automatically receive special attributes from the decorating ClassorClass, specially the NameStr, that should be the ClassStr without the TypeStr in the end.


In [27]:
#ImportModules
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Noders import Structurer
from ShareYourSystem.Standards.Modelers import Retriever
import tables

#Definition of a Structurer instance with a noded datar
MyStructurer=Structurer.StructurerClass().collect(
    "Datome",
    "Things",
    Retriever.RetrieverClass().update(
        [
            (
                'Attr_ModelingDescriptionTuplesList',
                [
                    #GetStr #ColumnStr #Col
                    ('MyInt','MyInt',tables.Int64Col()),
                    ('MyStr','MyStr',tables.StringCol(10)),
                    ('MyIntsList','MyIntsList',(tables.Int64Col(shape=3)))
                ]
            ),
            ('Attr_RowingKeyStrsList',['MyInt'])
        ]
    )
)

MyStructurer.update(
            [
                ('MyInt',1),
                ('MyStr',"bonjour"),
                ('MyIntsList',[2,4,6])
            ]
).command(
    _UpdateList=[('insert',{'LiargVariablesList':[]})],
    **{'GatheringVariablesList':['<Datome>ThingsRetriever']}    
).update(
            [
                ('MyInt',0),
                ('MyStr',"guten tag"),
                ('MyIntsList',[0,0,0])
            ]
).command(
    _UpdateList=[('insert',{'LiargVariablesList':[]})],
)


#Retrieve
MyStructurer['<Datome>ThingsRetriever'].__setitem__(
    'RetrievingIndexesList',(0,1)
).retrieve()
                
#Definition the AttestedStr
SYS._attest(
    [
        'MyStructurer is '+SYS._str(
        MyStructurer,
        **{
            'RepresentingBaseKeyStrsListBool':False,
            'RepresentingAlineaIsBool':False
        }
        ),
        'hdf5 file is : '+MyStructurer.hdfview().hdfclose().HdformatedConsoleStr
    ]
) 

#Print



*****Start of the Attest *****

MyStructurer is < (StructurerClass), 4565350032>
   /{ 
   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /{ 
   /   /  'ThingsRetriever' : < (RetrieverClass), 4565349328>
   /   /   /{ 
   /   /   /  '<New><Instance>IdInt' : 4565349328
   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /  '<New><Instance>NodeKeyStr' : ThingsRetriever
   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (StructurerClass), 4565350032>
   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4565248104>
   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /[
   /   /   /   /  0 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyInt
   /   /   /   /   /  1 : MyInt
   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /  1 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyStr
   /   /   /   /   /  1 : MyStr
   /   /   /   /   /  2 : StringCol(itemsize=10, shape=(), dflt='', pos=None)
   /   /   /   /   /)
   /   /   /   /  2 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyIntsList
   /   /   /   /   /  1 : MyIntsList
   /   /   /   /   /  2 : Int64Col(shape=(3,), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /]
   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['MyInt']
   /   /   /  '<Spe><Instance>RetrievedColumnStrToGetStrOrderedDict' : 
   /   /   /   /{ 
   /   /   /   /  'MyInt' : MyInt
   /   /   /   /  'MyStr' : MyStr
   /   /   /   /  'MyIntsList' : MyIntsList
   /   /   /   /}
   /   /   /  '<Spe><Instance>RetrievedRowInt' : 1
   /   /   /  '<Spe><Instance>RetrievedPickOrderedDict' : 
   /   /   /   /{ 
   /   /   /   /  'MyInt' : 0
   /   /   /   /  'MyIntsList' : array([0, 0, 0])
   /   /   /   /  'MyStr' : guten tag
   /   /   /   /}
   /   /   /  '<Spe><Instance>RetrievedTable' : /xx0xxThingsRetrieverTable (Table(2,)) 'This is the ThingsRetrieverModelClass'
  description := {
  "RowInt": Int64Col(shape=(), dflt=0, pos=0),
  "MyInt": Int64Col(shape=(), dflt=0, pos=1),
  "MyIntsList": Int64Col(shape=(3,), dflt=0, pos=2),
  "MyStr": StringCol(itemsize=10, shape=(), dflt='', pos=3)}
  byteorder := 'little'
  chunkshape := (1310,)
   /   /   /  '<Spe><Instance>RetrievingIndexesList' : (0, 1)
   /   /   /}
   /   /}
   /  '<New><Instance>IdInt' : 4565350032
   /  '<New><Instance>MyInt' : 0
   /  '<New><Instance>MyIntsList' : {...}< (ndarray), 4565429104>
   /  '<New><Instance>MyStr' : guten tag
   /  '<New><Instance>NewtorkAttentionStr' : 
   /  '<New><Instance>NewtorkCatchStr' : 
   /  '<New><Instance>NewtorkCollectionStr' : 
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopStructurer
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<Spe><Class>StructuringBeforeUpdateList' : None
   /  '<Spe><Class>StructuringNodeCollectionStrsList' : []
   /}

------

hdf5 file is : /                        Group
/TopStructurer           Group
/TopStructurer/FirstChildStructurer Group
/TopStructurer/FirstChildStructurer/GrandChildStructurer Group
/TopStructurer/SecondChildStructurer Group
/TopStructurer/SecondChildStructurer/OtherGrandChildStructurer Group
/xx0xxThingsFindoerTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsInserterTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="hello"}
/xx0xxThingsRecovererTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsRetrieverTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="guten tag"}
/xx0xxThingsRowerTable   Dataset {0/Inf}
    Data:

/xx0xxThingsTablerTable  Dataset {0/Inf}
    Data:

/xx0xx__UnitsInt_3__ThingsMergerTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx0xx__UnitsInt_3__ThingsShaperTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx1xx__UnitsInt_2__ThingsMergerTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}
/xx1xx__UnitsInt_2__ThingsShaperTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}


*****End of the Attest *****


Findoer

Doc


Findoer (sorry Finder is already an important module in python standards, so just to be sure to not override...) instances helps to find in a hdf5 table RowedVariablesList corresponding to the FindingConditionVariable.


View the Findoer notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Findoer.ipynb)

Code



# -*- coding: utf-8 -*-
"""


<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>


Findoer (sorry Finder is already an important module in python standards, so just to be sure to not override...)
instances helps to find in a hdf5 table RowedVariablesList corresponding to the FindingConditionVariable.

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Modelers.Retriever"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>

#from ShareYourSystem.Functers import Argumenter,Hooker
from ShareYourSystem.Standards.Modelers import Rower
#</ImportSpecificModules>

#<DefineClass>
@DecorationClass()
class FindoerClass(BaseClass):

    #Definition
    RepresentingKeyStrsList=[
                                    'FindingConditionVariable',
                                    'FoundRowDictsList',            
                                    'FoundFilterRowDictsList'
                                ]

    def default_init(self,
                    _FindingConditionVariable=None,
                    _FoundRowDictsList=None,            
                    _FoundFilterRowDictsList=None, 
                    _FoundIsBool=False,
                    **_KwargVariablesDict
                ):

        #Call the parent init method
        BaseClass.__init__(self,**_KwargVariablesDict)

    #@Hooker.HookerClass(**{'HookingAfterVariablesList':[{'CallingMethodStr':"table"}]})
    #@Argumenter.ArgumenterClass()
    def do_find(self):

        #debug
        '''
        self.debug(("self.",self,['ModeledKeyStr','FindingConditionVariable']))
        '''

        #<NotHook>
        #table first
        self.table()
        #</NotHook>

        #If the FoundRowedTuplesList was not yet setted
        if self.FoundIsBool==False:

            #debug
            '''
            self.debug('FoundRowDictsList was not yet setted')
            '''

            #Take the first one in the list
            self.FoundRowDictsList=Rower.getRowedDictsListWithTable(
                                                self.TabularedGroupVariable._f_getChild(
                                                    self.TabularedTableKeyStrsList[0]
                                                )
                                            )

            #set
            self.FoundIsBool=True

        #debug
        '''
        self.debug(
                        [
                            ("self.",self,['FoundRowDictsList'])
                        ]
                )
        '''

        #Now find really ! 
        self.FoundFilterRowDictsList=SYS.filterNone(
                                SYS.where(
                                            self.FoundRowDictsList,
                                            self.FindingConditionVariable
                                )
                            )

        #debug
        '''
        self.debug(
                    [
                        'The where is over now',
                        ("self.",self,['FoundFilterRowDictsList'])
                    ]

                )
        '''

        #<NotHook>
        #Return self
        #return self
        #</NotHook>

#</DefineClass>

View the Findoer sources on Github

Example

Let's create an empty class, which will automatically receive special attributes from the decorating ClassorClass, specially the NameStr, that should be the ClassStr without the TypeStr in the end.


In [31]:
#ImportModules
import tables,operator

import ShareYourSystem as SYS
from ShareYourSystem.Standards.Noders import Structurer
from ShareYourSystem.Standards.Modelers import Findoer

#Definition of a Structurer instance with a noded datar
MyStructurer=Structurer.StructurerClass().collect(
    "Datome",
    "Things",
    Findoer.FindoerClass().update(
        [
            (
                'Attr_ModelingDescriptionTuplesList',
                [
                    #GetStr #ColumnStr #Col
                    ('MyInt','MyInt',tables.Int64Col()),
                    ('MyStr','MyStr',tables.StringCol(10)),
                    ('MyIntsList','MyIntsList',(tables.Int64Col(shape=3)))
                ]
            ),
            ('Attr_RowingKeyStrsList',['MyInt','MyStr','MyIntsList'])
        ]
    )
)

MyStructurer.update(
            [
                ('MyInt',1),
                ('MyStr',"bonjour"),
                ('MyIntsList',[0,0,1])
            ]
)['<Datome>ThingsFindoer'].insert()

MyStructurer.update(
            [
                ('MyInt',0),
                ('MyStr',"guten tag"),
                ('MyIntsList',[0,0,1])
            ]
)['<Datome>ThingsFindoer'].insert()

MyStructurer.update(
            [
                ('MyInt',1),
                ('MyStr',"bonjour"),
                ('MyIntsList',[0,0,0])
            ]
)['<Datome>ThingsFindoer'].insert()

#Retrieve
MyStructurer['<Datome>ThingsFindoer'].find(
                                        [
                                            ('MyInt',(operator.eq,1)),
                                            ('MyIntsList',(SYS.getIsEqualBool,[0,0,1]))
                                        ]
                                    )
    
#Definition the AttestedStr
SYS._attest(
    [
        'MyStructurer is '+SYS._str(
        MyStructurer,
        **{
            'RepresentingBaseKeyStrsListBool':False,
            'RepresentingAlineaIsBool':False
        }
        ),
        'hdf5 file is : '+MyStructurer.hdfview().hdfclose().HdformatedConsoleStr
    ]
) 

#Print



*****Start of the Attest *****

MyStructurer is < (StructurerClass), 4565352272>
   /{ 
   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /{ 
   /   /  'ThingsFindoer' : < (FindoerClass), 4565260944>
   /   /   /{ 
   /   /   /  '<New><Instance>IdInt' : 4565260944
   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /  '<New><Instance>NodeKeyStr' : ThingsFindoer
   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (StructurerClass), 4565352272>
   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4565727040>
   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /[
   /   /   /   /  0 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyInt
   /   /   /   /   /  1 : MyInt
   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /  1 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyStr
   /   /   /   /   /  1 : MyStr
   /   /   /   /   /  2 : StringCol(itemsize=10, shape=(), dflt='', pos=None)
   /   /   /   /   /)
   /   /   /   /  2 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyIntsList
   /   /   /   /   /  1 : MyIntsList
   /   /   /   /   /  2 : Int64Col(shape=(3,), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /]
   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['MyInt', 'MyStr', 'MyIntsList']
   /   /   /  '<Spe><Instance>FindingConditionVariable' : 
   /   /   /   /[
   /   /   /   /  0 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyInt
   /   /   /   /   /  1 : 
   /   /   /   /   /   /(
   /   /   /   /   /   /  0 : <built-in function eq>
   /   /   /   /   /   /  1 : 1
   /   /   /   /   /   /)
   /   /   /   /   /)
   /   /   /   /  1 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyIntsList
   /   /   /   /   /  1 : 
   /   /   /   /   /   /(
   /   /   /   /   /   /  0 : <function getIsEqualBool at 0x10dae4de8>
   /   /   /   /   /   /  1 : [0, 0, 1]
   /   /   /   /   /   /)
   /   /   /   /   /)
   /   /   /   /]
   /   /   /  '<Spe><Instance>FoundFilterRowDictsList' : 
   /   /   /   /[
   /   /   /   /  0 : 
   /   /   /   /   /{ 
   /   /   /   /   /  'RowInt' : 0
   /   /   /   /   /  'MyInt' : 1
   /   /   /   /   /  'MyIntsList' : array([0, 0, 1])
   /   /   /   /   /  'MyStr' : bonjour
   /   /   /   /   /}
   /   /   /   /]
   /   /   /  '<Spe><Instance>FoundRowDictsList' : 
   /   /   /   /[
   /   /   /   /  0 : {...}< (dict), 4565394888>
   /   /   /   /  1 : 
   /   /   /   /   /{ 
   /   /   /   /   /  'RowInt' : 1
   /   /   /   /   /  'MyInt' : 0
   /   /   /   /   /  'MyIntsList' : array([0, 0, 1])
   /   /   /   /   /  'MyStr' : guten tag
   /   /   /   /   /}
   /   /   /   /  2 : 
   /   /   /   /   /{ 
   /   /   /   /   /  'RowInt' : 2
   /   /   /   /   /  'MyInt' : 1
   /   /   /   /   /  'MyIntsList' : array([0, 0, 0])
   /   /   /   /   /  'MyStr' : bonjour
   /   /   /   /   /}
   /   /   /   /]
   /   /   /}
   /   /}
   /  '<New><Instance>IdInt' : 4565352272
   /  '<New><Instance>MyInt' : 1
   /  '<New><Instance>MyIntsList' : [0, 0, 0]
   /  '<New><Instance>MyStr' : bonjour
   /  '<New><Instance>NewtorkAttentionStr' : 
   /  '<New><Instance>NewtorkCatchStr' : 
   /  '<New><Instance>NewtorkCollectionStr' : 
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopStructurer
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<Spe><Class>StructuringBeforeUpdateList' : None
   /  '<Spe><Class>StructuringNodeCollectionStrsList' : []
   /}

------

hdf5 file is : /                        Group
/TopStructurer           Group
/TopStructurer/FirstChildStructurer Group
/TopStructurer/FirstChildStructurer/GrandChildStructurer Group
/TopStructurer/SecondChildStructurer Group
/TopStructurer/SecondChildStructurer/OtherGrandChildStructurer Group
/xx0xxThingsFindoerTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsInserterTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="hello"}
/xx0xxThingsRecovererTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsRetrieverTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="guten tag"}
/xx0xxThingsRowerTable   Dataset {0/Inf}
    Data:

/xx0xxThingsTablerTable  Dataset {0/Inf}
    Data:

/xx0xx__UnitsInt_3__ThingsMergerTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx0xx__UnitsInt_3__ThingsShaperTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx1xx__UnitsInt_2__ThingsMergerTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}
/xx1xx__UnitsInt_2__ThingsShaperTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}


*****End of the Attest *****


Recoverer

Doc


Findoer (sorry Finder is already an important module in python standards, so just to be sure to not override...) instances helps to find in a hdf5 table RowedVariablesList corresponding to the FindingConditionVariable.


View the Recoverer notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Recoverer.ipynb)

Code



# -*- coding: utf-8 -*-
"""


<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>


Findoer (sorry Finder is already an important module in python standards, so just to be sure to not override...)
instances helps to find in a hdf5 table RowedVariablesList corresponding to the FindingConditionVariable.

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Modelers.Findoer"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
from ShareYourSystem.Functers import Argumenter,Hooker
#</ImportSpecificModules>

#<DefineClass>
@DecorationClass()
class RecovererClass(
                        BaseClass
                ):

    #Definition
    RepresentingKeyStrsList=[
                                    'RecoveredDict'
                                ]

    def default_init(self,
                        _RecoveredDict=None,
                        **_KwargVariablesDict
                    ):
        #Call the parent init method
        BaseClass.__init__(self,**_KwargVariablesDict)

    #@Hooker.HookerClass(**{'HookingAfterVariablesList':[{'MethodCallingStr':"find"}]})
    #@Argumenter.ArgumenterClass()
    def do_recover(self):

        #debug
        '''
        self.debug(
                    [
                        'Is the self.RecoveredDict already setted ?',
                        'len(self.RecoveredDict) is '+str(len(self.RecoveredDict))
                    ]
            )
        '''

        #<NotHook>
        #find first
        self.find()
        #</NotHook>

        #Check
        if len(self.RecoveredDict)==0:

            #debug
            '''
            self.debug(
                        [
                            'The RecoveredDict is not yet setted',
                            'Look if we have found only one FilteredRowedDict',
                            'len(self.FoundFilterRowDictsList) is '+str(len(self.FoundFilterRowDictsList))
                        ]
                    )
            '''

            #Check
            if len(self.FoundFilterRowDictsList)==1:

                #debug
                '''
                self.debug('It is good, there is one solution !')
                '''

                #set the RecoveredDict
                self.RecoveredDict.update(self.FoundFilterRowDictsList[0])

        #debug
        '''
        self.debug(
                    [
                        'Now we update with the self.RecoveredDict',
                        'self.RecoveredDict is '+str(self.RecoveredDict)
                    ]
                )
        '''

        #set the RetrievingIndexesList and retrieve
        self.RetrievingIndexesList=(
                                        0,
                                        self.RecoveredDict['RowInt']
                                    )

        #Now we can retrieve
        self.retrieve()

        #<NotHook>
        #Return self
        #return self
        #</NotHook>

#</DefineClass>

View the Recoverer sources on Github

Example

Let's create an empty class, which will automatically receive special attributes from the decorating ClassorClass, specially the NameStr, that should be the ClassStr without the TypeStr in the end.


In [35]:
#ImportModules
import operator,tables

import ShareYourSystem as SYS
from ShareYourSystem.Standards.Noders import Structurer
from ShareYourSystem.Standards.Modelers import Recoverer

#Definition of a Structurer instance with a noded datar
MyStructurer=Structurer.StructurerClass().collect(
    "Datome",
    "Things",
    Recoverer.RecovererClass().update(
        [
            (
                'Attr_ModelingDescriptionTuplesList',
                [
                    #GetStr #ColumnStr #Col
                    ('MyInt','MyInt',tables.Int64Col()),
                    ('MyStr','MyStr',tables.StringCol(10)),
                    ('MyIntsList','MyIntsList',(tables.Int64Col(shape=3)))
                ]
            ),
            ('Attr_RowingKeyStrsList',['MyInt','MyStr','MyIntsList'])
        ]
    )
)

MyStructurer.update(
            [
                ('MyInt',1),
                ('MyStr',"bonjour"),
                ('MyIntsList',[0,0,1])
            ]
)['<Datome>ThingsRecoverer'].insert()

MyStructurer.update(
            [
                ('MyInt',0),
                ('MyStr',"guten tag"),
                ('MyIntsList',[0,0,1])
            ]
)['<Datome>ThingsRecoverer'].insert()

MyStructurer.update(
            [
                ('MyInt',1),
                ('MyStr',"bonjour"),
                ('MyIntsList',[0,0,0])
            ]
)['<Datome>ThingsRecoverer'].insert()

#Retrieve
MyStructurer['<Datome>ThingsRecoverer'].recover(
                                                **{
                                                        'FindingConditionVariable':
                                                        [
                                                            ('MyInt',(operator.eq,1)),
                                                            ('MyIntsList',(SYS.getIsEqualBool,[0,0,1]))
                                                        ]
                                                }
                                        )
                                                    

#Definition the AttestedStr
SYS._attest(
    [
        'MyStructurer is '+SYS._str(
        MyStructurer,
        **{
            'RepresentingBaseKeyStrsListBool':False,
            'RepresentingAlineaIsBool':False
        }
        ),
        'hdf5 file is : '+MyStructurer.hdfview().hdfclose().HdformatedConsoleStr
    ]
) 

#Print



*****Start of the Attest *****

MyStructurer is < (StructurerClass), 4565262160>
   /{ 
   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /{ 
   /   /  'ThingsRecoverer' : < (RecovererClass), 4565342224>
   /   /   /{ 
   /   /   /  '<New><Instance>IdInt' : 4565342224
   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /  '<New><Instance>NodeKeyStr' : ThingsRecoverer
   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (StructurerClass), 4565262160>
   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4565356920>
   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /[
   /   /   /   /  0 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyInt
   /   /   /   /   /  1 : MyInt
   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /  1 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyStr
   /   /   /   /   /  1 : MyStr
   /   /   /   /   /  2 : StringCol(itemsize=10, shape=(), dflt='', pos=None)
   /   /   /   /   /)
   /   /   /   /  2 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyIntsList
   /   /   /   /   /  1 : MyIntsList
   /   /   /   /   /  2 : Int64Col(shape=(3,), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /]
   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['MyInt', 'MyStr', 'MyIntsList']
   /   /   /  '<Spe><Instance>RecoveredDict' : 
   /   /   /   /{ 
   /   /   /   /  'RowInt' : 0
   /   /   /   /  'MyInt' : 1
   /   /   /   /  'MyIntsList' : array([0, 0, 1])
   /   /   /   /  'MyStr' : bonjour
   /   /   /   /}
   /   /   /}
   /   /}
   /  '<New><Instance>IdInt' : 4565262160
   /  '<New><Instance>MyInt' : 1
   /  '<New><Instance>MyIntsList' : array([0, 0, 1])
   /  '<New><Instance>MyStr' : bonjour
   /  '<New><Instance>NewtorkAttentionStr' : 
   /  '<New><Instance>NewtorkCatchStr' : 
   /  '<New><Instance>NewtorkCollectionStr' : 
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopStructurer
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<Spe><Class>StructuringBeforeUpdateList' : None
   /  '<Spe><Class>StructuringNodeCollectionStrsList' : []
   /}

------

hdf5 file is : /                        Group
/TopStructurer           Group
/TopStructurer/FirstChildStructurer Group
/TopStructurer/FirstChildStructurer/GrandChildStructurer Group
/TopStructurer/SecondChildStructurer Group
/TopStructurer/SecondChildStructurer/OtherGrandChildStructurer Group
/xx0xxThingsFindoerTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsInserterTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="hello"}
/xx0xxThingsRecovererTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsRetrieverTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="guten tag"}
/xx0xxThingsRowerTable   Dataset {0/Inf}
    Data:

/xx0xxThingsTablerTable  Dataset {0/Inf}
    Data:

/xx0xx__UnitsInt_3__ThingsMergerTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx0xx__UnitsInt_3__ThingsShaperTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx1xx__UnitsInt_2__ThingsMergerTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}
/xx1xx__UnitsInt_2__ThingsShaperTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}


*****End of the Attest *****


Shaper

Doc


Shaper instances help for storing data in formated tables : if the shape of a rowed variable is depending on other flexible int attribute in the environment, it then build or set another table with the good format size to store again.


View the Shaper notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Shaper.ipynb)

Code



# -*- coding: utf-8 -*-
"""


<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>


Shaper instances help for storing data in formated tables :
if the shape of a rowed variable is depending on other flexible int attribute
in the environment, it then build or set another table with the good format 
size to store again.

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Modelers.Recoverer"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
import copy
import collections
import numpy
from ShareYourSystem.Standards.Modelers import Modeler,Tabularer,Tabler,Inserter
#</ImportSpecificModules>

#<DefineLocals>
ShapingJoiningStr='__'
ShapingTuplingStr='_'
#</DefineLocals>

#<DefineClass>
@DecorationClass(
    **{
        'ClassingSwitchMethodStrsList':[
            'shape',
            'model',
            'tabular'
        ]
    }
)
class ShaperClass(BaseClass):

    #Definition
    RepresentingKeyStrsList=[
                                    'ShapingDimensionTuplesList',
                                    'ShapedSealGetKeyStrsList', 
                                    'ShapedSealDimensionGetKeyStrsListsList',
                                    'ShapedIndexIntsList',                                                      
                                    'ShapedDimensionGetKeyStrsList',    
                                    'ShapedDimensionIntsList',                          
                                    'ShapedStr'
                                ]

    def default_init(self,
                    _ShapingDimensionTuplesList=None,                                       
                    _ShapedSealGetKeyStrsList=None, 
                    _ShapedSealDimensionGetKeyStrsListsList=None,  
                    _ShapedIndexIntsList=None,
                    _ShapedDimensionGetKeyStrsList=None, 
                    _ShapedDimensionIntsList=None,
                    _ShapedStr="",                          
                    **_KwargVariablesDict):

        #Call the parent init method
        BaseClass.__init__(self,**_KwargVariablesDict)

    def mimic_model(self):

        #debug
        '''
        self.debug(
                    [
                        'self.shape is '+SYS._str(self.shape)
                    ]
            )
        '''

        #<NotHook>
        #database and shape first
        '''
        self.debug('We database first')
        '''
        self.database()
        '''
        self.debug(
                    [
                        'We shape first',
                        'self.shape is '+str(self.shape)
                    ]
                )
        '''
        self.shape()
        #</NotHook>

        #Get the new ModeledKeyStr
        if self.ShapedStr!="":

            #debug
            '''
            self.debug(
                        [
                            'We set the new ModeledKeyStr',
                            ('self.',self,['ShapedStr','ModeledSuffixStr'])
                        ]
                    )
            '''

            #set
            self.ModeledKeyStr=self.ShapedStr+ShapingJoiningStr+self.ModeledSuffixStr

        else:
            self.ModeledKeyStr=self.ModeledSuffixStr

        #debug
        '''
        self.debug(
                    [
                        'We set the new ModeledKeyStr',
                        ('self.',self,['ShapedStr','ModeledKeyStr'])
                    ]
                )   
        '''

        #Check
        if self.ModeledDescriptionClassesOrderedDict==None:
            self.ModeledDescriptionClassesOrderedDict=collections.OrderedDict()

        #Unnzip
        ModeledGetKeyStrsList=SYS.unzip(self.ModelingDescriptionTuplesList,[0])

        #debug
        '''
        self.debug(
                    [
                        ('Now change the shape of the shaping cols'),
                        ('self.',self,['ShapedSealDimensionGetKeyStrsListsList'])
                    ]
                )   
        '''

        ShapedModelingDescriptionTuplesList=map(
                self.ModelingDescriptionTuplesList.__getitem__,
                self.ShapedIndexIntsList
            )

        #debug
        '''
        self.debug(
                    'ShapedModelingDescriptionTuplesList is '+str(ShapedModelingDescriptionTuplesList)
                )
        ''' 

        #set the shaping cols
        map(
                lambda __ShapedIndexInt,__ShapedModelingSealTuple:
                self.ModelingDescriptionTuplesList.__setitem__(
                    __ShapedIndexInt,
                    __ShapedModelingSealTuple
                ),
                self.ShapedIndexIntsList,
                map(
                    lambda __ShapedModelingSealTuple,__ShapedSealDimensionGetKeyStrsList:
                    (
                        __ShapedModelingSealTuple[0],
                        __ShapedModelingSealTuple[1],
                        __ShapedModelingSealTuple[2].__class__(
                        shape=self.NodePointDeriveNoder.pick(
                            __ShapedSealDimensionGetKeyStrsList)
                        )
                    ),
                    ShapedModelingDescriptionTuplesList,
                    self.ShapedSealDimensionGetKeyStrsListsList 
                )
            )

        #debug  
        '''     
        self.debug("Now self.ModelingDescriptionTuplesList is "+str(
            self.ModelingDescriptionTuplesList))
        '''

        #<NotHook>
        #model then
        Modeler.ModelerClass.model(self)
        #</NotHook>

    def mimic_tabular(self):

        #<NotHook>
        #tabular first
        Tabularer.TabularerClass.tabular(self)
        #</NotHook>

        #debug
        '''
        self.debug(
                    [
                        'We add the ShapedStr to the TabularedSuffix Str ?',
                        ('self.',self,[
                                            'TabularedSuffixStr',
                                            'ShapedStr'
                                        ])
                    ]
                )
        '''

        #Add the ShapedStr
        if self.ShapedStr!="":

            #debug
            '''
            self.debug(' ShapingJoiningStr not in self.TabularedSuffixStr is '+str( ShapingJoiningStr not in self.TabularedSuffixStr))
            '''

            if ShapingJoiningStr not in self.TabularedSuffixStr:

                #debug
                '''
                self.debug('Yes we add')
                '''

                #Add
                self.TabularedSuffixStr=self.ShapedStr+ShapingJoiningStr+self.TabularedSuffixStr

            #debug
            '''
            self.debug("self.TabularedSuffixStr is "+self.TabularedSuffixStr)
            '''

    def mimic_insert(self):

        #debug
        '''
        self.debug(
                    [
                        ('self.',self,[
                                            'We check the good dimensions of the shaping variables'
                                            'TabledKeyStr',
                                            'TabledTable'
                                        ])
                    ]
            )
        '''

        try:

            #<NotHook>
            #insert first
            BaseClass.insert(self)
            #</NotHook>

        except ValueError:

            #Definition the InsertedOldDimensionIntsListsList
            InsertedOldDimensionIntsList=map(
                    lambda __ShapedSealDimensionGetKeyStrsList:
                    self.NodePointDeriveNoder.pick(
                        __ShapedSealDimensionGetKeyStrsList),
                    self.ShapedSealDimensionGetKeyStrsListsList
                    )

            #Definition the InsertedNewDimensionIntsListsList
            InsertedNewDimensionIntsListsList=map(
                                                lambda __ShapedSealGetKeyStr:
                                                list(
                                                        numpy.shape(
                                                            self.NodePointDeriveNoder[__ShapedSealGetKeyStr]
                                                        )
                                                ),
                                                self.ShapedSealGetKeyStrsList
                                            )

            #debug
            '''
            self.debug(('vars ',vars(),[
                                            'InsertedOldDimensionIntsList',
                                            'InsertedNewDimensionIntsListsList'
                                        ]))
            '''

            #set the shaping attributes to their new values
            map(
                    lambda __ShapedSealDimensionGetKeyStrsList,__InsertedOldDimensionList,__InsertedNewDimensionList:
                    self.__setitem__(
                        'ShapedErrorBool',
                        True
                        ).NodePointDeriveNoder.update(
                        zip(
                            __ShapedSealDimensionGetKeyStrsList,
                            __InsertedNewDimensionList
                            )
                    ) if __InsertedNewDimensionList!=__InsertedOldDimensionList
                    else None,
                    self.ShapedSealDimensionGetKeyStrsListsList,
                    InsertedOldDimensionIntsList,
                    InsertedNewDimensionIntsListsList
                    )

            #debug
            '''
            self.debug('We reset some methods')
            '''

            #reboot
            self.reboot(['Model','Shape','Tabular','Table'])


            #Table
            self.table()

            #debug
            '''
            self.debug('Ok table again is done, so now we insert')
            '''

            #<NotHook>
            #insert first
            BaseClass.insert(self)
            #</NotHook>

    def do_shape(self):

        #debug
        '''
        self.debug(
                    [
                        'We shape here',
                        #("self.",self,['ShapingDimensionTuplesList'])
                    ]
                )
        '''

        #Check
        if len(self.ShapingDimensionTuplesList)>0:

            #set
            [
                self.ShapedSealGetKeyStrsList,
                self.ShapedSealDimensionGetKeyStrsListsList
            ]=SYS.unzip(self.ShapingDimensionTuplesList,[0,1])

            #Flat and set
            self.ShapedDimensionGetKeyStrsList=list(
                set(
                    SYS.flat(
                        self.ShapedSealDimensionGetKeyStrsListsList
                        )
                    )
                )

        else:

            #Default
            self.ShapedSealGetKeyStrsList=[]
            self.ShapedDimensionGetKeyStrsList=[]
            self.ShapedSealDimensionGetKeyStrsListsList=[]

        #debug
        '''
        self.debug(("self.",self,[
                                    'ShapedSealGetKeyStrsList',
                                    'ShapedDimensionGetKeyStrsList'
                                ]))
        '''

        #Definition
        ModeledGetKeyStrsList=SYS.unzip(self.ModelingDescriptionTuplesList,[0])

        #set
        self.ShapedIndexIntsList=map(
                lambda __ShapedSealGetKeyStr:
                ModeledGetKeyStrsList.index(__ShapedSealGetKeyStr),
                self.ShapedSealGetKeyStrsList
            )

        #Check
        if hasattr(self,'NodePointDeriveNoder') and self.NodePointDeriveNoder!=None:

            #Pick
            self.ShapedDimensionIntsList=self.NodePointDeriveNoder.pick(
                self.ShapedDimensionGetKeyStrsList
            )

        else:

            #Default
            self.ShapedDimensionIntsList=[]


        #debug
        '''
        self.debug(("self.",self,['ShapedDimensionIntsList']))
        '''

        #Bind with ModeledShapedStr setting
        self.ShapedStr=ShapingJoiningStr.join(
                                    map(
                                            lambda __ShapedSealGetKeyStr,__ShapedDimensionVariable:
                                            ShapingJoiningStr+str(
                                                __ShapedSealGetKeyStr
                                                )+ShapingTuplingStr+str(
                                                __ShapedDimensionVariable),
                                            self.ShapedDimensionGetKeyStrsList,
                                            self.ShapedDimensionIntsList
                                        )
        )

        #debug 
        '''
        self.debug(('self.',self,['ShapedStr']))
        '''
#</DefineClass>

View the Shaper sources on Github

Example

Let's create an empty class, which will automatically receive special attributes from the decorating ClassorClass, specially the NameStr, that should be the ClassStr without the TypeStr in the end.


In [39]:
#ImportModules
import tables
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Noders import Structurer
from ShareYourSystem.Standards.Modelers import Shaper

#Definition a structure
MyStructurer=Structurer.StructurerClass().collect(
    "Datome",
    "Things",
    Shaper.ShaperClass().update(
        [
            ('Attr_ModelingDescriptionTuplesList',
                [
                    ('MyInt','MyInt',tables.Int64Col()),
                    ('MyStr','MyStr',tables.StringCol(10)),
                    ('MyIntsList','MyIntsList',tables.Int64Col(shape=[3]))
                ]
            ),
            ('Attr_RowingKeyStrsList',
                ['MyInt','MyStr']
            ),
            ('ShapingDimensionTuplesList',
                [
                    ('MyIntsList',['UnitsInt'])
                ]
            )
        ]
    )
)

MyStructurer.update(
    [
        ('MyInt',0),
        ('MyStr',"hello"),
        ('UnitsInt',3),
        ('MyIntsList',[0,0,1])
    ]
)['<Datome>ThingsShaper'].insert()

MyStructurer.update(
    [
        ('MyInt',1),
        ('MyStr',"bonjour"),
        ('MyIntsList',[0,0,1])
    ]
)['<Datome>ThingsShaper'].insert()


MyStructurer.update(
    [
        ('MyInt',1),
        ('MyStr',"ola"),
        ('MyIntsList',[0,1])
    ]
)['<Datome>ThingsShaper'].insert()

#Definition the AttestedStr
SYS._attest(
    [
        'MyStructurer is '+SYS._str(
        MyStructurer,
        **{
            'RepresentingAlineaIsBool':False,
            'RepresentingBaseKeyStrsListBool':False
        }
        ),
        'hdf5 file is : '+MyStructurer.hdfview().hdfclose().HdformatedConsoleStr
    ]
) 

#Print



*****Start of the Attest *****

MyStructurer is < (StructurerClass), 4565342480>
   /{ 
   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /{ 
   /   /  'ThingsShaper' : < (ShaperClass), 4565657360>
   /   /   /{ 
   /   /   /  '<New><Instance>IdInt' : 4565657360
   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /  '<New><Instance>NodeKeyStr' : ThingsShaper
   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (StructurerClass), 4565342480>
   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4565359288>
   /   /   /  '<New><Instance>ShapedErrorBool' : True
   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /[
   /   /   /   /  0 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyInt
   /   /   /   /   /  1 : MyInt
   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /  1 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyStr
   /   /   /   /   /  1 : MyStr
   /   /   /   /   /  2 : StringCol(itemsize=10, shape=(), dflt='', pos=None)
   /   /   /   /   /)
   /   /   /   /  2 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyIntsList
   /   /   /   /   /  1 : MyIntsList
   /   /   /   /   /  2 : Int64Col(shape=(2,), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /]
   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['MyInt', 'MyStr']
   /   /   /  '<Spe><Instance>ShapedDimensionGetKeyStrsList' : ['UnitsInt']
   /   /   /  '<Spe><Instance>ShapedDimensionIntsList' : [2]
   /   /   /  '<Spe><Instance>ShapedIndexIntsList' : [2]
   /   /   /  '<Spe><Instance>ShapedSealDimensionGetKeyStrsListsList' : 
   /   /   /   /(
   /   /   /   /  0 : ['UnitsInt']
   /   /   /   /)
   /   /   /  '<Spe><Instance>ShapedSealGetKeyStrsList' : ('MyIntsList',)
   /   /   /  '<Spe><Instance>ShapedStr' : __UnitsInt_2
   /   /   /  '<Spe><Instance>ShapingDimensionTuplesList' : 
   /   /   /   /[
   /   /   /   /  0 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyIntsList
   /   /   /   /   /  1 : {...}< (list), 4565238344>
   /   /   /   /   /)
   /   /   /   /]
   /   /   /}
   /   /}
   /  '<New><Instance>IdInt' : 4565342480
   /  '<New><Instance>MyInt' : 1
   /  '<New><Instance>MyIntsList' : [0, 1]
   /  '<New><Instance>MyStr' : ola
   /  '<New><Instance>NewtorkAttentionStr' : 
   /  '<New><Instance>NewtorkCatchStr' : 
   /  '<New><Instance>NewtorkCollectionStr' : 
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopStructurer
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<New><Instance>UnitsInt' : 2
   /  '<Spe><Class>StructuringBeforeUpdateList' : None
   /  '<Spe><Class>StructuringNodeCollectionStrsList' : []
   /}

------

hdf5 file is : /                        Group
/TopStructurer           Group
/TopStructurer/FirstChildStructurer Group
/TopStructurer/FirstChildStructurer/GrandChildStructurer Group
/TopStructurer/SecondChildStructurer Group
/TopStructurer/SecondChildStructurer/OtherGrandChildStructurer Group
/xx0xxThingsFindoerTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsInserterTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="hello"}
/xx0xxThingsRecovererTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsRetrieverTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="guten tag"}
/xx0xxThingsRowerTable   Dataset {0/Inf}
    Data:

/xx0xxThingsTablerTable  Dataset {0/Inf}
    Data:

/xx0xx__UnitsInt_3__ThingsMergerTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx0xx__UnitsInt_3__ThingsShaperTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx1xx__UnitsInt_2__ThingsMergerTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}
/xx1xx__UnitsInt_2__ThingsShaperTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}


*****End of the Attest *****


Merger

Doc


Merger instances help for reloading rowed variables from different tables but with different shaping variables. The results is a list of rowed items from merged tables.


View the Merger notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Merger.ipynb)

Code



# -*- coding: utf-8 -*-
"""


<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>


Merger instances help for reloading rowed variables from
different tables but with different shaping variables. 
The results is a list of rowed items from merged tables.

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Modelers.Shaper"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
import operator
Shaper=BaseModule
from ShareYourSystem.Standards.Modelers import Tabler,Rower,Recoverer
#</ImportSpecificModules>

#<DefineClass>
@DecorationClass()
class MergerClass(BaseClass):

    #Definition
    RepresentingKeyStrsList=[
                                    'MergingConditionVariable',                                 
                                    'MergedRowedDictsList'
                                ]

    def default_init(self,
                    _MergingConditionVariable=None,         
                    _MergedRowedDictsList=None,
                    **_KwargVariablesDict
                ):

        #Call the parent init method
        BaseClass.__init__(self,**_KwargVariablesDict)

    def mimic_find(self):

        #<NotHook>
        #merge first
        self.merge()
        #</NotHook>

        #Bound the FoundRowDictsList with the MergedRowedDictsList one
        self.FoundRowDictsList=self.MergedRowedDictsList

        #<NotHook>
        #find then
        BaseClass.find(self)
        #</NotHook>

    def do_merge(self):

        #debug
        '''
        self.debug(
                    ('self.',self,[
                                        'ModeledKeyStr',
                                        'MergingConditionVariable',
                                        'TabularedTableKeyStrsList'
                                    ])
                )
        '''

        #Debug
        '''
        print(

                map(
                            lambda __TabularedKeyStr:
                        __TabularedKeyStr.split(Shaper.ShapingJoiningStr),
                        self.TabularedTableKeyStrsList
                    )
            )
        '''

        #Bind with MergedShapingDictsList setting
        MergedShapingDictsList=map(
                                lambda __StrsList:
                                dict(
                                    map(
                                            lambda __ShapingStr:
                                            SYS.getUnSerializedTuple(
                                                self.NodePointDeriveNoder,
                                                __ShapingStr.split(
                                                    Shaper.ShapingTuplingStr
                                                )
                                            )
                                            #Remove the suffix and the prefix
                                            ,__StrsList[1:-1] if len(__StrsList)>2 else []
                                        )
                                ),
                                map(
                                    lambda __TabularedKeyStr:
                                    __TabularedKeyStr.split(Shaper.ShapingJoiningStr),
                                    self.TabularedTableKeyStrsList
                                )
                        )

        #debug
        '''
        self.debug('MergedShapingDictsList is '+str(MergedShapingDictsList))
        '''

        #Bind with MergedFilteredShapingDictsList
        MergedFilteredShapingDictsList=SYS.where(
                                    MergedShapingDictsList,
                                    self.MergingConditionVariable
                                    )

        #debug
        '''
        self.debug('MergedFilteredShapingDictsList is '+str(MergedFilteredShapingDictsList))
        '''

        #Bind with MergedTablesList setting
        MergedTablesList=SYS.filterNone(
                                    map(
                                            lambda __Table,__MergedFilteredShapingDict:
                                            __Table
                                            if __MergedFilteredShapingDict!=None
                                            else None,
                                            self.TabularedTablesOrderedDict.values(),
                                            MergedFilteredShapingDictsList
                                    ))

        MergedRowedDictsListsList=map(
                lambda __MergedTable:
                map(
                        lambda __RowedDict:
                        dict(__RowedDict,**{
                                'TabledInt':int(
                                                __MergedTable.name.split(Tabler.TablingOrderStr)[1]
                                            )
                            }
                        ),
                        Rower.getRowedDictsListWithTable(__MergedTable)
                    ),
                MergedTablesList
            )

        #debug
        '''
        self.debug('MergedRowedDictsListsList is '+str(MergedRowedDictsListsList))
        '''

        #Reduce
        if len(MergedRowedDictsListsList)>0:
            self.MergedRowedDictsList=reduce(operator.__add__,MergedRowedDictsListsList)

#</DefineClass>

View the Merger sources on Github

Example

Let's create an empty class, which will automatically receive special attributes from the decorating ClassorClass, specially the NameStr, that should be the ClassStr without the TypeStr in the end.


In [43]:
#ImportModules
import operator,tables
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Noders import Structurer
from ShareYourSystem.Standards.Modelers import Merger

#Definition a structure
MyStructurer=Structurer.StructurerClass().collect(
    "Datome",
    "Things",
    Merger.MergerClass().update(
        [
            ('Attr_ModelingDescriptionTuplesList',
                [
                    ('MyInt','MyInt',tables.Int64Col()),
                    ('MyStr','MyStr',tables.StringCol(10)),
                    ('MyIntsList','MyIntsList',tables.Int64Col(shape=[3]))
                ]
            ),
            ('Attr_RowingKeyStrsList',
                ['MyInt','MyStr']
            ),
            ('ShapingDimensionTuplesList',
                [
                    ('MyIntsList',['UnitsInt'])
                ]
            )
        ]
    )
)

MyStructurer.update(
    [
        ('MyInt',0),
        ('MyStr',"hello"),
        ('UnitsInt',3),
        ('MyIntsList',[0,0,1])
    ]
)['<Datome>ThingsMerger'].insert()

MyStructurer.update(
    [
        ('MyInt',1),
        ('MyStr',"bonjour"),
        ('MyIntsList',[0,0,1])
    ]
)['<Datome>ThingsMerger'].insert()

MyStructurer.update(
    [
        ('MyInt',1),
        ('MyStr',"ola"),
        ('MyIntsList',[0,1])
    ]
)['<Datome>ThingsMerger'].insert()

#Merge
MyStructurer['<Datome>ThingsMerger'].merge(
            [
                ('UnitsInt',(operator.gt,2))
            ]
)

#Definition the AttestedStr
SYS._attest(
    [
        'MyStructurer is '+SYS._str(
        MyStructurer,
        **{
            'RepresentingAlineaIsBool':False,
            'RepresentingBaseKeyStrsListBool':False
        }
        ),
        'hdf5 file is : '+MyStructurer.hdfview().hdfclose().HdformatedConsoleStr
    ]
) 

#Print



*****Start of the Attest *****

MyStructurer is < (StructurerClass), 4565348624>
   /{ 
   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /{ 
   /   /  'ThingsMerger' : < (MergerClass), 4565348688>
   /   /   /{ 
   /   /   /  '<New><Instance>IdInt' : 4565348688
   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /  '<New><Instance>NodeKeyStr' : ThingsMerger
   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (StructurerClass), 4565348624>
   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4565360720>
   /   /   /  '<New><Instance>ShapedErrorBool' : True
   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /[
   /   /   /   /  0 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyInt
   /   /   /   /   /  1 : MyInt
   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /  1 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyStr
   /   /   /   /   /  1 : MyStr
   /   /   /   /   /  2 : StringCol(itemsize=10, shape=(), dflt='', pos=None)
   /   /   /   /   /)
   /   /   /   /  2 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : MyIntsList
   /   /   /   /   /  1 : MyIntsList
   /   /   /   /   /  2 : Int64Col(shape=(2,), dflt=0, pos=None)
   /   /   /   /   /)
   /   /   /   /]
   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['MyInt', 'MyStr']
   /   /   /  '<Spe><Instance>MergedRowedDictsList' : 
   /   /   /   /[
   /   /   /   /  0 : 
   /   /   /   /   /{ 
   /   /   /   /   /  'RowInt' : 0
   /   /   /   /   /  'MyInt' : 0
   /   /   /   /   /  'MyIntsList' : array([0, 0, 1])
   /   /   /   /   /  'MyStr' : hello
   /   /   /   /   /  'TabledInt' : 0
   /   /   /   /   /}
   /   /   /   /  1 : 
   /   /   /   /   /{ 
   /   /   /   /   /  'RowInt' : 1
   /   /   /   /   /  'MyInt' : 1
   /   /   /   /   /  'MyIntsList' : array([0, 0, 1])
   /   /   /   /   /  'MyStr' : bonjour
   /   /   /   /   /  'TabledInt' : 0
   /   /   /   /   /}
   /   /   /   /]
   /   /   /  '<Spe><Instance>MergingConditionVariable' : 
   /   /   /   /[
   /   /   /   /  0 : 
   /   /   /   /   /(
   /   /   /   /   /  0 : UnitsInt
   /   /   /   /   /  1 : 
   /   /   /   /   /   /(
   /   /   /   /   /   /  0 : <built-in function gt>
   /   /   /   /   /   /  1 : 2
   /   /   /   /   /   /)
   /   /   /   /   /)
   /   /   /   /]
   /   /   /}
   /   /}
   /  '<New><Instance>IdInt' : 4565348624
   /  '<New><Instance>MyInt' : 1
   /  '<New><Instance>MyIntsList' : [0, 1]
   /  '<New><Instance>MyStr' : ola
   /  '<New><Instance>NewtorkAttentionStr' : 
   /  '<New><Instance>NewtorkCatchStr' : 
   /  '<New><Instance>NewtorkCollectionStr' : 
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopStructurer
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<New><Instance>UnitsInt' : 2
   /  '<Spe><Class>StructuringBeforeUpdateList' : None
   /  '<Spe><Class>StructuringNodeCollectionStrsList' : []
   /}

------

hdf5 file is : /                        Group
/TopStructurer           Group
/TopStructurer/FirstChildStructurer Group
/TopStructurer/FirstChildStructurer/GrandChildStructurer Group
/TopStructurer/SecondChildStructurer Group
/TopStructurer/SecondChildStructurer/OtherGrandChildStructurer Group
/xx0xxThingsFindoerTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsInserterTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="hello"}
/xx0xxThingsRecovererTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,1], MyStr="guten tag"},
        (2) {RowInt=2, MyInt=1, MyIntsList=[0,0,0], MyStr="bonjour"}
/xx0xxThingsRetrieverTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=1, MyIntsList=[2,4,6], MyStr="bonjour"},
        (1) {RowInt=1, MyInt=0, MyIntsList=[0,0,0], MyStr="guten tag"}
/xx0xxThingsRowerTable   Dataset {0/Inf}
    Data:

/xx0xxThingsTablerTable  Dataset {0/Inf}
    Data:

/xx0xx__UnitsInt_3__ThingsMergerTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx0xx__UnitsInt_3__ThingsShaperTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0,1], MyStr="hello"},
        (1) {RowInt=1, MyInt=1, MyIntsList=[0,0,1], MyStr="bonjour"}
/xx1xx__UnitsInt_2__ThingsMergerTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}
/xx1xx__UnitsInt_2__ThingsShaperTable Dataset {1/Inf}
    Data:
        (0) {RowInt=0, MyInt=0, MyIntsList=[0,0], MyStr=""}


*****End of the Attest *****


Joiner

Doc


Joiner instances helps to insert in joined databases, get the corresponding RetrieveIndexesLists if it was already inserted, and then insert locally depending if it is a new row compared to all JoinedRetrieveIndexesListsList


View the Joiner notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Joiner.ipynb)

Code



# -*- coding: utf-8 -*-
"""

<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>

Joiner instances helps to insert in joined databases, get the corresponding
RetrieveIndexesLists if it was already inserted, and then insert locally
depending if it is a new row compared to all JoinedRetrieveIndexesListsList

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Modelers.Merger"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
Featurer=BaseModule
import collections
import tables
from ShareYourSystem.Standards.Modelers import Modeler
#</ImportSpecificModules>

#<DefineLocals>
JoinStr='__'
JoinDeepStr='/'
#</DefineLocals>

#<DefineFunctions>
def getJoinedRetrieveIndexesListWithInstanceVariableAndDeriveDatabaser(
    _InstanceVariable,_DeriveDatabaser):

    #Table
    _DeriveDatabaser.table().pick(['TabledInt',-1])

    #set the JoinedRetrieveIndexesListKeyStr
    return [_DeriveDatabaser.TabledInt,-1]
#<DefineFunctions>

#<DefineClass>
@DecorationClass(**{
    'ClassingSwitchMethodStrsList':[
        'model',
        'tabular',
        'join',
        'insert'
    ]
})
class JoinerClass(BaseClass):

    #Definition
    RepresentingKeyStrsList=[
                                'JoiningCollectionStr',
                                'JoiningCatchStr',
                                'JoiningAttentionStr',
                                'JoiningFindBeforeBool',
                                'JoinedCatchCollectionOrderedDict',
                                'JoinedCatchDeriveJoinersList',
                                'JoinedRetrieveIndexesListGetStrsList',
                                'JoinedRetrieveIndexesListColumnStrsList',
                                'JoinedInsertIndexIntsList'
                            ]

    def default_init(self,
                        _JoiningCollectionStr="",
                        _JoiningCatchStr="",
                        _JoiningAttentionStr="",
                        _JoiningFindBeforeBool=True,
                        _JoinedAttentionCollectionOrderedDict=None,
                        _JoinedCatchCollectionOrderedDict=None,
                        _JoinedCatchDeriveJoinersList=None,
                        _JoinedRetrieveIndexesListGetStrsList=None,
                        _JoinedRetrieveIndexesListColumnStrsList=None,
                        _JoinedInsertIndexIntsList=None,
                        **_KwargVariablesDict
                    ):

        #Call the parent init method
        BaseClass.__init__(self,**_KwargVariablesDict)

    def mimic_model(self):

        #debug
        '''
        self.debug('We join first')
        '''

        #<NotHook>
        #join first
        self.join()
        #</NotHook>

        #debug
        '''
        self.debug('Add in the ModelingDescriptionTuplesList')
        '''

        #set
        if len(self.JoinedRetrieveIndexesListColumnStrsList)>0:
            self.ModelingDescriptionTuplesList=map(
                lambda __JoinedRetrieveIndexesListGetStr,__JoinedRetrieveIndexesListColumnStr:
                (
                    __JoinedRetrieveIndexesListGetStr,
                    __JoinedRetrieveIndexesListColumnStr,
                    tables.Int64Col(shape=2)
                ),
                self.JoinedRetrieveIndexesListGetStrsList,
                self.JoinedRetrieveIndexesListColumnStrsList
            )+self.ModelingDescriptionTuplesList

        #debug
        '''
        self.debug(
                    [   
                        ('self.',self,['ModelingDescriptionTuplesList']),
                        'Now call the parent model method'
                    ]
                )
        '''

        #<NotHook>
        #join and model first
        BaseClass.model(self)
        #</NotHook>

    def mimic_row(self):

        #debug
        '''
        self.debug('Maybe we have to join first')
        '''

        #<NotHook>
        #table and join first
        self.table()
        self.join()
        #</NotHook>

        #debug
        '''
        self.debug(
                    [
                        ("We are going to check if is already inserted in the joined databases..."),
                        ('self.',self,['JoinedCatchDeriveJoinersList'])
                    ]
                )
        '''

        #set
        self.JoinedInsertIndexIntsList=map(
                    lambda __JoinedDeriveDatabaserPointer:
                    __JoinedDeriveDatabaserPointer.row().RowedIndexInt,
                    self.JoinedCatchDeriveJoinersList
                )

        #debug
        '''
        self.debug(('self.',self,[
                                    'JoinedInsertIndexIntsList',
                                    'JoinedRetrieveIndexesListGetStrsList'

                                ]))
        '''

        #set the modeled int in the retrieve tuples
        map(
                lambda __JoinedRetrieveIndexesListGetStr,__JoinedInsertIndexInt:
                getattr(
                    self.NodePointDeriveNoder,
                    __JoinedRetrieveIndexesListGetStr
                    ).__setitem__(
                        1,
                        __JoinedInsertIndexInt
                ),
                self.JoinedRetrieveIndexesListGetStrsList,
                self.JoinedInsertIndexIntsList
            )

        #debug
        '''
        self.debug([
                        ('Before updating the RowingKeyStrsList'),
                        #('self.',self,['NodePointDeriveNoder'])
                        ('model first to set the ModeledGetStrToColumStr')
                    ]
                )
        '''

        #Model first to set the ModeledGetStrToColumStr
        #self.model()

        #Add in the RowingKeyStrsList
        self.RowingKeyStrsList=self.JoinedRetrieveIndexesListGetStrsList+self.RowingKeyStrsList

        #debug
        '''
        self.debug('Now row with Featurer')
        '''

        #<NotHook>
        #row then
        BaseClass.row(self)
        #</NotHook>

        #debug
        '''
        self.debug('Ok row is over for joining')
        '''

    def mimic_insert(self):

        #<NotHook>
        #row first
        self.row()
        #</NotHook>

        #debug
        '''
        self.debug(
                    [
                        'First setSwitch and make insert the catched databases',
                        ('self.',self,[
                                            'JoiningCatchStr',
                                            'JoiningCollectionStr'
                                    ])
                    ]
                )
        '''

        #Insert the post joined databases
        self.JoinedInsertIndexIntsList=map(
            lambda __JoinedCatchDeriveJoinerPointer:
            __JoinedCatchDeriveJoinerPointer.CatchToPointVariable.insert(),
            self.JoinedCatchCollectionOrderedDict.values(),
        )

        #switch first
        self.transmit(
            [
                ('setSwitch',{
                        'LiargVariablesList':[],
                        'KwargVariablesDict':
                        {
                            '_ClassVariable':"Joiner",
                            '_DoStrsList':['Insert']
                        }
                    }
                )
            ],
            [self.JoiningCatchStr+self.JoiningCollectionStr]
        )

        #debug
        '''
        self.debug('Now we can insert here')
        '''

        #<NotHook>
        #insert then
        BaseClass.insert(self)
        #</NotHook>

    def mimic_retrieve(self):

        #debug
        '''
        self.debug(('self.',self,['RetrievingIndexesList']))
        '''

        #<NotHook>
        #retrieve first
        BaseClass.retrieve(self)
        #</NotHook>

        #Retrieve in the joined databases
        self.JoinedInsertIndexIntsList=map(
                    lambda __JoinedRetrieveIndexesListGetStr,__JoinedDeriveDatabaserPointer:
                    __JoinedDeriveDatabaserPointer.retrieve(
                        getattr(
                            self.NodePointDeriveNoder,
                            __JoinedRetrieveIndexesListGetStr
                        )
                    ),
                    self.JoinedRetrieveIndexesListGetStrsList,
                    self.JoinedCatchDeriveJoinersList
                )

    def mimic_find(self):

        #<NotHook>
        #table first
        self.table()
        #</NotHook>

        #debug
        '''
        self.debug(('self.',self,['FindingConditionVariable']))
        '''

        #
        if self.JoiningFindBeforeBool:

            #Find in the joined databases
            JoinedFindFilterRowDictsListsList=map(
                    lambda __JoinedDeriveDatabaserPointer:
                    __JoinedDeriveDatabaserPointer.find().FoundFilterRowDictsList,
                    self.JoinedCatchDeriveJoinersList
                )

            #debug
            '''
            self.debug('JoinedFindFilterRowDictsListsList is '+str(JoinedFindFilterRowDictsListsList))
            '''

            #Just keep the retrieve lists
            JoinedFindFilterRetrieveListsList=map(
                        lambda __JoinedFindFilterRowDictsList:
                        map(
                                lambda __JoinedFindFilterRowDict:
                                [
                                    __JoinedFindFilterRowDict['TabledInt']
                                    if 'TabledInt' in __JoinedFindFilterRowDict else 0,
                                    __JoinedFindFilterRowDict['RowInt']
                                ],
                                __JoinedFindFilterRowDictsList
                            ),
                        JoinedFindFilterRowDictsListsList
            )

            #debug
            '''
            self.debug('JoinedFindFilterRetrieveListsList is '+str(JoinedFindFilterRetrieveListsList))
            '''

            #Map
            JoinedFindingConditionVariable=map(
                    lambda __JoinedRetrieveIndexesListColumnStr,__JoinedFindFilterRetrieveList:
                    (
                        __JoinedRetrieveIndexesListColumnStr,
                        (
                            SYS.getIsInListBool,
                            __JoinedFindFilterRetrieveList
                        )
                    ),
                    self.JoinedRetrieveIndexesListColumnStrsList,
                    JoinedFindFilterRetrieveListsList
                )

            #debug
            '''
            self.debug('JoinedFindingConditionVariable is '+str(JoinedFindingConditionVariable))
            '''

            #Add to the finding condition tuples
            self.FindingConditionVariable+=JoinedFindingConditionVariable

            #Call the parent method
            Featurer.FeaturerClass.find(self)

        else:

            #Call the parent method
            BaseClass.find(self).FoundFilterRowDictsList

    def do_join(    
                self
            ):

        #<NotHook>
        #database first
        self.database()
        #</NotHook>

        #Check
        if self.JoiningCollectionStr=="":
            self.JoiningCollectionStr=self.NetworkCollectionStr
        if self.JoiningCatchStr=="":
            self.JoiningCatchStr=self.NetworkCatchStr
        if self.JoiningAttentionStr=="":
            self.JoiningAttentionStr=self.NetworkAttentionStr

        #debug
        '''
        self.debug(
                    ('self.',self,[
                                    'JoiningCollectionStr',
                                    'JoiningCatchStr',
                                    'JoiningAttentionStr'
                                ])
                )
        '''
        #set
        JoinedAttentionCollectionOrderedSetTagStr=self.JoiningAttentionStr+self.JoiningCollectionStr+"CollectionOrderedDict"

        #check
        if hasattr(
            self,
            JoinedAttentionCollectionOrderedSetTagStr
        ):

            #get
            self.JoinedAttentionCollectionOrderedDict=getattr(
                self,
                JoinedAttentionCollectionOrderedSetTagStr
            )

        #set
        JoinedCatchCollectionOrderedSetTagStr=self.JoiningCatchStr+self.JoiningCollectionStr+"CollectionOrderedDict"

        #check
        if hasattr(self,JoinedCatchCollectionOrderedSetTagStr):

            #get
            self.JoinedCatchCollectionOrderedDict=getattr(
                self,
                JoinedCatchCollectionOrderedSetTagStr
            )

            #model and link all the catched joiners
            self.JoinedCatchDeriveJoinersList=map(
                    lambda __JoinedCatchDeriveJoiner:
                    #__JoinedCatchDeriveJoiner.__setitem__(
                    #   'InsertIsBool',
                    #   False
                    #).CatchToPointVariable.model(
                    #),
                    __JoinedCatchDeriveJoiner.CatchToPointVariable.model(),
                    self.JoinedCatchCollectionOrderedDict.values()
                )

            #debug
            '''
            self.debug(('self.',self,['JoinedCatchCollectionOrderedDict']))
            '''

            #set
            self.JoinedRetrieveIndexesListColumnStrsList=map(
                    lambda __JoinedCatchDeriveJoiner:
                    "Join"+''.join(
                        [
                            __JoinedCatchDeriveJoiner.ModelDeriveControllerVariable.NodeKeyStr
                            if __JoinedCatchDeriveJoiner.ModelDeriveControllerVariable.NodeKeyStr!="" 
                            else 'Top'+__JoinedCatchDeriveJoiner.ModelDeriveControllerVariable.__class__.NameStr,
                            __JoinedCatchDeriveJoiner.ModeledSuffixStr
                        ]
                    )+"RetrieveIndexesList",
                    self.JoinedCatchDeriveJoinersList,
                )

            #debug
            '''
            self.debug(('self.',self,['JoinedRetrieveIndexesListColumnStrsList']))
            '''

            #set
            self.JoinedRetrieveIndexesListGetStrsList=map(
                    lambda __JoinedCatchDeriveJoiner:
                    "Joined"+''.join(
                        [
                            self.ModelDeriveControllerVariable.NodeKeyStr
                            if self.ModelDeriveControllerVariable.NodeKeyStr!="" 
                            else 'Top'+self.ModelDeriveControllerVariable.__class__.NameStr,
                            self.ModeledSuffixStr,
                            'To',
                            __JoinedCatchDeriveJoiner.ModelDeriveControllerVariable.NodeKeyStr
                            if __JoinedCatchDeriveJoiner.ModelDeriveControllerVariable.NodeKeyStr!="" 
                            else 'Top'+__JoinedCatchDeriveJoiner.ModelDeriveControllerVariable.__class__.NameStr,
                            __JoinedCatchDeriveJoiner.ModeledSuffixStr
                        ]
                    )+"RetrieveIndexesList",
                    self.JoinedCatchDeriveJoinersList,
                )

            #debug
            '''
            self.debug(
                        [
                            ('self.',self,['JoinedRetrieveIndexesListGetStrsList']),
                            'Table the joined databases'
                        ]
                    )
            '''

            #Table all the joined databasers and init the corresponding JoinedRetrieveIndexesList in the NodePointDeriveNoder
            self.ModelDeriveControllerVariable.update(
                zip(
                        self.JoinedRetrieveIndexesListGetStrsList,
                        map(
                            lambda __JoinedCatchDeriveJoiner:
                            [
                                __JoinedCatchDeriveJoiner.table()['TabledInt'],
                                -1
                            ],
                            self.JoinedCatchDeriveJoinersList
                        )
                    )
            )

            #debug
            '''
            self.debug(
                        ('self.',self,[
                                        'JoinedRetrieveIndexesListColumnStrsList',
                                        'JoinedRetrieveIndexesListGetStrsList'
                                    ])
            )
            '''
#</DefineClass>

View the Joiner sources on Github

Example

Let's do a hierarchic components join


In [47]:
#ImportModules
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Classors import Classer
from ShareYourSystem.Standards.Noders import Structurer
from ShareYourSystem.Standards.Modelers import Joiner
import operator
import tables
import numpy as np

#Define a Multiplier class
@Classer.ClasserClass()
class MultiplierClass(Structurer.StructurerClass):

    #Definition
    RepresentingKeyStrsList=[
                                    'MultiplyingFirstInt',
                                    'MultiplyingSecondInt'
                                ]
                            
    def default_init(self,
                        _MultiplyingFirstInt=0,
                        _MultiplyingSecondInt=0,
                        **_KwargVariablesDict
                    ):

        #Call the parent init method
        self.__class__.__bases__[0].__init__(self,**_KwargVariablesDict)

        #Set a parameters database
        self.collect(
                        "Datome",
                        "Parameters",
                        Joiner.JoinerClass().update(
                            [
                                (
                                    'Attr_ModelingDescriptionTuplesList',
                                    [
                                        ('MultiplyingFirstInt','MultiplyingFirstInt',tables.Int64Col()),
                                        ('MultiplyingSecondInt','MultiplyingSecondInt',tables.Int64Col())
                                    ]
                                ),
                                ('Attr_RowingKeyStrsList',['MultiplyingFirstInt','MultiplyingSecondInt'])
                            ]
                        )
                )
    
#Define a Modulizer class
@Classer.ClasserClass()
class ModulizerClass(Structurer.StructurerClass):

    #Definition
    RepresentingKeyStrsList=[
                                    'ModulizingPowerFloat',
                                    'ModulizedTotalFloat'
                                ]
                            
    def default_init(self,
                        _ModulizingPowerFloat=1.,
                        _ModulizedTotalFloat=0.,
                        **_KwargVariablesDict
                    ):

        #Call the parent init method
        self.__class__.__bases__[0].__init__(self,**_KwargVariablesDict)

        #Build the output hierarchy
        self.update(
                        [
                            ('<Component>RealMultiplier',MultiplierClass()),
                            ('<Component>ImageMultiplier',MultiplierClass())
                        ]
                    )

        #Set a parameters database
        self.collect(
                    "Datome",
                    "Parameters",
                    Joiner.JoinerClass().update(
                        [
                            (
                                'Attr_ModelingDescriptionTuplesList',
                                [
                                    ('ModulizingPowerFloat','ModulizingPowerFloat',tables.Float64Col())
                                ]
                            ),
                            ('Attr_RowingKeyStrsList',['ModulizingPowerFloat']),
                            ('ConnectingGraspClueVariablesList',
                                [
                                    '/NodePointDeriveNoder/<Component>RealMultiplier/<Datome>ParametersJoiner',
                                    '/NodePointDeriveNoder/<Component>ImageMultiplier/<Datome>ParametersJoiner'
                                ]
                            )
                        ]
                    )
                )


#Definition of a Modulizer instance, structure and network
MyModulizer=ModulizerClass().structure(
    ['Component']
).network(
    **{
        'VisitingCollectionStrsList':['Datome','Component'],
        'RecruitingConcludeConditionVariable':[
            (
                '__class__.__mro__',
                operator.contains,Joiner.JoinerClass
            )
        ]
    }
)

#Update and insert in the results
MyModulizer.__setitem__(
    "Dis_<Component>",
    [
        [
            ('MultiplyingFirstInt',1),
            ('MultiplyingSecondInt',2)
        ],
        [
            ('MultiplyingFirstInt',1),
            ('MultiplyingSecondInt',3)
        ]
    ]
)['<Datome>ParametersJoiner'].insert()

#Update and insert in the results
MyModulizer.__setitem__(
    "Dis_<Component>",
    [
        [
            ('MultiplyingFirstInt',2)
        ],
        [
            ('MultiplyingSecondInt',4)
        ]
    ]
)['<Datome>ParametersJoiner'].insert()


#Definition the AttestedStr
SYS._attest(
    [
        'MyModulizer is '+SYS._str(
        MyModulizer,
        **{
            'RepresentingBaseKeyStrsListBool':False,
            'RepresentingAlineaIsBool':False
        }
        ),
        'hdf5 file is : '+MyModulizer.hdfview().hdfclose().HdformatedConsoleStr
    ]
) 

#Print


                            
                            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                            ////////////////////////////////
                            Attentioner/__init__.py do_attention
                            From Attentioner/__init__.py do_attention | Connecter/__init__.py do_connect | Networker/__init__.py do_network | site-packages/six.py exec_ | Celler/__init__.py do_cell | Notebooker/__init__.py do_notebook | Documenter/__init__.py do_inform | inform.py <module>
                            ////////////////////////////////
                            
                            l.60 : 
                            *****
                            I am with [('NodeKeyStr', 'ParametersJoiner')]
                            *****
                            self.AttentioningCollectionStr is PreConnectome
                            self.GraspingClueVariable is /NodePointDeriveNoder/<Component>RealMultiplier/<Datome>ParametersJoiner
                            
                            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                                                        
                            
                            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                            ////////////////////////////////
                            Attentioner/__init__.py do_attention
                            From Attentioner/__init__.py do_attention | Connecter/__init__.py do_connect | Networker/__init__.py do_network | site-packages/six.py exec_ | Celler/__init__.py do_cell | Notebooker/__init__.py do_notebook | Documenter/__init__.py do_inform | inform.py <module>
                            ////////////////////////////////
                            
                            l.60 : 
                            *****
                            I am with [('NodeKeyStr', 'ParametersJoiner')]
                            *****
                            self.AttentioningCollectionStr is PreConnectome
                            self.GraspingClueVariable is /NodePointDeriveNoder/<Component>ImageMultiplier/<Datome>ParametersJoiner
                            
                            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                                                        


*****Start of the Attest *****

MyModulizer is < (ModulizerClass), 4565351120>
   /{ 
   /  '<New><Instance>ComponentCollectionOrderedDict' : 
   /   /{ 
   /   /  'RealMultiplier' : < (MultiplierClass), 4565349904>
   /   /   /{ 
   /   /   /  '<New><Instance>ComponentCollectionOrderedDict' : 
   /   /   /   /{ 
   /   /   /   /}
   /   /   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /   /   /{ 
   /   /   /   /  'ParametersJoiner' : < (JoinerClass), 4565349328>
   /   /   /   /   /{ 
   /   /   /   /   /  '<New><Instance>ComponentCollectionOrderedDict' : 
   /   /   /   /   /   /{ 
   /   /   /   /   /   /}
   /   /   /   /   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /   /   /   /   /{ 
   /   /   /   /   /   /}
   /   /   /   /   /  '<New><Instance>IdInt' : 4565349328
   /   /   /   /   /  '<New><Instance>NetworkAttentionStr' : Pre
   /   /   /   /   /  '<New><Instance>NetworkCatchStr' : Post
   /   /   /   /   /  '<New><Instance>NetworkCollectionStr' : Connectome
   /   /   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /   /   /  '<New><Instance>NodeKeyStr' : ParametersJoiner
   /   /   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (MultiplierClass), 4565349904>
   /   /   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4566542144>
   /   /   /   /   /  '<New><Instance>PreConnectomeCollectionOrderedDict' : 
   /   /   /   /   /   /{ 
   /   /   /   /   /   /  'ParametersJoiner_RealMultiplier>TopModulizer<ParametersJoinerPointer' : < (PointerClass), 4566560016>
   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566560016
   /   /   /   /   /   /   /  '<New><Instance>CatchToPointVariable' : < (JoinerClass), 4565349072>
   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /  '<New><Instance>ComponentCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4565349072
   /   /   /   /   /   /   /   /  '<New><Instance>NetworkAttentionStr' : Pre
   /   /   /   /   /   /   /   /  '<New><Instance>NetworkCatchStr' : Post
   /   /   /   /   /   /   /   /  '<New><Instance>NetworkCollectionStr' : Connectome
   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /   /   /   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /   /   /   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /   /   /   /   /   /  '<New><Instance>NodeKeyStr' : ParametersJoiner
   /   /   /   /   /   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (ModulizerClass), 4565351120>
   /   /   /   /   /   /   /   /  '<New><Instance>NodePointOrderedDict' : 
   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /  'ParametersJoiner' : {...}< (JoinerClass), 4565349072>
   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /  '<New><Instance>PostConnectomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /  '_NodePointDeriveNoder_<Component>RealMultiplier_<Datome>ParametersJoinerPointer' : < (PointerClass), 4566559824>
   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566559824
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>CatchToPointVariable' : {...}< (JoinerClass), 4565349328>
   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedPathBackVariable' : 
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedGetVariable' : {...}< (JoinerClass), 4565349328>
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedLocalSetStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingGetVariable' : {...}< (JoinerClass), 4565349328>
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingSetPathStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /  '_NodePointDeriveNoder_<Component>ImageMultiplier_<Datome>ParametersJoinerPointer' : < (PointerClass), 4566560144>
   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566560144
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>CatchToPointVariable' : < (JoinerClass), 4566557072>
   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>ComponentCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566557072
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NetworkAttentionStr' : Pre
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NetworkCatchStr' : Post
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NetworkCollectionStr' : Connectome
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeKeyStr' : ParametersJoiner
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodePointDeriveNoder' : < (MultiplierClass), 4565343504>
   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>ComponentCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /   /  'ParametersJoiner' : {...}< (JoinerClass), 4566557072>
   /   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4565343504
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeCollectionStr' : Component
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeIndexInt' : 1
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeKeyStr' : ImageMultiplier
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (ModulizerClass), 4565351120>
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4566543624>
   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>MultiplyingFirstInt' : 1
   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>MultiplyingSecondInt' : 4
   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4566543328>
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>PreConnectomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /  'ParametersJoiner_ImageMultiplier>TopModulizer<ParametersJoinerPointer' : < (PointerClass), 4566560656>
   /   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566560656
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>CatchToPointVariable' : {...}< (JoinerClass), 4565349072>
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedPathBackVariable' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedGetVariable' : {...}< (JoinerClass), 4565349072>
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedLocalSetStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingGetVariable' : {...}< (JoinerClass), 4565349072>
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingSetPathStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /   /   /   /   /   /   /   /   /[
   /   /   /   /   /   /   /   /   /   /   /   /  0 : 
   /   /   /   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /   /   /   /  0 : MultiplyingFirstInt
   /   /   /   /   /   /   /   /   /   /   /   /   /  1 : MultiplyingFirstInt
   /   /   /   /   /   /   /   /   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /   /   /   /  1 : 
   /   /   /   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /   /   /   /  0 : MultiplyingSecondInt
   /   /   /   /   /   /   /   /   /   /   /   /   /  1 : MultiplyingSecondInt
   /   /   /   /   /   /   /   /   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /   /   /   /]
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['MultiplyingFirstInt', 'MultiplyingSecondInt']
   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>JoiningFindBeforeBool' : True
   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>JoinedCatchCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>JoinedCatchDeriveJoinersList' : []
   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>JoinedInsertIndexIntsList' : []
   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>JoinedRetrieveIndexesListColumnStrsList' : []
   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>JoinedRetrieveIndexesListGetStrsList' : []
   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>JoiningAttentionStr' : Pre
   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>JoiningCatchStr' : Post
   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>JoiningCollectionStr' : Connectome
   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedPathBackVariable' : 
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedGetVariable' : {...}< (JoinerClass), 4566557072>
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedLocalSetStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingGetVariable' : {...}< (JoinerClass), 4566557072>
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingSetPathStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /   /   /   /   /   /[
   /   /   /   /   /   /   /   /   /  0 : 
   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /  0 : JoinedTopModulizerParametersJoinerModelToRealMultiplierParametersJoinerModelRetrieveIndexesList
   /   /   /   /   /   /   /   /   /   /  1 : JoinRealMultiplierParametersJoinerModelRetrieveIndexesList
   /   /   /   /   /   /   /   /   /   /  2 : Int64Col(shape=(2,), dflt=0, pos=None)
   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /  1 : 
   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /  0 : JoinedTopModulizerParametersJoinerModelToImageMultiplierParametersJoinerModelRetrieveIndexesList
   /   /   /   /   /   /   /   /   /   /  1 : JoinImageMultiplierParametersJoinerModelRetrieveIndexesList
   /   /   /   /   /   /   /   /   /   /  2 : Int64Col(shape=(2,), dflt=0, pos=None)
   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /  2 : 
   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /  0 : ModulizingPowerFloat
   /   /   /   /   /   /   /   /   /   /  1 : ModulizingPowerFloat
   /   /   /   /   /   /   /   /   /   /  2 : Float64Col(shape=(), dflt=0.0, pos=None)
   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /]
   /   /   /   /   /   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['JoinedTopModulizerParametersJoinerModelToRealMultiplierParametersJoinerModelRetrieveIndexesList', 'JoinedTopModulizerParametersJoinerModelToImageMultiplierParametersJoinerModelRetrieveIndexesList', 'JoinedTopModulizerParametersJoinerModelToRealMultiplierParametersJoinerModelRetrieveIndexesList', 'JoinedTopModulizerParametersJoinerModelToImageMultiplierParametersJoinerModelRetrieveIndexesList', 'JoinedTopModulizerParametersJoinerModelToRealMultiplierParametersJoinerModelRetrieveIndexesList', 'JoinedTopModulizerParametersJoinerModelToImageMultiplierParametersJoinerModelRetrieveIndexesList', 'JoinedTopModulizerParametersJoinerModelToRealMultiplierParametersJoinerModelRetrieveIndexesList', 'JoinedTopModulizerParametersJoinerModelToImageMultiplierParametersJoinerModelRetrieveIndexesList', 'ModulizingPowerFloat']
   /   /   /   /   /   /   /   /  '<Spe><Class>JoiningFindBeforeBool' : True
   /   /   /   /   /   /   /   /  '<Spe><Instance>JoinedCatchCollectionOrderedDict' : {...}< (OrderedDict), 4566590112>
   /   /   /   /   /   /   /   /  '<Spe><Instance>JoinedCatchDeriveJoinersList' : 
   /   /   /   /   /   /   /   /   /[
   /   /   /   /   /   /   /   /   /  0 : {...}< (JoinerClass), 4565349328>
   /   /   /   /   /   /   /   /   /  1 : {...}< (JoinerClass), 4566557072>
   /   /   /   /   /   /   /   /   /]
   /   /   /   /   /   /   /   /  '<Spe><Instance>JoinedInsertIndexIntsList' : [1, 1]
   /   /   /   /   /   /   /   /  '<Spe><Instance>JoinedRetrieveIndexesListColumnStrsList' : ['JoinRealMultiplierParametersJoinerModelRetrieveIndexesList', 'JoinImageMultiplierParametersJoinerModelRetrieveIndexesList']
   /   /   /   /   /   /   /   /  '<Spe><Instance>JoinedRetrieveIndexesListGetStrsList' : ['JoinedTopModulizerParametersJoinerModelToRealMultiplierParametersJoinerModelRetrieveIndexesList', 'JoinedTopModulizerParametersJoinerModelToImageMultiplierParametersJoinerModelRetrieveIndexesList']
   /   /   /   /   /   /   /   /  '<Spe><Instance>JoiningAttentionStr' : Pre
   /   /   /   /   /   /   /   /  '<Spe><Instance>JoiningCatchStr' : Post
   /   /   /   /   /   /   /   /  '<Spe><Instance>JoiningCollectionStr' : Connectome
   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /  '<Spe><Class>PointedBackSetStr' : 
   /   /   /   /   /   /   /  '<Spe><Class>PointedPathBackVariable' : 
   /   /   /   /   /   /   /  '<Spe><Instance>PointedGetVariable' : {...}< (JoinerClass), 4565349072>
   /   /   /   /   /   /   /  '<Spe><Instance>PointedLocalSetStr' : CatchToPointVariable
   /   /   /   /   /   /   /  '<Spe><Instance>PointingBackSetStr' : 
   /   /   /   /   /   /   /  '<Spe><Instance>PointingGetVariable' : {...}< (JoinerClass), 4565349072>
   /   /   /   /   /   /   /  '<Spe><Instance>PointingSetPathStr' : CatchToPointVariable
   /   /   /   /   /   /   /}
   /   /   /   /   /   /}
   /   /   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /   /   /[
   /   /   /   /   /   /  0 : 
   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /  0 : MultiplyingFirstInt
   /   /   /   /   /   /   /  1 : MultiplyingFirstInt
   /   /   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /   /   /)
   /   /   /   /   /   /  1 : 
   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /  0 : MultiplyingSecondInt
   /   /   /   /   /   /   /  1 : MultiplyingSecondInt
   /   /   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /   /   /)
   /   /   /   /   /   /]
   /   /   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['MultiplyingFirstInt', 'MultiplyingSecondInt']
   /   /   /   /   /  '<Spe><Class>JoiningFindBeforeBool' : True
   /   /   /   /   /  '<Spe><Instance>JoinedCatchCollectionOrderedDict' : 
   /   /   /   /   /   /{ 
   /   /   /   /   /   /}
   /   /   /   /   /  '<Spe><Instance>JoinedCatchDeriveJoinersList' : []
   /   /   /   /   /  '<Spe><Instance>JoinedInsertIndexIntsList' : []
   /   /   /   /   /  '<Spe><Instance>JoinedRetrieveIndexesListColumnStrsList' : []
   /   /   /   /   /  '<Spe><Instance>JoinedRetrieveIndexesListGetStrsList' : []
   /   /   /   /   /  '<Spe><Instance>JoiningAttentionStr' : Pre
   /   /   /   /   /  '<Spe><Instance>JoiningCatchStr' : Post
   /   /   /   /   /  '<Spe><Instance>JoiningCollectionStr' : Connectome
   /   /   /   /   /}
   /   /   /   /}
   /   /   /  '<New><Instance>IdInt' : 4565349904
   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /  '<New><Instance>NodeCollectionStr' : Component
   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /  '<New><Instance>NodeKeyStr' : RealMultiplier
   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (ModulizerClass), 4565351120>
   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4566543624>
   /   /   /  '<Spe><Instance>MultiplyingFirstInt' : 2
   /   /   /  '<Spe><Instance>MultiplyingSecondInt' : 2
   /   /   /}
   /   /  'ImageMultiplier' : {...}< (MultiplierClass), 4565343504>
   /   /}
   /  '<New><Instance>DatomeCollectionOrderedDict' : {...}< (OrderedDict), 4566589816>
   /  '<New><Instance>IdInt' : 4565351120
   /  '<New><Instance>JoinedTopModulizerParametersJoinerModelToImageMultiplierParametersJoinerModelRetrieveIndexesList' : [0, 1]
   /  '<New><Instance>JoinedTopModulizerParametersJoinerModelToRealMultiplierParametersJoinerModelRetrieveIndexesList' : [0, 1]
   /  '<New><Instance>NewtorkAttentionStr' : 
   /  '<New><Instance>NewtorkCatchStr' : 
   /  '<New><Instance>NewtorkCollectionStr' : 
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopModulizer
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<Spe><Class>ModulizedTotalFloat' : 0.0
   /  '<Spe><Class>ModulizingPowerFloat' : 1.0
   /}

------

hdf5 file is : /                        Group
/TopModulizer            Group
/TopModulizer/ImageMultiplier Group
/TopModulizer/ImageMultiplier/xx0xxParametersJoinerTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MultiplyingFirstInt=1, MultiplyingSecondInt=3},
        (1) {RowInt=1, MultiplyingFirstInt=1, MultiplyingSecondInt=4}
/TopModulizer/RealMultiplier Group
/TopModulizer/RealMultiplier/xx0xxParametersJoinerTable Dataset {2/Inf}
    Data:
        (0) {RowInt=0, MultiplyingFirstInt=1, MultiplyingSecondInt=2},
        (1) {RowInt=1, MultiplyingFirstInt=2, MultiplyingSecondInt=2}
/xx0xxParametersJoinerTable Dataset {2/Inf}
    Data:
        (0) {JoinImageMultiplierParametersJoinerModelRetrieveIndexesList=[0,
        (0)  0], JoinRealMultiplierParametersJoinerModelRetrieveIndexesList=[0,
        (0)  0], RowInt=0, ModulizingPowerFloat=1},
        (1) {JoinImageMultiplierParametersJoinerModelRetrieveIndexesList=[0,
        (1)  1], JoinRealMultiplierParametersJoinerModelRetrieveIndexesList=[0,
        (1)  1], RowInt=1, ModulizingPowerFloat=1}


*****End of the Attest *****


Hierarchizer

Doc


A Hierarchizer is a Joiner that taking care of the order of the joining connections between derived Joiners, whatever is the level of their setting in the hierarchy of their parent derived Storers.


View the Hierarchizer notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Hierarchizer.ipynb)

Code



# -*- coding: utf-8 -*-
"""


<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>


A Hierarchizer is a Joiner that taking care of the 
order of the joining connections between derived Joiners,
whatever is the level of their setting in the hierarchy of 
their parent derived Storers.

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Modelers.Joiner"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
import collections
import tables
from ShareYourSystem.Standards.Noders import Noder
Joiner=BaseModule
#</ImportSpecificModules>

#<DefineClass>
@DecorationClass(**{
    'ClassingSwitchMethodStrsList':[
        'model',
        'tabular',
        'join',
        'insert'
    ]
})
class HierarchizerClass(BaseClass):

    #Definition
    RepresentingKeyStrsList=[
                            ]

    #@Hooker.HookerClass(**{'HookingAfterVariablesList':[{'CallingVariable':BaseClass.__init__}]})
    def default_init(self,
                        **_KwargVariablesDict
                    ):

        #Call the parent init method
        BaseClass.__init__(self,**_KwargVariablesDict)

    def mimic_insert(self):

        #debug
        '''
        self.debug( 
                    [
                        'we setSwitch first and insert',
                        ('self.',self,[
                                        'JoiningAttentionStr',
                                        'JoiningCollectionStr'
                                    ])
                    ]
                )
        '''

        #<NotHook>
        #insert then
        BaseClass.insert(self)
        #</NotHook>

        #debug
        '''
        self.debug('we hierarchize now, self.hierarchize is '+str(self.hierarchize))
        '''

        #call
        self.hierarchize()

        #switch first
        self.transmit(
            [
                ('setSwitch',{
                                'LiargVariablesList':[],
                                'KwargVariablesDict':
                                {
                                    '_ClassVariable':'Hierarchizer',
                                    '_DoStrsList':['Insert']
                                }
                            })
            ],
            [self.JoiningAttentionStr+self.JoiningCollectionStr],
            #Self is not switched (if not it is circular !)
            #False
        )

    def do_hierarchize(self):

        #debug
        '''
        self.debug(
                    [
                        'insert then in the joined attention databasers',
                        ('self.',self,['JoinedAttentionCollectionOrderedDict'])
                    ]
                )
        '''

        #map
        map(
                lambda __JoinedAttentionCollectionDeriveJoinerPointer:
                __JoinedAttentionCollectionDeriveJoinerPointer.CatchToPointVariable.insert(),
                self.JoinedAttentionCollectionOrderedDict.values()
            )


#</DefineClass>

View the Hierarchizer sources on Github

Example

Let's do all at the same time : Results-Parameters join and hierarchic joins.


In [51]:
#ImportModules
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Classors import Classer
from ShareYourSystem.Standards.Noders import Structurer
from ShareYourSystem.Standards.Modelers import Hierarchizer
import operator
import tables
import numpy as np

#Define a Sumer class
@Classer.ClasserClass()
class SumerClass(Structurer.StructurerClass):

    #Definition
    RepresentingKeyStrsList=[
                                    'SumingFirstInt',
                                    'SumingSecondInt',
                                    'SumedTotalInt'
                                ]
                            
    def default_init(self,
                        _SumingFirstInt=0,
                        _SumingSecondInt=0,
                        _SumedTotalInt=0,
                        **_KwargVariablesDict
                    ):

        #Call the parent init method
        self.__class__.__bases__[0].__init__(self,**_KwargVariablesDict)

        #Set a parameters database
        self.collect(
                "Datome",
                "Parameters",
                Hierarchizer.HierarchizerClass().update(
                    [
                        (
                            'Attr_ModelingDescriptionTuplesList',
                            [
                                ('SumingFirstInt','SumingFirstInt',tables.Int64Col()),
                                ('SumingSecondInt','SumingSecondInt',tables.Int64Col())
                            ]
                        ),
                        ('Attr_RowingKeyStrsList',['SumingFirstInt','SumingSecondInt'])
                    ]
                )
            )

        #Set a results database
        self.collect(
            "Datome",
            "Results",
            Hierarchizer.HierarchizerClass().update(
                [
                    (
                        'Attr_ModelingDescriptionTuplesList',
                        [
                            ('SumedTotalInt','SumedTotalInt',tables.Int64Col())
                        ]
                    ),
                    ('ConnectingGraspClueVariablesList',
                        [
                            '/NodePointDeriveNoder/<Datome>ParametersHierarchizer'
                        ]
                    ),
                    ('TagStr','Networked')
                ]
            )
        )
    
    def do_sum(self):
    
        #debug
        '''
        self.debug(('self.',self,['SumingFirstInt','SumingSecondInt']))
        '''

        #set the SumedTotalInt
        self.SumedTotalInt=self.SumingFirstInt+self.SumingSecondInt

#Define a Factorizer class
@Classer.ClasserClass()
class FactorizerClass(Structurer.StructurerClass):

    #Definition
    RepresentingKeyStrsList=[
                                'FactorizingPowerFloat',
                                'FactorizedTotalFloat'
                            ]
                            
    def default_init(self,
                        _FactorizingPowerFloat=1.,
                        _FactorizedTotalFloat=0.,
                        **_KwargVariablesDict
                    ):

        #Call the parent init method
        self.__class__.__bases__[0].__init__(self,**_KwargVariablesDict)

        #Build the output hierarchy
        self.update(
                        [
                            ('<Component>XSumer',SumerClass()),
                            ('<Component>YSumer',SumerClass())
                        ]
                    )

        #Set a parameters database
        self.collect(
                    "Datome",
                    "Parameters",
                    Hierarchizer.HierarchizerClass().update(
                        [
                            (
                                'Attr_ModelingDescriptionTuplesList',
                                [
                                    ('FactorizingPowerFloat','FactorizingPowerFloat',tables.Float64Col())
                                ]
                            ),
                            ('Attr_RowingKeyStrsList',['FactorizingPowerFloat']),
                            ('ConnectingGraspClueVariablesList',
                                [
                                    '/NodePointDeriveNoder/<Component>XSumer/<Datome>ParametersHierarchizer',
                                    '/NodePointDeriveNoder/<Component>YSumer/<Datome>ParametersHierarchizer'
                                ]
                            )
                        ]
                    )
                )

        #Set a results database
        self.collect(
            "Datome",
            "Results",
            Hierarchizer.HierarchizerClass().update(
                [
                    (
                        'Attr_ModelingDescriptionTuplesList',
                        [
                            ('FactorizedTotalFloat','FactorizedTotalFloat',tables.Float64Col())
                        ]
                    ),
                    ('ConnectingGraspClueVariablesList',
                        [
                            '/NodePointDeriveNoder/<Datome>ParametersHierarchizer'
                        ]
                    ),
                    ('TagStr','Networked')
                ]
            )
        )

    def do_factorize(self):

        #debug
        self.debug('We factorize here')

        #set the FactorizedTotalFloat
        self.FactorizedTotalFloat=np.power(
            sum(
                map(
                    lambda __DeriveSumer:
                    __DeriveSumer.SumedTotalInt,
                    self['<Component>']
                )
            ),
            self.FactorizingPowerFloat
        )

#Definition of a Factorizer instance, structure and network
MyFactorizer=FactorizerClass().structure(
    ['Component']
).network(
    **{
        'VisitingCollectionStrsList':['Datome','Component'],
        'RecruitingConcludeConditionVariable':[
            (
                '__class__.__mro__',
                operator.contains,Hierarchizer.HierarchizerClass
            )
        ]
    }
)

#Update transmit the do method and insert in the results
MyFactorizer.__setitem__(
    "Dis_<Component>",
    [
        [
            ('SumingFirstInt',1),
            ('SumingSecondInt',2)
        ],
        [
            ('SumingFirstInt',1),
            ('SumingSecondInt',3)
        ]
    ]
).walk(
    {
        'AfterUpdateList':[
            ('callDo',{'LiargVariablesList':[]})
        ],
        'GatherVariablesList':['<Component>']
    }
)['<Datome>ResultsHierarchizer'].insert()

#Update and insert in the results
MyFactorizer.__setitem__(
    "Dis_<Component>",
    [
        [
            ('SumingFirstInt',2)
        ],
        [
            ('SumingSecondInt',4)
        ]
    ]
).walk(
    {
        'AfterUpdateList':[
            ('callDo',{'LiargVariablesList':[]})
        ],
        'GatherVariablesList':['<Component>']
    }
)['<Datome>ResultsHierarchizer'].insert()

#Definition the AttestedStr
SYS._attest(
    [
        'MyFactorizer is '+SYS._str(
        MyFactorizer,
        **{
            'RepresentingBaseKeyStrsListBool':False,
            'RepresentingAlineaIsBool':False
        }
        ),
        'hdf5 file is : '+MyFactorizer.hdfview().hdfclose().HdformatedConsoleStr
    ]
) 

#Print


                            
                            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                            ////////////////////////////////
                            Attentioner/__init__.py do_attention
                            From Attentioner/__init__.py do_attention | Connecter/__init__.py do_connect | Networker/__init__.py do_network | site-packages/six.py exec_ | Celler/__init__.py do_cell | Notebooker/__init__.py do_notebook | Documenter/__init__.py do_inform | inform.py <module>
                            ////////////////////////////////
                            
                            l.60 : 
                            *****
                            I am with [('NodeKeyStr', 'ParametersHierarchizer')]
                            *****
                            self.AttentioningCollectionStr is PreConnectome
                            self.GraspingClueVariable is /NodePointDeriveNoder/<Component>XSumer/<Datome>ParametersHierarchizer
                            
                            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                                                        
                            
                            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                            ////////////////////////////////
                            Attentioner/__init__.py do_attention
                            From Attentioner/__init__.py do_attention | Connecter/__init__.py do_connect | Networker/__init__.py do_network | site-packages/six.py exec_ | Celler/__init__.py do_cell | Notebooker/__init__.py do_notebook | Documenter/__init__.py do_inform | inform.py <module>
                            ////////////////////////////////
                            
                            l.60 : 
                            *****
                            I am with [('NodeKeyStr', 'ParametersHierarchizer')]
                            *****
                            self.AttentioningCollectionStr is PreConnectome
                            self.GraspingClueVariable is /NodePointDeriveNoder/<Component>YSumer/<Datome>ParametersHierarchizer
                            
                            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                                                        
                            
                            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                            ////////////////////////////////
                            Attentioner/__init__.py do_attention
                            From Attentioner/__init__.py do_attention | Connecter/__init__.py do_connect | Networker/__init__.py do_network | site-packages/six.py exec_ | Celler/__init__.py do_cell | Notebooker/__init__.py do_notebook | Documenter/__init__.py do_inform | inform.py <module>
                            ////////////////////////////////
                            
                            l.60 : 
                            *****
                            I am with [('NodeKeyStr', 'ResultsHierarchizer')]
                            *****
                            self.AttentioningCollectionStr is PreConnectome
                            self.GraspingClueVariable is /NodePointDeriveNoder/<Datome>ParametersHierarchizer
                            
                            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                                                        
                            
                            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                            ////////////////////////////////
                            Attentioner/__init__.py do_attention
                            From Attentioner/__init__.py do_attention | Connecter/__init__.py do_connect | Networker/__init__.py do_network | site-packages/six.py exec_ | Celler/__init__.py do_cell | Notebooker/__init__.py do_notebook | Documenter/__init__.py do_inform | inform.py <module>
                            ////////////////////////////////
                            
                            l.60 : 
                            *****
                            I am with [('NodeKeyStr', 'ResultsHierarchizer')]
                            *****
                            self.AttentioningCollectionStr is PreConnectome
                            self.GraspingClueVariable is /NodePointDeriveNoder/<Datome>ParametersHierarchizer
                            
                            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                                                        
                            
                            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                            ////////////////////////////////
                            Attentioner/__init__.py do_attention
                            From Attentioner/__init__.py do_attention | Connecter/__init__.py do_connect | Networker/__init__.py do_network | site-packages/six.py exec_ | Celler/__init__.py do_cell | Notebooker/__init__.py do_notebook | Documenter/__init__.py do_inform | inform.py <module>
                            ////////////////////////////////
                            
                            l.60 : 
                            *****
                            I am with [('NodeKeyStr', 'ResultsHierarchizer')]
                            *****
                            self.AttentioningCollectionStr is PreConnectome
                            self.GraspingClueVariable is /NodePointDeriveNoder/<Datome>ParametersHierarchizer
                            
                            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                                                        
                                                                    
                                                                    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                                                                    ////////////////////////////////
                                                                    Doer/__init__.py callDo
                                                                    From Doer/__init__.py callDo | Applyier/__init__.py do_apply | Applyier/__init__.py mimic_set | Mimicker/__init__.py mimic | Noder/__init__.py mimic_set | Mimicker/__init__.py mimic | Distinguisher/__init__.py mimic_set | Mimicker/__init__.py mimic | Setter/__init__.py __setitem__ | Applyier/__init__.py do_apply | Mapper/__init__.py do_map | Updater/__init__.py do_update | Walker/__init__.py do_walk | site-packages/six.py exec_ | Celler/__init__.py do_cell | Notebooker/__init__.py do_notebook | Documenter/__init__.py do_inform | inform.py <module>
                                                                    ////////////////////////////////
                                                                    
                                                                    l.49 : 
                                                                    *****
                                                                    I am with [('NodeKeyStr', 'TopFactorizer')]
                                                                    *****
                                                                    We factorize here
                                                                    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                                                                                                                                        
                                                                    
                                                                    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                                                                    ////////////////////////////////
                                                                    Doer/__init__.py callDo
                                                                    From Doer/__init__.py callDo | Applyier/__init__.py do_apply | Applyier/__init__.py mimic_set | Mimicker/__init__.py mimic | Noder/__init__.py mimic_set | Mimicker/__init__.py mimic | Distinguisher/__init__.py mimic_set | Mimicker/__init__.py mimic | Setter/__init__.py __setitem__ | Applyier/__init__.py do_apply | Mapper/__init__.py do_map | Updater/__init__.py do_update | Walker/__init__.py do_walk | site-packages/six.py exec_ | Celler/__init__.py do_cell | Notebooker/__init__.py do_notebook | Documenter/__init__.py do_inform | inform.py <module>
                                                                    ////////////////////////////////
                                                                    
                                                                    l.49 : 
                                                                    *****
                                                                    I am with [('NodeKeyStr', 'TopFactorizer')]
                                                                    *****
                                                                    We factorize here
                                                                    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                                                                                                                                        


*****Start of the Attest *****

MyFactorizer is < (FactorizerClass), 4565342992>
   /{ 
   /  '<New><Instance>ComponentCollectionOrderedDict' : 
   /   /{ 
   /   /  'XSumer' : < (SumerClass), 4565341968>
   /   /   /{ 
   /   /   /  '<New><Instance>ComponentCollectionOrderedDict' : 
   /   /   /   /{ 
   /   /   /   /}
   /   /   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /   /   /{ 
   /   /   /   /  'ParametersHierarchizer' : < (HierarchizerClass), 4566558672>
   /   /   /   /   /{ 
   /   /   /   /   /  '<New><Instance>ComponentCollectionOrderedDict' : 
   /   /   /   /   /   /{ 
   /   /   /   /   /   /}
   /   /   /   /   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /   /   /   /   /{ 
   /   /   /   /   /   /}
   /   /   /   /   /  '<New><Instance>IdInt' : 4566558672
   /   /   /   /   /  '<New><Instance>NetworkAttentionStr' : Pre
   /   /   /   /   /  '<New><Instance>NetworkCatchStr' : Post
   /   /   /   /   /  '<New><Instance>NetworkCollectionStr' : Connectome
   /   /   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /   /   /  '<New><Instance>NodeKeyStr' : ParametersHierarchizer
   /   /   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (SumerClass), 4565341968>
   /   /   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4566145128>
   /   /   /   /   /  '<New><Instance>PreConnectomeCollectionOrderedDict' : 
   /   /   /   /   /   /{ 
   /   /   /   /   /   /  'ParametersHierarchizer_XSumer>TopFactorizer<ParametersHierarchizerPointer' : < (PointerClass), 4566103376>
   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566103376
   /   /   /   /   /   /   /  '<New><Instance>CatchToPointVariable' : < (HierarchizerClass), 4566559952>
   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /  '<New><Instance>ComponentCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566559952
   /   /   /   /   /   /   /   /  '<New><Instance>NetworkAttentionStr' : Pre
   /   /   /   /   /   /   /   /  '<New><Instance>NetworkCatchStr' : Post
   /   /   /   /   /   /   /   /  '<New><Instance>NetworkCollectionStr' : Connectome
   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /   /   /   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /   /   /   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /   /   /   /   /   /  '<New><Instance>NodeKeyStr' : ParametersHierarchizer
   /   /   /   /   /   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (FactorizerClass), 4565342992>
   /   /   /   /   /   /   /   /  '<New><Instance>NodePointOrderedDict' : 
   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /  'ParametersHierarchizer' : {...}< (HierarchizerClass), 4566559952>
   /   /   /   /   /   /   /   /   /  'ResultsHierarchizer' : < (HierarchizerClass), 4566103760>
   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>ComponentCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566103760
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NetworkAttentionStr' : Pre
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NetworkCatchStr' : Post
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NetworkCollectionStr' : Connectome
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeIndexInt' : 1
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeKeyStr' : ResultsHierarchizer
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (FactorizerClass), 4565342992>
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4566063504>
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>PostConnectomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /  '_NodePointDeriveNoder_<Datome>ParametersHierarchizerPointer' : < (PointerClass), 4566105424>
   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566105424
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>CatchToPointVariable' : {...}< (HierarchizerClass), 4566559952>
   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedPathBackVariable' : 
   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedGetVariable' : {...}< (HierarchizerClass), 4566559952>
   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedLocalSetStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingGetVariable' : {...}< (HierarchizerClass), 4566559952>
   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingSetPathStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>TagStr' : Networked
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /   /   /   /   /   /   /   /[
   /   /   /   /   /   /   /   /   /   /   /  0 : 
   /   /   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /   /   /  0 : JoinedTopFactorizerResultsHierarchizerModelToTopFactorizerParametersHierarchizerModelRetrieveIndexesList
   /   /   /   /   /   /   /   /   /   /   /   /  1 : JoinTopFactorizerParametersHierarchizerModelRetrieveIndexesList
   /   /   /   /   /   /   /   /   /   /   /   /  2 : Int64Col(shape=(2,), dflt=0, pos=None)
   /   /   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /   /   /  1 : 
   /   /   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /   /   /  0 : FactorizedTotalFloat
   /   /   /   /   /   /   /   /   /   /   /   /  1 : FactorizedTotalFloat
   /   /   /   /   /   /   /   /   /   /   /   /  2 : Float64Col(shape=(), dflt=0.0, pos=None)
   /   /   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /   /   /]
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['JoinedTopFactorizerResultsHierarchizerModelToTopFactorizerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerResultsHierarchizerModelToTopFactorizerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerResultsHierarchizerModelToTopFactorizerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerResultsHierarchizerModelToTopFactorizerParametersHierarchizerModelRetrieveIndexesList']
   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /  '<New><Instance>PostConnectomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /  '_NodePointDeriveNoder_<Component>XSumer_<Datome>ParametersHierarchizerPointer' : < (PointerClass), 4566778640>
   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566778640
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>CatchToPointVariable' : {...}< (HierarchizerClass), 4566558672>
   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedPathBackVariable' : 
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedGetVariable' : {...}< (HierarchizerClass), 4566558672>
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedLocalSetStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingGetVariable' : {...}< (HierarchizerClass), 4566558672>
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingSetPathStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /  '_NodePointDeriveNoder_<Component>YSumer_<Datome>ParametersHierarchizerPointer' : < (PointerClass), 4566781712>
   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566781712
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>CatchToPointVariable' : < (HierarchizerClass), 4566779088>
   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>ComponentCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566779088
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NetworkAttentionStr' : Pre
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NetworkCatchStr' : Post
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NetworkCollectionStr' : Connectome
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeKeyStr' : ParametersHierarchizer
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodePointDeriveNoder' : < (SumerClass), 4566779280>
   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>ComponentCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /   /  'ParametersHierarchizer' : {...}< (HierarchizerClass), 4566779088>
   /   /   /   /   /   /   /   /   /   /   /   /   /  'ResultsHierarchizer' : < (HierarchizerClass), 4566102480>
   /   /   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>ComponentCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566102480
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NetworkAttentionStr' : Pre
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NetworkCatchStr' : Post
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NetworkCollectionStr' : Connectome
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeIndexInt' : 1
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeKeyStr' : ResultsHierarchizer
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (SumerClass), 4566779280>
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4566061432>
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>PostConnectomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '_NodePointDeriveNoder_<Datome>ParametersHierarchizerPointer' : < (PointerClass), 4566104848>
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566104848
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>CatchToPointVariable' : {...}< (HierarchizerClass), 4566779088>
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedPathBackVariable' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedGetVariable' : {...}< (HierarchizerClass), 4566779088>
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedLocalSetStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingGetVariable' : {...}< (HierarchizerClass), 4566779088>
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingSetPathStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>TagStr' : Networked
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /[
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  0 : 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  0 : JoinedYSumerResultsHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  1 : JoinYSumerParametersHierarchizerModelRetrieveIndexesList
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  2 : Int64Col(shape=(2,), dflt=0, pos=None)
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  1 : 
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  0 : SumedTotalInt
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  1 : SumedTotalInt
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /   /   /   /   /   /   /]
   /   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['JoinedYSumerResultsHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedYSumerResultsHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedYSumerResultsHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedYSumerResultsHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList']
   /   /   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566779280
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>JoinedYSumerResultsHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList' : [0, 1]
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeCollectionStr' : Component
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeIndexInt' : 1
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodeKeyStr' : YSumer
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (FactorizerClass), 4565342992>
   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4566062616>
   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>SumedTotalInt' : 5
   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>SumingFirstInt' : 1
   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>SumingSecondInt' : 4
   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4566061432>
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>PreConnectomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /  'ParametersHierarchizer_YSumer>TopFactorizer<ParametersHierarchizerPointer' : < (PointerClass), 4566103312>
   /   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566103312
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>CatchToPointVariable' : {...}< (HierarchizerClass), 4566559952>
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedPathBackVariable' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedGetVariable' : {...}< (HierarchizerClass), 4566559952>
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedLocalSetStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingGetVariable' : {...}< (HierarchizerClass), 4566559952>
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingSetPathStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /   /  'ParametersHierarchizer_YSumer>TopFactorizer<YSumer_ResultsHierarchizerPointer' : < (PointerClass), 4565897296>
   /   /   /   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4565897296
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>CatchToPointVariable' : {...}< (HierarchizerClass), 4566102480>
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedPathBackVariable' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedGetVariable' : {...}< (HierarchizerClass), 4566102480>
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedLocalSetStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingGetVariable' : {...}< (HierarchizerClass), 4566102480>
   /   /   /   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingSetPathStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /   /   /   /   /   /   /   /   /[
   /   /   /   /   /   /   /   /   /   /   /   /  0 : 
   /   /   /   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /   /   /   /  0 : SumingFirstInt
   /   /   /   /   /   /   /   /   /   /   /   /   /  1 : SumingFirstInt
   /   /   /   /   /   /   /   /   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /   /   /   /  1 : 
   /   /   /   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /   /   /   /  0 : SumingSecondInt
   /   /   /   /   /   /   /   /   /   /   /   /   /  1 : SumingSecondInt
   /   /   /   /   /   /   /   /   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /   /   /   /]
   /   /   /   /   /   /   /   /   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['SumingFirstInt', 'SumingSecondInt']
   /   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedPathBackVariable' : 
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedGetVariable' : {...}< (HierarchizerClass), 4566779088>
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedLocalSetStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingGetVariable' : {...}< (HierarchizerClass), 4566779088>
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingSetPathStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /  '<New><Instance>PreConnectomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /  'ParametersHierarchizer>TopFactorizer<ResultsHierarchizerPointer' : < (PointerClass), 4566105808>
   /   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566105808
   /   /   /   /   /   /   /   /   /   /  '<New><Instance>CatchToPointVariable' : {...}< (HierarchizerClass), 4566103760>
   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /  '<Spe><Class>PointedPathBackVariable' : 
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedGetVariable' : {...}< (HierarchizerClass), 4566103760>
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointedLocalSetStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingBackSetStr' : 
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingGetVariable' : {...}< (HierarchizerClass), 4566103760>
   /   /   /   /   /   /   /   /   /   /  '<Spe><Instance>PointingSetPathStr' : CatchToPointVariable
   /   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /   /   /   /   /   /[
   /   /   /   /   /   /   /   /   /  0 : 
   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /  0 : JoinedTopFactorizerParametersHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList
   /   /   /   /   /   /   /   /   /   /  1 : JoinXSumerParametersHierarchizerModelRetrieveIndexesList
   /   /   /   /   /   /   /   /   /   /  2 : Int64Col(shape=(2,), dflt=0, pos=None)
   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /  1 : 
   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /  0 : JoinedTopFactorizerParametersHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList
   /   /   /   /   /   /   /   /   /   /  1 : JoinYSumerParametersHierarchizerModelRetrieveIndexesList
   /   /   /   /   /   /   /   /   /   /  2 : Int64Col(shape=(2,), dflt=0, pos=None)
   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /  2 : 
   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /  0 : FactorizingPowerFloat
   /   /   /   /   /   /   /   /   /   /  1 : FactorizingPowerFloat
   /   /   /   /   /   /   /   /   /   /  2 : Float64Col(shape=(), dflt=0.0, pos=None)
   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /]
   /   /   /   /   /   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['JoinedTopFactorizerParametersHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerParametersHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerParametersHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerParametersHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerParametersHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerParametersHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerParametersHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerParametersHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerParametersHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerParametersHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerParametersHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerParametersHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerParametersHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerParametersHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerParametersHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedTopFactorizerParametersHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList', 'FactorizingPowerFloat']
   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /  '<Spe><Class>PointedBackSetStr' : 
   /   /   /   /   /   /   /  '<Spe><Class>PointedPathBackVariable' : 
   /   /   /   /   /   /   /  '<Spe><Instance>PointedGetVariable' : {...}< (HierarchizerClass), 4566559952>
   /   /   /   /   /   /   /  '<Spe><Instance>PointedLocalSetStr' : CatchToPointVariable
   /   /   /   /   /   /   /  '<Spe><Instance>PointingBackSetStr' : 
   /   /   /   /   /   /   /  '<Spe><Instance>PointingGetVariable' : {...}< (HierarchizerClass), 4566559952>
   /   /   /   /   /   /   /  '<Spe><Instance>PointingSetPathStr' : CatchToPointVariable
   /   /   /   /   /   /   /}
   /   /   /   /   /   /  'ParametersHierarchizer_XSumer>TopFactorizer<XSumer_ResultsHierarchizerPointer' : < (PointerClass), 4565897552>
   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4565897552
   /   /   /   /   /   /   /  '<New><Instance>CatchToPointVariable' : < (HierarchizerClass), 4566560464>
   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /  '<New><Instance>ComponentCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /  '<New><Instance>DatomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /  '<New><Instance>IdInt' : 4566560464
   /   /   /   /   /   /   /   /  '<New><Instance>NetworkAttentionStr' : Pre
   /   /   /   /   /   /   /   /  '<New><Instance>NetworkCatchStr' : Post
   /   /   /   /   /   /   /   /  '<New><Instance>NetworkCollectionStr' : Connectome
   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /   /   /   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /   /   /   /   /   /  '<New><Instance>NodeCollectionStr' : Datome
   /   /   /   /   /   /   /   /  '<New><Instance>NodeIndexInt' : 1
   /   /   /   /   /   /   /   /  '<New><Instance>NodeKeyStr' : ResultsHierarchizer
   /   /   /   /   /   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (SumerClass), 4565341968>
   /   /   /   /   /   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4566145128>
   /   /   /   /   /   /   /   /  '<New><Instance>PostConnectomeCollectionOrderedDict' : 
   /   /   /   /   /   /   /   /   /{ 
   /   /   /   /   /   /   /   /   /  '_NodePointDeriveNoder_<Datome>ParametersHierarchizerPointer' : < (PointerClass), 4566106000>{...}< (dict), 4566094464>
   /   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /   /  '<New><Instance>TagStr' : Networked
   /   /   /   /   /   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /   /   /   /   /   /[
   /   /   /   /   /   /   /   /   /  0 : 
   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /  0 : JoinedXSumerResultsHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList
   /   /   /   /   /   /   /   /   /   /  1 : JoinXSumerParametersHierarchizerModelRetrieveIndexesList
   /   /   /   /   /   /   /   /   /   /  2 : Int64Col(shape=(2,), dflt=0, pos=None)
   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /  1 : 
   /   /   /   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /   /   /   /  0 : SumedTotalInt
   /   /   /   /   /   /   /   /   /   /  1 : SumedTotalInt
   /   /   /   /   /   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /   /   /   /   /   /)
   /   /   /   /   /   /   /   /   /]
   /   /   /   /   /   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['JoinedXSumerResultsHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedXSumerResultsHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedXSumerResultsHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList', 'JoinedXSumerResultsHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList']
   /   /   /   /   /   /   /   /}
   /   /   /   /   /   /   /  '<Spe><Class>PointedBackSetStr' : 
   /   /   /   /   /   /   /  '<Spe><Class>PointedPathBackVariable' : 
   /   /   /   /   /   /   /  '<Spe><Instance>PointedGetVariable' : {...}< (HierarchizerClass), 4566560464>
   /   /   /   /   /   /   /  '<Spe><Instance>PointedLocalSetStr' : CatchToPointVariable
   /   /   /   /   /   /   /  '<Spe><Instance>PointingBackSetStr' : 
   /   /   /   /   /   /   /  '<Spe><Instance>PointingGetVariable' : {...}< (HierarchizerClass), 4566560464>
   /   /   /   /   /   /   /  '<Spe><Instance>PointingSetPathStr' : CatchToPointVariable
   /   /   /   /   /   /   /}
   /   /   /   /   /   /}
   /   /   /   /   /  '<New><Instance>_ModelingDescriptionTuplesList' : 
   /   /   /   /   /   /[
   /   /   /   /   /   /  0 : 
   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /  0 : SumingFirstInt
   /   /   /   /   /   /   /  1 : SumingFirstInt
   /   /   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /   /   /)
   /   /   /   /   /   /  1 : 
   /   /   /   /   /   /   /(
   /   /   /   /   /   /   /  0 : SumingSecondInt
   /   /   /   /   /   /   /  1 : SumingSecondInt
   /   /   /   /   /   /   /  2 : Int64Col(shape=(), dflt=0, pos=None)
   /   /   /   /   /   /   /)
   /   /   /   /   /   /]
   /   /   /   /   /  '<New><Instance>_RowingKeyStrsList' : ['SumingFirstInt', 'SumingSecondInt']
   /   /   /   /   /}
   /   /   /   /  'ResultsHierarchizer' : {...}< (HierarchizerClass), 4566560464>
   /   /   /   /}
   /   /   /  '<New><Instance>IdInt' : 4565341968
   /   /   /  '<New><Instance>JoinedXSumerResultsHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList' : [0, 1]
   /   /   /  '<New><Instance>NewtorkAttentionStr' : 
   /   /   /  '<New><Instance>NewtorkCatchStr' : 
   /   /   /  '<New><Instance>NewtorkCollectionStr' : 
   /   /   /  '<New><Instance>NodeCollectionStr' : Component
   /   /   /  '<New><Instance>NodeIndexInt' : 0
   /   /   /  '<New><Instance>NodeKeyStr' : XSumer
   /   /   /  '<New><Instance>NodePointDeriveNoder' : {...}< (FactorizerClass), 4565342992>
   /   /   /  '<New><Instance>NodePointOrderedDict' : {...}< (OrderedDict), 4566062616>
   /   /   /  '<Spe><Instance>SumedTotalInt' : 4
   /   /   /  '<Spe><Instance>SumingFirstInt' : 2
   /   /   /  '<Spe><Instance>SumingSecondInt' : 2
   /   /   /}
   /   /  'YSumer' : {...}< (SumerClass), 4566779280>
   /   /}
   /  '<New><Instance>DatomeCollectionOrderedDict' : {...}< (OrderedDict), 4566063504>
   /  '<New><Instance>IdInt' : 4565342992
   /  '<New><Instance>JoinedTopFactorizerParametersHierarchizerModelToXSumerParametersHierarchizerModelRetrieveIndexesList' : [0, 1]
   /  '<New><Instance>JoinedTopFactorizerParametersHierarchizerModelToYSumerParametersHierarchizerModelRetrieveIndexesList' : [0, 1]
   /  '<New><Instance>JoinedTopFactorizerResultsHierarchizerModelToTopFactorizerParametersHierarchizerModelRetrieveIndexesList' : [0, 1]
   /  '<New><Instance>NewtorkAttentionStr' : 
   /  '<New><Instance>NewtorkCatchStr' : 
   /  '<New><Instance>NewtorkCollectionStr' : 
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopFactorizer
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<Spe><Class>FactorizingPowerFloat' : 1.0
   /  '<Spe><Instance>FactorizedTotalFloat' : 9.0
   /}

------

hdf5 file is : /                        Group
/TopFactorizer           Group
/TopFactorizer/XSumer    Group
/TopFactorizer/XSumer/xx0xxParametersHierarchizerTable Dataset {3/Inf}
    Data:
        (0) {RowInt=0, SumingFirstInt=1, SumingSecondInt=2},
        (1) {RowInt=1, SumingFirstInt=2, SumingSecondInt=2},
        (2) {RowInt=2, SumingFirstInt=1, SumingSecondInt=4}
/TopFactorizer/XSumer/xx0xxResultsHierarchizerTable Dataset {3/Inf}
    Data:
        (0) {JoinXSumerParametersHierarchizerModelRetrieveIndexesList=[0,0], 
        (0)  RowInt=0, SumedTotalInt=3},
        (1) {JoinXSumerParametersHierarchizerModelRetrieveIndexesList=[0,1], 
        (1)  RowInt=1, SumedTotalInt=4},
        (2) {JoinXSumerParametersHierarchizerModelRetrieveIndexesList=[0,2], 
        (2)  RowInt=2, SumedTotalInt=5}
/TopFactorizer/YSumer    Group
/TopFactorizer/YSumer/xx0xxParametersHierarchizerTable Dataset {4/Inf}
    Data:
        (0) {RowInt=0, SumingFirstInt=1, SumingSecondInt=3},
        (1) {RowInt=1, SumingFirstInt=1, SumingSecondInt=4},
        (2) {RowInt=2, SumingFirstInt=0, SumingSecondInt=0},
        (3) {RowInt=3, SumingFirstInt=0, SumingSecondInt=3}
/TopFactorizer/YSumer/xx0xxResultsHierarchizerTable Dataset {4/Inf}
    Data:
        (0) {JoinYSumerParametersHierarchizerModelRetrieveIndexesList=[0,0], 
        (0)  RowInt=0, SumedTotalInt=4},
        (1) {JoinYSumerParametersHierarchizerModelRetrieveIndexesList=[0,1], 
        (1)  RowInt=1, SumedTotalInt=5},
        (2) {JoinYSumerParametersHierarchizerModelRetrieveIndexesList=[0,2], 
        (2)  RowInt=2, SumedTotalInt=0},
        (3) {JoinYSumerParametersHierarchizerModelRetrieveIndexesList=[0,3], 
        (3)  RowInt=3, SumedTotalInt=3}
/xx0xxParametersHierarchizerTable Dataset {7/Inf}
    Data:
        (0) {FactorizingPowerFloat=1, 
        (0)  JoinXSumerParametersHierarchizerModelRetrieveIndexesList=[0,0], 
        (0)  JoinYSumerParametersHierarchizerModelRetrieveIndexesList=[0,0], 
        (0)  RowInt=0},
        (1) {FactorizingPowerFloat=1, 
        (1)  JoinXSumerParametersHierarchizerModelRetrieveIndexesList=[0,1], 
        (1)  JoinYSumerParametersHierarchizerModelRetrieveIndexesList=[0,1], 
        (1)  RowInt=1},
        (2) {FactorizingPowerFloat=1, 
        (2)  JoinXSumerParametersHierarchizerModelRetrieveIndexesList=[0,0], 
        (2)  JoinYSumerParametersHierarchizerModelRetrieveIndexesList=[0,2], 
        (2)  RowInt=2},
        (3) {FactorizingPowerFloat=1, 
        (3)  JoinXSumerParametersHierarchizerModelRetrieveIndexesList=[0,2], 
        (3)  JoinYSumerParametersHierarchizerModelRetrieveIndexesList=[0,2], 
        (3)  RowInt=3},
        (4) {FactorizingPowerFloat=1, 
        (4)  JoinXSumerParametersHierarchizerModelRetrieveIndexesList=[0,2], 
        (4)  JoinYSumerParametersHierarchizerModelRetrieveIndexesList=[0,3], 
        (4)  RowInt=4},
        (5) {FactorizingPowerFloat=1, 
        (5)  JoinXSumerParametersHierarchizerModelRetrieveIndexesList=[0,2], 
        (5)  JoinYSumerParametersHierarchizerModelRetrieveIndexesList=[0,0], 
        (5)  RowInt=5},
        (6) {FactorizingPowerFloat=2, 
        (6)  JoinXSumerParametersHierarchizerModelRetrieveIndexesList=[0,2], 
        (6)  JoinYSumerParametersHierarchizerModelRetrieveIndexesList=[0,0], 
        (6)  RowInt=6}
/xx0xxResultsHierarchizerTable Dataset {7/Inf}
    Data:
        (0) {FactorizedTotalFloat=7, 
        (0)  JoinTopFactorizerParametersHierarchizerModelRetrieveIndexesList=[0,
        (0)  0], RowInt=0},
        (1) {FactorizedTotalFloat=9, 
        (1)  JoinTopFactorizerParametersHierarchizerModelRetrieveIndexesList=[0,
        (1)  1], RowInt=1},
        (2) {FactorizedTotalFloat=0, 
        (2)  JoinTopFactorizerParametersHierarchizerModelRetrieveIndexesList=[0,
        (2)  2], RowInt=2},
        (3) {FactorizedTotalFloat=0, 
        (3)  JoinTopFactorizerParametersHierarchizerModelRetrieveIndexesList=[0,
        (3)  3], RowInt=3},
        (4) {FactorizedTotalFloat=0, 
        (4)  JoinTopFactorizerParametersHierarchizerModelRetrieveIndexesList=[0,
        (4)  4], RowInt=4},
        (5) {FactorizedTotalFloat=0, 
        (5)  JoinTopFactorizerParametersHierarchizerModelRetrieveIndexesList=[0,
        (5)  5], RowInt=5},
        (6) {FactorizedTotalFloat=81, 
        (6)  JoinTopFactorizerParametersHierarchizerModelRetrieveIndexesList=[0,
        (6)  6], RowInt=6}


*****End of the Attest *****


Featurer

Doc


Featurer instances helps for defining Databaser where all the rowed variables are identifying items.


View the Featurer notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Featurer.ipynb)

Code



# -*- coding: utf-8 -*-
"""


<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>


Featurer instances helps for defining Databaser where all 
the rowed variables are identifying items. 

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Modelers.Hierarchizer"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
from ShareYourSystem.Standards.Modelers import Rower
#</ImportSpecificModules>


#<DefineClass>
@DecorationClass()
class FeaturerClass(
                    BaseClass
                ):

    #Definition
    RepresentingKeyStrsList=[
                                    'FeaturingAllBool',
                                    'FeaturedJoinDatabasersList'
                                ]

    def default_init(self,
                        _FeaturingAllBool=False,
                        _FeaturingJoinInsertBool=True,  
                        _FeaturedJoinDatabasersList=None,
                        **_KwargVariablesDict
                    ):

        #Call the parent init method
        BaseClass.__init__(self,**_KwargVariablesDict)

    def mimic_model(self):

        #<NotHook>
        #feature first
        self.feature()
        #</NotHook>

        #<NotHook>
        #model then
        BaseClass.model(self)
        #</NotHook>

        #<NotHook>
        #Return self
        #return self
        #</NotHook>


    def mimic_row(self):

        #debug
        '''
        self.debug(('self.',self,self.__class__.DoingAttributeVariablesOrderedDict.keys()))
        '''

        #Put all the GettingStrsList in the identifying container
        if self.FeaturingAllBool:

            #debug
            '''
            self.debug('Set the RowingKeyStrsList with all the ModelingGetStrs')
            '''

            #set 
            self['Attr_RowingKeyStrsList']=SYS.unzip(
                                                    self.ModelingDescriptionTuplesList,
                                                    [0]
                                                )

            #debug
            '''
            self.debug(('self.',self,['RowingKeyStrsList','ModelingDescriptionTuplesList']))
            '''

        #<NotHook>
        #row then
        BaseClass.row(self)
        #</NotHook>

        #<NotHook>
        #Return self
        #return self
        #</NotHook>

    def mimic_insert(self):

        #<NotHook>
        #feature first
        self.feature()
        #</NotHook>

        #debug
        '''
        self.debug(('self.',self,['FeaturingJoinInsertBool']))
        '''

        #Check
        if len(self.FeaturedJoinDatabasersList)>0 and self.FeaturingJoinInsertBool:

            #debug
            '''
            self.debug('insert in the joined featured databasers')
            '''

            #set
            self.FeaturingJoinInsertBool=False

            #map
            map(
                    lambda __FeaturedDatabaser:
                    __FeaturedDatabaser.insert(),
                    self.FeaturedJoinDatabasersList
                )

            #set
            self.FeaturingJoinInsertBool=True

            #Return
            return

        else:

            #debug
            self.debug('insert now here')

            #insert directly
            BaseClass.insert(self)

    def do_feature(self):

        #Check
        if self.NodePointDeriveNoder!=None:

            #map
            self.FeaturedJoinDatabasersList=SYS.filterNone(
                map(
                    lambda __NodedDatabaser:
                    __NodedDatabaser if hasattr(
                        __NodedDatabaser,'JoiningDownGetKeyStrsList')
                    and __NodedDatabaser.JoiningDownGetKeyStrsList !=None and 
                    self.NodedDatabaseKeyStr in __NodedDatabaser.JoiningDownGetKeyStrsList
                    else None,
                    self.ModeledDeriveDatabasersOrderedDict.values()
                )
            )

        #debug
        '''
        self.debug(('self.',self,['FeaturedJoinDatabasersList']))
        '''

#</DefineClass>

View the Featurer sources on Github

Example

Let's create an empty class, which will automatically receive special attributes from the decorating ClassorClass, specially the NameStr, that should be the ClassStr without the TypeStr in the end.


In [55]:
#ImportModules
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Classors import Classer
from ShareYourSystem.Functers import Triggerer
from ShareYourSystem.Standards.Noders import Structurer
from ShareYourSystem.Standards.Modelers import Featurer,Joiner
import tables
import operator

MyFeaturer=Featurer.FeaturerClass()

#Definition the AttestedStr
SYS._attest(
    [
        'MyFeaturer is '+SYS._str(
        MyFeaturer,
        **{
            'RepresentingBaseKeyStrsListBool':False,
            'RepresentingAlineaIsBool':False
        }
        ),
        'hdf5 file is : '+MyFeaturer.hdfview().hdfclose().HdformatedConsoleStr
    ]
) 

#Print



*****Start of the Attest *****

MyFeaturer is < (FeaturerClass), 4565260816>
   /{ 
   /  '<New><Instance>IdInt' : 4565260816
   /  '<New><Instance>NewtorkAttentionStr' : 
   /  '<New><Instance>NewtorkCatchStr' : 
   /  '<New><Instance>NewtorkCollectionStr' : 
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopFeaturer
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<Spe><Class>FeaturedJoinDatabasersList' : None
   /  '<Spe><Class>FeaturingAllBool' : False
   /}

------

hdf5 file is : 

*****End of the Attest *****


Recuperater

Doc


Recuperater instances


View the Recuperater notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Recuperater.ipynb)

Code



# -*- coding: utf-8 -*-
"""


<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>


Recuperater instances

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Modelers.Joiner"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
#</ImportSpecificModules>


#<DefineClass>
@DecorationClass()
class RecuperaterClass(BaseClass):

    #Definition
    RepresentingKeyStrsList=[
                                    'RecuperatingRetrieveList'
                                ]

    #@Hooker.HookerClass(**{'HookingAfterVariablesList':[{'CallingVariable':BaseClass.__init__}]})
    def default_init(self,
                        _RecuperatingRetrieveList=None,
                        **_KwargVariablesDict
                    ):

        #Call the parent init method
        BaseClass.__init__(self,**_KwargVariablesDict)

    def do_recuperate(self):

        #retrieve
        self.retrieve(self.RecuperatingRetrieveList)

        #debug
        self.debug(('self',self,['RetrievedPickOrderedDict']))


#</DefineClass>

View the Recuperater sources on Github

Example

Let's create an empty class, which will automatically receive special attributes from the decorating ClassorClass, specially the NameStr, that should be the ClassStr without the TypeStr in the end.


In [59]:
#ImportModules
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Classors import Classer
from ShareYourSystem.Functers import Triggerer
from ShareYourSystem.Standards.Noders import Structurer
from ShareYourSystem.Standards.Modelers import Featurer,Recuperater
import tables
import operator

MyRecuperater=Recuperater.RecuperaterClass()

#Definition the AttestedStr
SYS._attest(
    [
        'MyRecuperater is '+SYS._str(
        MyRecuperater,
        **{
            'RepresentingBaseKeyStrsListBool':False,
            'RepresentingAlineaIsBool':False
        }
        ),
        'hdf5 file is : '+MyRecuperater.hdfview().hdfclose().HdformatedConsoleStr
    ]
) 

#Print



*****Start of the Attest *****

MyRecuperater is < (RecuperaterClass), 4566044624>
   /{ 
   /  '<New><Instance>IdInt' : 4566044624
   /  '<New><Instance>NewtorkAttentionStr' : 
   /  '<New><Instance>NewtorkCatchStr' : 
   /  '<New><Instance>NewtorkCollectionStr' : 
   /  '<New><Instance>NodeCollectionStr' : Globals
   /  '<New><Instance>NodeIndexInt' : -1
   /  '<New><Instance>NodeKeyStr' : TopRecuperater
   /  '<New><Instance>NodePointDeriveNoder' : None
   /  '<New><Instance>NodePointOrderedDict' : None
   /  '<Spe><Class>RecuperatingRetrieveList' : None
   /}

------

hdf5 file is : 

*****End of the Attest *****