Skip to content

Commit

Permalink
Adding stubs for tests of major components.
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerR1992 committed Jan 30, 2021
1 parent c11cf8b commit e2bbae7
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 8 deletions.
37 changes: 29 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,24 @@ We implemented Deep Q Learning (DQN), Double DQN, DDPG, A2C, SAC, PPO, TD3, GAE,

# Installation:

Clone this repository
```shell
git clone https://github.com/AI4Finance-LLC/FinRL-Library.git
```
## Docker Installation

Install the unstable development version of FinRL:
```shell
pip install git+https://github.com/AI4Finance-LLC/FinRL-Library.git
### option 1: Use the bin

```bash
# grant access to execute scripting (read it, it's harmless)
$ sudo chmod -R 777 docker/bin

# build the container!
$ ./docker/bin/build_container.sh

# start notebook on port 8887!
$ ./docker/bin/start_notebook.sh

# proceed to party!
```

## Docker Installation
### option 2: Do it manually

Build the container:
```bash
Expand All @@ -130,6 +137,20 @@ Note: The default container run starts jupyter lab in the root directory, allowi
$ docker run -it --rm -v ${PWD}:/home -p 8888:8888 finrl
```


## Bare-metal installation (More difficult)

Clone this repository
```shell
git clone https://github.com/AI4Finance-LLC/FinRL-Library.git
```

Install the unstable development version of FinRL:
```shell
pip install git+https://github.com/AI4Finance-LLC/FinRL-Library.git
```


## Prerequisites
For [OpenAI Baselines](https://github.com/openai/baselines), you'll need system packages CMake, OpenMPI and zlib. Those can be installed as follows

Expand Down
5 changes: 5 additions & 0 deletions docker/bin/build_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash



docker build -f docker/Dockerfile -t finrl docker/
3 changes: 3 additions & 0 deletions docker/bin/start_notebook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker run -it --rm -v ${PWD}:/home -p 8887:8888 finrl
7 changes: 7 additions & 0 deletions docker/bin/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash


docker run \
-it \
--rm \
-v ${PWD}:/home finrl python3 -m unittest discover
Empty file added tests/__init__.py
Empty file.
Empty file.
Empty file.
30 changes: 30 additions & 0 deletions tests/test_marketdata/test_yahoodownload.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import unittest
from finrl.marketdata.yahoodownloader import YahooDownloader
import pandas as pd





class TestDownloader(unittest.TestCase):
def setUp(cls):
cls.ticker_list = ["AAPL", "GOOG"]

def test_trivial(self):
print(f"got hree!")
self.assertTrue(True)


def test_download(self):
df = YahooDownloader(start_date = '2019-01-01',
end_date = '2019-02-01',
ticker_list = self.ticker_list).fetch_data()

self.assertIsInstance(df, pd.DataFrame)





if __name__ == '__main__':
unittest.main()

0 comments on commit e2bbae7

Please sign in to comment.