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


Python ParameterDictionary.load方法代码示例

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


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

示例1: validate_stream_defs

# 需要导入模块: from ion.services.dm.utility.granule_utils import ParameterDictionary [as 别名]
# 或者: from ion.services.dm.utility.granule_utils.ParameterDictionary import load [as 别名]
    def validate_stream_defs(self, in_stream_definition_id, out_stream_definition_id):
        stream_def_in = self.read_stream_definition(in_stream_definition_id)
        stream_def_out = self.read_stream_definition(out_stream_definition_id)
        
        if not stream_def_in.available_fields:
            log.info("no available fields on input stream definition")
            return False
        
        incoming_pdict_dump = stream_def_in.parameter_dictionary
        outgoing_pdict_dump = stream_def_out.parameter_dictionary

        incoming_pdict = ParameterDictionary.load(incoming_pdict_dump)
        outgoing_pdict = ParameterDictionary.load(outgoing_pdict_dump)

        incoming_ctxt = [pc for name,(n,pc) in incoming_pdict.iteritems()]
        outgoing_ctxt = [pc for name,(n,pc) in outgoing_pdict.iteritems()]
        
        incoming_ctxt_af = [pc for name,(n,pc) in incoming_pdict.iteritems() if name in stream_def_in.available_fields]
        
        pfv = ParameterFunctionValidator(incoming_ctxt_af, incoming_ctxt, outgoing_ctxt)
        try:
            for name in stream_def_out.available_fields:
                pfv.validate(name)
        except ParameterFunctionException, e:
            log.info('validation failed %s to %s is not reachable' % (stream_def_in.available_fields,stream_def_out.available_fields))
            log.info(e)
            return False
开发者ID:Bobfrat,项目名称:coi-services,代码行数:29,代码来源:pubsub_management_service.py

示例2: _create_coverage

# 需要导入模块: from ion.services.dm.utility.granule_utils import ParameterDictionary [as 别名]
# 或者: from ion.services.dm.utility.granule_utils.ParameterDictionary import load [as 别名]
 def _create_coverage(self, dataset_id, description, parameter_dict, spatial_domain,temporal_domain):
     pdict = ParameterDictionary.load(parameter_dict)
     sdom = GridDomain.load(spatial_domain)
     tdom = GridDomain.load(temporal_domain)
     file_root = FileSystem.get_url(FS.CACHE,'datasets')
     scov = SimplexCoverage(file_root,dataset_id,description or dataset_id,parameter_dictionary=pdict, temporal_domain=tdom, spatial_domain=sdom, inline_data_writes=self.inline_data_writes)
     return scov
开发者ID:blazetopher,项目名称:coi-services,代码行数:9,代码来源:dataset_management_service.py

示例3: _create_coverage

# 需要导入模块: from ion.services.dm.utility.granule_utils import ParameterDictionary [as 别名]
# 或者: from ion.services.dm.utility.granule_utils.ParameterDictionary import load [as 别名]
 def _create_coverage(self, dataset_id, description, parameter_dict):
     #file_root = FileSystem.get_url(FS.CACHE,'datasets')
     temporal_domain, spatial_domain = time_series_domain()
     pdict = ParameterDictionary.load(parameter_dict)
     scov = self._create_simplex_coverage(dataset_id, pdict, spatial_domain, temporal_domain, self.inline_data_writes)
     #vcov = ViewCoverage(file_root, dataset_id, description or dataset_id, reference_coverage_location=scov.persistence_dir)
     scov.close()
     return scov
开发者ID:wbollenbacher,项目名称:coi-services,代码行数:10,代码来源:dataset_management_service.py

示例4: _create_coverage

# 需要导入模块: from ion.services.dm.utility.granule_utils import ParameterDictionary [as 别名]
# 或者: from ion.services.dm.utility.granule_utils.ParameterDictionary import load [as 别名]
 def _create_coverage(self, dataset_id, parameter_dict_id, time_dom, spatial_dom):
     pd = self.dataset_management_client.read_parameter_dictionary(parameter_dict_id)
     pdict = ParameterDictionary.load(pd)
     sdom = GridDomain.load(spatial_dom.dump())
     tdom = GridDomain.load(time_dom.dump())
     file_root = FileSystem.get_url(FS.CACHE,'datasets')
     scov = SimplexCoverage(file_root, dataset_id, dataset_id, parameter_dictionary=pdict, temporal_domain=tdom, spatial_domain=sdom)
     return scov
开发者ID:wbollenbacher,项目名称:coi-services,代码行数:10,代码来源:test_stream_ingestion_worker.py

示例5: _create_coverage

# 需要导入模块: from ion.services.dm.utility.granule_utils import ParameterDictionary [as 别名]
# 或者: from ion.services.dm.utility.granule_utils.ParameterDictionary import load [as 别名]
 def _create_coverage(self, dataset_id, description, parameter_dict, spatial_domain,temporal_domain):
     file_root = FileSystem.get_url(FS.CACHE,'datasets')
     pdict = ParameterDictionary.load(parameter_dict)
     sdom = GridDomain.load(spatial_domain)
     tdom = GridDomain.load(temporal_domain)
     scov = self._create_simplex_coverage(dataset_id, pdict, sdom, tdom, self.inline_data_writes)
     vcov = ViewCoverage(file_root, dataset_id, description or dataset_id, reference_coverage_location=scov.persistence_dir)
     scov.close()
     return vcov
开发者ID:edwardhunter,项目名称:coi-services,代码行数:11,代码来源:dataset_management_service.py

示例6: _create_coverage

# 需要导入模块: from ion.services.dm.utility.granule_utils import ParameterDictionary [as 别名]
# 或者: from ion.services.dm.utility.granule_utils.ParameterDictionary import load [as 别名]
    def _create_coverage(self, description, parameter_dict, spatial_domain,temporal_domain):
        #--------------------------------------------------------------------------------
        # Create coversions and deserialization then craft the coverage
        #--------------------------------------------------------------------------------

        pdict = ParameterDictionary.load(parameter_dict)
        sdom = GridDomain.load(spatial_domain)
        tdom = GridDomain.load(temporal_domain)

        scov = SimplexCoverage(description, parameter_dictionary=pdict, spatial_domain=sdom, temporal_domain=tdom)
        return scov
开发者ID:pombredanne,项目名称:coi-services,代码行数:13,代码来源:dataset_management_service.py

示例7: dataset_temporal_bounds

# 需要导入模块: from ion.services.dm.utility.granule_utils import ParameterDictionary [as 别名]
# 或者: from ion.services.dm.utility.granule_utils.ParameterDictionary import load [as 别名]
 def dataset_temporal_bounds(self, dataset_id):
     dataset = self.read_dataset(dataset_id)
     if not dataset:
         return {}
     pdict = ParameterDictionary.load(dataset.parameter_dictionary)
     temporal_parameter = pdict.temporal_parameter_name
     units = pdict.get_temporal_context().uom
     bounds = self.dataset_bounds(dataset_id)
     if not bounds:
         return {}
     bounds = bounds[temporal_parameter or 'time']
     bounds = [TimeUtils.units_to_ts(units, i) for i in bounds]
     return bounds
开发者ID:edwardhunter,项目名称:coi-services,代码行数:15,代码来源:dataset_management_service.py

示例8: has_lookup_values

# 需要导入模块: from ion.services.dm.utility.granule_utils import ParameterDictionary [as 别名]
# 或者: from ion.services.dm.utility.granule_utils.ParameterDictionary import load [as 别名]
    def has_lookup_values(self, stream_definition_id=''):
        stream_definition = self.read_stream_definition(stream_definition_id)
        pdict = ParameterDictionary.load(stream_definition.parameter_dictionary)

        ret = []
        for key in pdict.keys():
            p_context = pdict.get_context(key)
            if hasattr(p_context, 'lookup_value'):
                if stream_definition.available_fields and key in stream_definition.available_fields:
                    ret.append(p_context.name)
                elif not stream_definition.available_fields:
                    ret.append(p_context.name)

        return ret
开发者ID:Bobfrat,项目名称:coi-services,代码行数:16,代码来源:pubsub_management_service.py

示例9: _compare_pdicts

# 需要导入模块: from ion.services.dm.utility.granule_utils import ParameterDictionary [as 别名]
# 或者: from ion.services.dm.utility.granule_utils.ParameterDictionary import load [as 别名]
 def _compare_pdicts(cls, pdict1, pdict2):
     if pdict1:
         pdict1 = ParameterDictionary.load(pdict1) or {}
     if pdict2:
         pdict2 = ParameterDictionary.load(pdict2) or {}
     return bool(pdict1 == pdict2)
开发者ID:kerfoot,项目名称:coi-services,代码行数:8,代码来源:pubsub_management_service.py

示例10: _create_complex_coverage

# 需要导入模块: from ion.services.dm.utility.granule_utils import ParameterDictionary [as 别名]
# 或者: from ion.services.dm.utility.granule_utils.ParameterDictionary import load [as 别名]
 def _create_complex_coverage(cls, dataset_id, description, parameter_dict):
     pdict = ParameterDictionary.load(parameter_dict)
     file_root = FileSystem.get_url(FS.CACHE, 'datasets')
     ccov = ComplexCoverage(file_root, dataset_id, 'Complex Coverage for %s' % dataset_id, parameter_dictionary=pdict, complex_type=ComplexCoverageType.TEMPORAL_AGGREGATION)
     return ccov
开发者ID:ednad,项目名称:coi-services,代码行数:7,代码来源:dataset_management_service.py


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