mirror of
https://github.com/wassname/rl-portfolio-management.git
synced 2026-06-27 19:32:16 +08:00
19 lines
505 B
Python
19 lines
505 B
Python
import pytest
|
|
import numpy as np
|
|
|
|
import os
|
|
os.sys.path.append('.')
|
|
from rl_portfolio_management.callbacks.notebook_plot import LivePlotNotebook
|
|
|
|
def test_live_plot_notebook():
|
|
# Test
|
|
import time
|
|
liveplot = LivePlotNotebook(labels=['a', 'b'])
|
|
x = np.random.random((10,))
|
|
for i in range(10):
|
|
time.sleep(0.1)
|
|
liveplot.update(
|
|
x=x + np.random.random(x.shape),
|
|
ys=[np.random.randint(0, 3, size=(10,)), np.random.randint(0, 3, size=(10,))]
|
|
)
|