Beispiel #1
0
def test_set_timeseries_prop():
    '''
    following operation requires a numpy array
    '''
    ts = Timeseries(filename=wind_file)

    # Following is a 0-D array, make sure it gets
    # converted to a 1-D array correctly
    x = (datetime.now().replace(microsecond=0, second=0), (4, 5))
    ts.set_timeseries(x)
    assert ts.get_timeseries()['time'] == x[0]
    assert np.allclose(ts.get_timeseries()['value'], x[1], atol=1e-6)
Beispiel #2
0
def test_set_timeseries_prop():
    '''
    following operation requires a numpy array
    '''
    ts = Timeseries(filename=wind_file)

    # Following is a 0-D array, make sure it gets
    # converted to a 1-D array correctly
    x = (datetime.now().replace(microsecond=0, second=0), (4, 5))
    ts.set_timeseries(x)
    assert ts.get_timeseries()['time'] == x[0]
    assert np.allclose(ts.get_timeseries()['value'], x[1], atol=1e-6)