本文整理汇总了Python中ion.services.dm.utility.granule.RecordDictionaryTool.fetch_lookup_values方法的典型用法代码示例。如果您正苦于以下问题:Python RecordDictionaryTool.fetch_lookup_values方法的具体用法?Python RecordDictionaryTool.fetch_lookup_values怎么用?Python RecordDictionaryTool.fetch_lookup_values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ion.services.dm.utility.granule.RecordDictionaryTool
的用法示例。
在下文中一共展示了RecordDictionaryTool.fetch_lookup_values方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_global_range_lookup
# 需要导入模块: from ion.services.dm.utility.granule import RecordDictionaryTool [as 别名]
# 或者: from ion.services.dm.utility.granule.RecordDictionaryTool import fetch_lookup_values [as 别名]
def test_global_range_lookup(self):
reference_designator = "CE01ISSM-MF005-01-CTDBPC999"
ph = ParameterHelper(self.dataset_management, self.addCleanup)
pdict_id = ph.create_simple_qc_pdict()
svm = StoredValueManager(self.container)
doc_key = 'grt_%s_TEMPWAT' % reference_designator
svm.stored_value_cas(doc_key, {'grt_min_value':-2, 'grt_max_value':40})
stream_def_id = self.pubsub_management.create_stream_definition('qc parsed', parameter_dictionary_id=pdict_id, stream_configuration={'reference_designator':reference_designator})
self.addCleanup(self.pubsub_management.delete_stream_definition,stream_def_id)
rdt = RecordDictionaryTool(stream_definition_id=stream_def_id)
rdt['time'] = [0]
rdt['temp'] = [20]
rdt.fetch_lookup_values()
min_field = [i for i in rdt.fields if 'grt_min_value' in i][0]
max_field = [i for i in rdt.fields if 'grt_max_value' in i][0]
np.testing.assert_array_almost_equal(rdt[min_field], [-2.])
np.testing.assert_array_almost_equal(rdt[max_field], [40.])
np.testing.assert_array_almost_equal(rdt['tempwat_glblrng_qc'],[1])