当前位置: 首页>>代码示例>>Python>>正文


Python ShareYourSystem.mapSet方法代码示例

本文整理汇总了Python中ShareYourSystem.mapSet方法的典型用法代码示例。如果您正苦于以下问题:Python ShareYourSystem.mapSet方法的具体用法?Python ShareYourSystem.mapSet怎么用?Python ShareYourSystem.mapSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ShareYourSystem的用法示例。


在下文中一共展示了ShareYourSystem.mapSet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1:

# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import mapSet [as 别名]
			[
				#GetStr #ColumnStr #Col
				('MyStr','MyStr',SYS.tables.StringCol(10)),
				('MyIntsList','MyIntsList',SYS.tables.Int64Col(shape=3))
			]	
		}
	).model(
	)

#Build a structure with a database
SYS.mapSet(
		MyModeler.ModeledHdfTable,
		[
			('row.__setitem__',{'#liarg':('MyStr',"hello")}),
			('row.append',{'#liarg':None}),
			('row.__setitem__',{'#liarg':('MyStr',"bonjour")}),
			('row.__setitem__',{'#liarg':('MyIntsList',[4,5,6])}),
			('row.append',{'#liarg':None}),
			('flush',{'#liarg':None})
		]
)

#Definition the AttestedStr
print('MyModeler is ')
SYS._print(MyModeler)

#view
print('hdf5 file is : \n'+SYS._str(MyModeler.hdfview()))

#close
MyModeler.file(_ModeStr='c')
开发者ID:BinWang20140601,项目名称:ShareYourSystem,代码行数:33,代码来源:05_ExampleDoc.py

示例2:

# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import mapSet [as 别名]
				'MyStr',
				'MyIntsList'
			]
		}
	).model(
	)

#Build a structure with a database
SYS.mapSet(
		MyModeler.ModeledHdfTable,
		[
			('row.__setitem__',{'#liarg':('MyStr',"hello")}),
			('row.append',{'#liarg':None}),
			('row.__setitem__',{'#liarg':('MyStr',"bonjour")}),
			('row.__setitem__',{'#liarg':('MyIntsList',[1])}),
			('row.append',{'#liarg':None}),
			#('row.__setitem__',{'#liarg':('MyStr',"bonjour")}), 
			#('row.__setitem__',{'#liarg':('MyIntsList',[1,3])}), 
			#THIS would bring an error because list has to be size=1
			#('row.append',{'#liarg':None}),
			('flush',{'#liarg':None})
		]
)

#Definition the AttestedStr
print('MyModeler is ')
SYS._print(MyModeler)

#view
print('hdf5 file is : \n'+SYS._str(MyModeler.hdfview()))
开发者ID:BinWang20140601,项目名称:ShareYourSystem,代码行数:32,代码来源:03_ExampleDoc.py

示例3:

# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import mapSet [as 别名]
#ImportModules
import ShareYourSystem as SYS

#Definition 
MyModeler=SYS.ModelerClass(
		**{
			'FolderingPathVariable':SYS.Modeler.LocalFolderPathStr,
			'PymongoingDatabaseStr':"Thing"
		}
	).model(
	)

#Build a structure with a database
SYS.mapSet(
		MyModeler.ModeledMongoCollection,
		[
			('remove',{}),
			('insert',{'MyStr':"hello"})
		]
)

#print
print('mongo db is : \n'+SYS._str(MyModeler.pymongoview()))

#print
print('MyModeler is ')
SYS._print(MyModeler)

#kill
MyModeler.process(_ActionStr='kill')
开发者ID:BinWang20140601,项目名称:ShareYourSystem,代码行数:32,代码来源:01_ExampleDoc.py

示例4:

# 需要导入模块: import ShareYourSystem [as 别名]
# 或者: from ShareYourSystem import mapSet [as 别名]
                # GetStr #ColumnStr #Col
                ("MyInt", "MyInt", SYS.tables.Int64Col()),
                ("MyFloatsList", "MyFloatsList", (SYS.tables.Float64Col, ["UnitsInt"])),
            ],
        }
    )
    .model()
)

# Build a structure with a database
SYS.mapSet(
    MyModeler.ModeledHdfTable,
    [
        ("row.__setitem__", {"#liarg": ("MyInt", 0)}),
        ("row.append", {"#liarg": None}),
        ("row.__setitem__", {"#liarg": ("MyInt", 2)}),
        ("row.__setitem__", {"#liarg": ("MyFloatsList", [0.0, 1.0, 2.0])}),
        ("row.append", {"#liarg": None}),
        ("flush", {"#liarg": None}),
    ],
)

# Definition
MyModeler.setDone(SYS.ModelerClass).setSwitch().mapSet(
    {
        "UnitsInt": 2,
        "ModelingDescriptionTuplesList": [
            # GetStr #ColumnStr #Col
            ("MyInt", "MyInt", SYS.tables.Int64Col()),
            ("MyFloatsList", "MyFloatsList", (SYS.tables.Float64Col, ["UnitsInt"])),
        ],
开发者ID:BinWang20140601,项目名称:ShareYourSystem,代码行数:33,代码来源:07_ExampleDoc.py


注:本文中的ShareYourSystem.mapSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。