當前位置: 首頁>>代碼示例>>Python>>正文


Python PhilDB.ts_list方法代碼示例

本文整理匯總了Python中phildb.database.PhilDB.ts_list方法的典型用法代碼示例。如果您正苦於以下問題:Python PhilDB.ts_list方法的具體用法?Python PhilDB.ts_list怎麽用?Python PhilDB.ts_list使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在phildb.database.PhilDB的用法示例。


在下文中一共展示了PhilDB.ts_list方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_ts_list_measurand

# 需要導入模塊: from phildb.database import PhilDB [as 別名]
# 或者: from phildb.database.PhilDB import ts_list [as 別名]
    def test_ts_list_measurand(self):
        db = PhilDB(self.test_tsdb)
        db.add_timeseries('410731')
        db.add_measurand('P', 'PRECIPITATION', 'Precipitation')
        db.add_timeseries_instance('410731', 'D', 'Foo', measurand = 'P', source = 'DATA_SOURCE')

        ts_list = db.ts_list(measurand = 'P')
        self.assertEqual(['410731'], ts_list)
開發者ID:cc272309126,項目名稱:phildb,代碼行數:10,代碼來源:test_database.py

示例2: test_ts_list_source

# 需要導入模塊: from phildb.database import PhilDB [as 別名]
# 或者: from phildb.database.PhilDB import ts_list [as 別名]
    def test_ts_list_source(self):
        db = PhilDB(self.test_tsdb)
        db.add_timeseries('410731')
        db.add_source('EXAMPLE_SOURCE', 'Example source, i.e. a dataset')
        db.add_timeseries_instance('410731', 'D', 'Foo', measurand = 'Q', source = 'EXAMPLE_SOURCE')

        ts_list = db.ts_list(source = 'EXAMPLE_SOURCE')
        self.assertEqual(['410731'], ts_list)
開發者ID:cc272309126,項目名稱:phildb,代碼行數:10,代碼來源:test_database.py

示例3: test_ts_list_measurand_and_source

# 需要導入模塊: from phildb.database import PhilDB [as 別名]
# 或者: from phildb.database.PhilDB import ts_list [as 別名]
    def test_ts_list_measurand_and_source(self):
        db = PhilDB(self.test_tsdb)
        db.add_timeseries('410731')
        db.add_source('EXAMPLE_SOURCE', 'Example source, i.e. a dataset')
        db.add_measurand('P', 'PRECIPITATION', 'Precipitation')
        db.add_timeseries_instance('410731', 'D', 'Foo', measurand = 'P', source = 'EXAMPLE_SOURCE')

        ts_list = db.ts_list(source = 'EXAMPLE_SOURCE', measurand = 'P')
        self.assertEqual(['410731'], ts_list)
開發者ID:cc272309126,項目名稱:phildb,代碼行數:11,代碼來源:test_database.py

示例4: test_ts_list_unique_ids

# 需要導入模塊: from phildb.database import PhilDB [as 別名]
# 或者: from phildb.database.PhilDB import ts_list [as 別名]
    def test_ts_list_unique_ids(self):
        """
            Test that IDs don't appear multiple times due to different combinations.
        """
        db = PhilDB(self.test_tsdb)
        db.add_measurand('P', 'PRECIPITATION', 'Precipitation')
        db.add_timeseries_instance('410730', 'D', 'Foo', measurand = 'P', source = 'DATA_SOURCE')

        ts_list = db.ts_list()
        self.assertEqual(['123456', '410730'], ts_list)
開發者ID:cc272309126,項目名稱:phildb,代碼行數:12,代碼來源:test_database.py

示例5: test_ts_list_sorted

# 需要導入模塊: from phildb.database import PhilDB [as 別名]
# 或者: from phildb.database.PhilDB import ts_list [as 別名]
    def test_ts_list_sorted(self):
        """
            Test that the list of IDs is sorted.
        """
        db = PhilDB(self.test_tsdb)
        db.add_measurand('P', 'PRECIPITATION', 'Precipitation')

        db.add_timeseries_instance('410730', 'D', 'Foo', measurand = 'P', source = 'DATA_SOURCE')

        db.add_timeseries('410731')
        db.add_timeseries_instance('410731', 'D', 'Foo', measurand = 'P', source = 'DATA_SOURCE')
        db.add_timeseries_instance('410731', 'D', 'Foo', measurand = 'Q', source = 'DATA_SOURCE')

        ts_list = db.ts_list()
        self.assertEqual(['123456', '410730', '410731'], ts_list)
開發者ID:cc272309126,項目名稱:phildb,代碼行數:17,代碼來源:test_database.py

示例6: test_ts_list

# 需要導入模塊: from phildb.database import PhilDB [as 別名]
# 或者: from phildb.database.PhilDB import ts_list [as 別名]
 def test_ts_list(self):
     db = PhilDB(self.test_tsdb)
     ts_list = db.ts_list()
     self.assertEqual(['123456', '410730'], ts_list)
開發者ID:cc272309126,項目名稱:phildb,代碼行數:6,代碼來源:test_database.py

示例7: PhilDB

# 需要導入模塊: from phildb.database import PhilDB [as 別名]
# 或者: from phildb.database.PhilDB import ts_list [as 別名]
import time
import pandas as pd
import numpy as np
from datetime import datetime
from phildb.database import PhilDB
from phildb_client import PhilDBClient

pdb = PhilDB('hrs_phildb')
pdb_client = PhilDBClient('http://localhost:8989')

phildb_client_reads = []
for ts_id in pdb.ts_list():
    phildb_client_start = time.time()
    pdb_client.read(ts_id, 'D')
    phildb_client_end = time.time()

    phildb_client_reads.append(phildb_client_end - phildb_client_start)

np.savetxt('phildb_client_reads.txt', phildb_client_reads)
開發者ID:amacd31,項目名稱:phildb_paper_supplemental_files,代碼行數:21,代碼來源:read_phildb_client.py

示例8: PhilDB

# 需要導入模塊: from phildb.database import PhilDB [as 別名]
# 或者: from phildb.database.PhilDB import ts_list [as 別名]
import sys

import numpy as np
from phildb.database import PhilDB

db = PhilDB(sys.argv[1])

ac = np.array(
        [ (hrs_id, db.read(hrs_id, 'D', measurand = 'Q', source = 'BOM_HRS').autocorr()) for hrs_id in db.ts_list()],
        dtype = [('name','S8'),('val',float)]
        )


for station in ac[ac['val'] >= 0.95]:
    print station['name'], station['val']
開發者ID:cc272309126,項目名稱:phildb,代碼行數:17,代碼來源:autocorr.py


注:本文中的phildb.database.PhilDB.ts_list方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。