本文整理汇总了Python中pyon.util.containers.DotDict.platform_site3_id方法的典型用法代码示例。如果您正苦于以下问题:Python DotDict.platform_site3_id方法的具体用法?Python DotDict.platform_site3_id怎么用?Python DotDict.platform_site3_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyon.util.containers.DotDict
的用法示例。
在下文中一共展示了DotDict.platform_site3_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _make_associations
# 需要导入模块: from pyon.util.containers import DotDict [as 别名]
# 或者: from pyon.util.containers.DotDict import platform_site3_id [as 别名]
def _make_associations(self):
"""
create one of each resource and association used by OMS
to guard against problems in ion-definitions
"""
#raise unittest.SkipTest("https://jira.oceanobservatories.org/tasks/browse/CISWCORE-41")
"""
the tree we're creating (observatory, sites, platforms, instruments)
rows are lettered, colums numbered.
- first row is implied a
- first column is implied 1
- site Z, just because
O--Sz
|
S--S2--P3--I4
|
Sb-Pb2-Ib3
|
P--I2 <- PlatformDevice, InstrumentDevice2
|
Pb <- PlatformDevice b
|
I <- InstrumentDevice
"""
org_id = self.OMS.create_marine_facility(any_old(RT.Org))
def create_under_org(resource_type, extra_fields=None):
obj = any_old(resource_type, extra_fields)
if RT.InstrumentDevice == resource_type:
resource_id = self.IMS.create_instrument_device(obj)
else:
resource_id, _ = self.RR.create(obj)
self.OMS.assign_resource_to_observatory_org(resource_id=resource_id, org_id=org_id)
return resource_id
#stuff we control
observatory_id = create_under_org(RT.Observatory)
subsite_id = create_under_org(RT.Subsite)
subsite2_id = create_under_org(RT.Subsite)
subsiteb_id = create_under_org(RT.Subsite)
subsitez_id = create_under_org(RT.Subsite)
platform_site_id = create_under_org(RT.PlatformSite)
platform_siteb_id = create_under_org(RT.PlatformSite)
platform_siteb2_id = create_under_org(RT.PlatformSite)
platform_site3_id = create_under_org(RT.PlatformSite)
instrument_site_id = create_under_org(RT.InstrumentSite)
instrument_site2_id = create_under_org(RT.InstrumentSite)
instrument_siteb3_id = create_under_org(RT.InstrumentSite)
instrument_site4_id = create_under_org(RT.InstrumentSite)
#stuff we associate to
instrument_device_id = create_under_org(RT.InstrumentDevice)
instrument_device2_id = create_under_org(RT.InstrumentDevice)
platform_device_id = create_under_org(RT.PlatformDevice)
platform_deviceb_id = create_under_org(RT.PlatformDevice)
instrument_model_id, _ = self.RR.create(any_old(RT.InstrumentModel))
platform_model_id, _ = self.RR.create(any_old(RT.PlatformModel))
deployment_id, _ = self.RR.create(any_old(RT.Deployment))
#observatory
self.RR.create_association(observatory_id, PRED.hasSite, subsite_id)
self.RR.create_association(observatory_id, PRED.hasSite, subsitez_id)
#site
self.RR.create_association(subsite_id, PRED.hasSite, subsite2_id)
self.RR.create_association(subsite_id, PRED.hasSite, subsiteb_id)
self.RR.create_association(subsite2_id, PRED.hasSite, platform_site3_id)
self.RR.create_association(subsiteb_id, PRED.hasSite, platform_siteb2_id)
self.RR.create_association(subsiteb_id, PRED.hasSite, platform_site_id)
#platform_site(s)
self.RR.create_association(platform_site3_id, PRED.hasSite, instrument_site4_id)
self.RR.create_association(platform_siteb2_id, PRED.hasSite, instrument_siteb3_id)
self.RR.create_association(platform_site_id, PRED.hasSite, instrument_site2_id)
self.RR.create_association(platform_site_id, PRED.hasSite, platform_siteb_id)
self.RR.create_association(platform_siteb_id, PRED.hasSite, instrument_site_id)
self.RR.create_association(platform_siteb_id, PRED.hasDevice, platform_deviceb_id)
#test network parent link
self.OMS.assign_device_to_network_parent(platform_device_id, platform_deviceb_id)
self.RR.create_association(platform_site_id, PRED.hasModel, platform_model_id)
self.RR.create_association(platform_site_id, PRED.hasDevice, platform_device_id)
self.RR.create_association(platform_site_id, PRED.hasDeployment, deployment_id)
#instrument_site(s)
self.RR.create_association(instrument_site_id, PRED.hasModel, instrument_model_id)
self.RR.create_association(instrument_site_id, PRED.hasDevice, instrument_device_id)
self.RR.create_association(instrument_site_id, PRED.hasDeployment, deployment_id)
self.RR.create_association(instrument_site2_id, PRED.hasDevice, instrument_device2_id)
#.........这里部分代码省略.........
示例2: _make_associations
# 需要导入模块: from pyon.util.containers import DotDict [as 别名]
# 或者: from pyon.util.containers.DotDict import platform_site3_id [as 别名]
def _make_associations(self):
"""
create one of each resource and association used by OMS
to guard against problems in ion-definitions
"""
#raise unittest.SkipTest("https://jira.oceanobservatories.org/tasks/browse/CISWCORE-41")
"""
the tree we're creating (observatory, sites, platforms, instruments)
rows are lettered, colums numbered.
- first row is implied a
- first column is implied 1
- site Z, just because
O--Sz
|
S--S2--P3--I4
|
Sb-Pb2-Ib3
|
P--I2
|
Pb
|
I
"""
#stuff we control
observatory_id, _ = self.RR.create(any_old(RT.Observatory))
subsite_id, _ = self.RR.create(any_old(RT.Subsite))
subsite2_id, _ = self.RR.create(any_old(RT.Subsite))
subsiteb_id, _ = self.RR.create(any_old(RT.Subsite))
subsitez_id, _ = self.RR.create(any_old(RT.Subsite))
platform_site_id, _ = self.RR.create(any_old(RT.PlatformSite))
platform_siteb_id, _ = self.RR.create(any_old(RT.PlatformSite))
platform_siteb2_id, _ = self.RR.create(any_old(RT.PlatformSite))
platform_site3_id, _ = self.RR.create(any_old(RT.PlatformSite))
instrument_site_id, _ = self.RR.create(any_old(RT.InstrumentSite))
instrument_site2_id, _ = self.RR.create(any_old(RT.InstrumentSite))
instrument_siteb3_id, _ = self.RR.create(any_old(RT.InstrumentSite))
instrument_site4_id, _ = self.RR.create(any_old(RT.InstrumentSite))
#stuff we associate to
instrument_model_id, _ = self.RR.create(any_old(RT.InstrumentModel))
instrument_device_id, _ = self.RR.create(any_old(RT.InstrumentDevice))
platform_model_id, _ = self.RR.create(any_old(RT.PlatformModel))
platform_device_id, _ = self.RR.create(any_old(RT.PlatformDevice))
deployment_id, _ = self.RR.create(any_old(RT.Deployment))
#observatory
self.RR.create_association(observatory_id, PRED.hasSite, subsite_id)
self.RR.create_association(observatory_id, PRED.hasSite, subsitez_id)
#site
self.RR.create_association(subsite_id, PRED.hasSite, subsite2_id)
self.RR.create_association(subsite_id, PRED.hasSite, subsiteb_id)
self.RR.create_association(subsite2_id, PRED.hasSite, platform_site3_id)
self.RR.create_association(subsiteb_id, PRED.hasSite, platform_siteb2_id)
self.RR.create_association(subsiteb_id, PRED.hasSite, platform_site_id)
#platform_site
self.RR.create_association(platform_site3_id, PRED.hasSite, instrument_site4_id)
self.RR.create_association(platform_siteb2_id, PRED.hasSite, instrument_siteb3_id)
self.RR.create_association(platform_site_id, PRED.hasSite, instrument_site2_id)
self.RR.create_association(platform_site_id, PRED.hasSite, platform_siteb_id)
self.RR.create_association(platform_siteb_id, PRED.hasSite, instrument_site_id)
self.RR.create_association(platform_site_id, PRED.hasModel, platform_model_id)
self.RR.create_association(platform_site_id, PRED.hasDevice, platform_device_id)
self.RR.create_association(platform_site_id, PRED.hasDeployment, deployment_id)
#instrument_site
self.RR.create_association(instrument_site_id, PRED.hasModel, instrument_model_id)
self.RR.create_association(instrument_site_id, PRED.hasDevice, instrument_device_id)
self.RR.create_association(instrument_site_id, PRED.hasDeployment, deployment_id)
ret = DotDict()
ret.observatory_id = observatory_id
ret.subsite_id = subsite_id
ret.subsite2_id = subsite2_id
ret.subsiteb_id = subsiteb_id
ret.subsitez_id = subsitez_id
ret.platform_site_id = platform_site_id
ret.platform_siteb_id = platform_siteb_id
ret.platform_siteb2_id = platform_siteb2_id
ret.platform_site3_id = platform_site3_id
ret.instrument_site_id = instrument_site_id
ret.instrument_site2_id = instrument_site2_id
ret.instrument_siteb3_id = instrument_siteb3_id
ret.instrument_site4_id = instrument_site4_id
return ret
开发者ID:pombredanne,项目名称:coi-services,代码行数:100,代码来源:test_observatory_management_service_integration.py