コード例 #1
0
ファイル: test_dataset_buffer.py プロジェクト: yuanzy97/PyDSS
def test_dataset_buffer__compute_chunk_count():
    one_year_at_5_minutes = 60 / 5 * 24 * 365
    assert DatasetBuffer.compute_chunk_count(num_columns=4,
                                             max_size=96,
                                             dtype=np.float) == 96
    assert DatasetBuffer.compute_chunk_count(num_columns=4,
                                             max_size=one_year_at_5_minutes,
                                             dtype=np.float) == 1024
    assert DatasetBuffer.compute_chunk_count(num_columns=6,
                                             max_size=one_year_at_5_minutes,
                                             dtype=np.complex) == 341
コード例 #2
0
def test_dataset_buffer__compute_chunk_count():
    one_year_at_5_minutes = 60 / 5 * 24 * 365
    assert DatasetBuffer.compute_chunk_count(
        num_columns=4,
        max_size=96,
        dtype=float
    ) == 96
    assert DatasetBuffer.compute_chunk_count(
        num_columns=4,
        max_size=one_year_at_5_minutes,
        dtype=float,
        max_chunk_bytes=128 * 1024,
    ) == 4096
    assert DatasetBuffer.compute_chunk_count(
        num_columns=6,
        max_size=one_year_at_5_minutes,
        dtype=complex,
        max_chunk_bytes=128 * 1024,
    ) == 1365