Spaces:
Sleeping
Sleeping
test for data_load module
Browse files- tests/__init__.py +0 -0
- tests/data_prep/__init__.py +0 -0
- tests/data_prep/test_conversion.py +25 -0
tests/__init__.py
ADDED
|
File without changes
|
tests/data_prep/__init__.py
ADDED
|
File without changes
|
tests/data_prep/test_conversion.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from data_prep.data_load import prepare_data , dataframe_to_tensor
|
| 2 |
+
|
| 3 |
+
import pandas as pd
|
| 4 |
+
import torch
|
| 5 |
+
|
| 6 |
+
test_file = "data/NIFTY_5_years.csv"
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def test_prepare_data():
|
| 10 |
+
|
| 11 |
+
df = prepare_data(test_file)
|
| 12 |
+
|
| 13 |
+
assert type(df) == pd.DataFrame
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
def test_convert_to_tensor():
|
| 17 |
+
|
| 18 |
+
df = prepare_data(test_file)
|
| 19 |
+
|
| 20 |
+
tensorA = dataframe_to_tensor(df)
|
| 21 |
+
|
| 22 |
+
assert type(tensorA) == torch.Tensor
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
|