From 01c52317b4b2eb95df4b900b127b4c64a366a584 Mon Sep 17 00:00:00 2001 From: Anson Miu Date: Mon, 22 Apr 2024 17:34:52 +0100 Subject: [PATCH 1/4] Fix images --- Installation.md | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/Installation.md b/Installation.md index ac99e56c..d3f833ff 100644 --- a/Installation.md +++ b/Installation.md @@ -1,43 +1,47 @@ ## Installation Instructions ### 1. Installing **Git** (Windows laptop only. Mac OS has Git already installed) + - Navigate to: https://www.atlassian.com/git/tutorials/git-bash - Download & install the latest version of Git Bash. ### 2. Installing **Docker** + - Navigate to: https://docs.docker.com/engine/install/ - Download & install the right docker engine for your operating system. ### 3. Install your Favorite Terminal (You can skip this step if you already have one installed on your machine) -- You can install **Git Bash**, for example, https://git-scm.com/downloads. +- You can install **Git Bash**, for example, https://git-scm.com/downloads. ### 4. Fork the GitHub repository and clone it locally. + - In your favorite terminal, clone the repository - ``` - git clone - ``` + ``` + git clone + ``` - Navigate into the folder **learning_labs** ### 5. Create a **Docker image** of the BBIT Lab (This might take some time, so have a coffee :) ) + - First, ensure that docker is running and then in your favorite terminal, from the folder **learning_labs**, run the following command to build the docker image: - ``` - docker build . --tag bbitlab - ``` -**We can remove this step if we publish our image to DockerHub** + ` docker build . --tag bbitlab + ` + **We can remove this step if we publish our image to DockerHub** ### 6. Launch a docker container layer over the docker image of the lab + - launch our container and mount the **learning_labs** folder as a volume to access the lab. - ``` - docker run -p 8888:8888 -v :/app bbitlab - ``` -- When the container fully launches, you should have a similar output. - You should copy the URL *(circled in red)* and paste it into your favorite web browser to launch Jupyter Lab. -![alt text](./data/bbit_lab.PNG) + ``` + docker run -p 8888:8888 -v :/app bbitlab + ``` +- When the container fully launches, you should have a similar output. + You should copy the URL _(circled in red)_ and paste it into your favorite web browser to launch Jupyter Lab. + ![alt text](./data/Images/bbit_lab.PNG) **If you have a similar page displaying in your browser, you are all set and ready to start working on the BBIT Lab.** -![alt text](./data/bbit_lab_2.PNG) +![alt text](./data/Images/bbit_lab_2.PNG) -Thank you!! \ No newline at end of file +Thank you!! From 6b7e0a2d88c5966e1fcaade6b036ebbe8c5b7c45 Mon Sep 17 00:00:00 2001 From: Anson Miu Date: Mon, 22 Apr 2024 17:43:48 +0100 Subject: [PATCH 2/4] Fix installation.md --- Installation.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Installation.md b/Installation.md index d3f833ff..288ba815 100644 --- a/Installation.md +++ b/Installation.md @@ -25,8 +25,11 @@ ### 5. Create a **Docker image** of the BBIT Lab (This might take some time, so have a coffee :) ) - First, ensure that docker is running and then in your favorite terminal, from the folder **learning_labs**, run the following command to build the docker image: - ` docker build . --tag bbitlab - ` + + ``` + docker build . --tag bbitlab + ``` + **We can remove this step if we publish our image to DockerHub** ### 6. Launch a docker container layer over the docker image of the lab @@ -34,9 +37,12 @@ - launch our container and mount the **learning_labs** folder as a volume to access the lab. ``` - docker run -p 8888:8888 -v :/app bbitlab + docker run --rm -p 8888:8888 -v :/app bbitlab ``` + > Tip: on _Git Bash_ and _macOS Terminal_, use the `pwd` command to + > get the full path of your current directory. + - When the container fully launches, you should have a similar output. You should copy the URL _(circled in red)_ and paste it into your favorite web browser to launch Jupyter Lab. ![alt text](./data/Images/bbit_lab.PNG) From 8dad5864b868482b66102e5c6109b0b781ee7e35 Mon Sep 17 00:00:00 2001 From: Anson Miu Date: Mon, 22 Apr 2024 17:45:01 +0100 Subject: [PATCH 3/4] Ignore .ipynb_checkpoints --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9574a297..ed8f50f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .vscode *.pyc +.ipynb_checkpoints From 04ca5f655aad8301319b371d88e37d29241a9139 Mon Sep 17 00:00:00 2001 From: Anson Miu Date: Mon, 22 Apr 2024 17:45:23 +0100 Subject: [PATCH 4/4] Update notebooks to always fix system path --- .../0-Securities/securities_notebook.ipynb | 13 +++++++++++-- .../1-Positions/position_notebook.ipynb | 13 +++++++++++-- PortfolioManager/2-Account/account_notebook.ipynb | 12 +++++++++++- .../3-Portfolio/portfolio_notebook.ipynb | 12 +++++++++++- .../4-MarketValue/market_value_notebook.ipynb | 12 +++++++++++- 5 files changed, 55 insertions(+), 7 deletions(-) diff --git a/PortfolioManager/0-Securities/securities_notebook.ipynb b/PortfolioManager/0-Securities/securities_notebook.ipynb index 09decdc2..52512b5b 100644 --- a/PortfolioManager/0-Securities/securities_notebook.ipynb +++ b/PortfolioManager/0-Securities/securities_notebook.ipynb @@ -94,11 +94,20 @@ "metadata": {}, "outputs": [], "source": [ - "#Run this cell before running the your testing cell. This will setup the ipytest cell magic command. If you're running this notebook locally you may need to install ipytest from pip or conda\n", + "#Run this cell before running the your testing cell. This will:\n", + "# 1. adjust the system path to locate your solution;\n", + "# 2. setup the ipytest cell magic command.\n", + "#If you're running this notebook locally you may need to install ipytest from pip or conda\n", "#%conda install ipytest\n", "#%pip install ipytest\n", - "import ipytest\n", "\n", + "import os\n", + "import sys\n", + "module_path = os.path.abspath('..')\n", + "if module_path not in sys.path:\n", + " sys.path.append(module_path)\n", + "\n", + "import ipytest\n", "ipytest.autoconfig()" ] }, diff --git a/PortfolioManager/1-Positions/position_notebook.ipynb b/PortfolioManager/1-Positions/position_notebook.ipynb index 1a990de5..76e884c7 100644 --- a/PortfolioManager/1-Positions/position_notebook.ipynb +++ b/PortfolioManager/1-Positions/position_notebook.ipynb @@ -130,11 +130,20 @@ "metadata": {}, "outputs": [], "source": [ - "#Run this cell before running the your testing cell. This will setup the ipytest cell magic command. If you're running this notebook locally you may need to install ipytest from pip or conda\n", + "#Run this cell before running the your testing cell. This will:\n", + "# 1. adjust the system path to locate your solution;\n", + "# 2. setup the ipytest cell magic command.\n", + "#If you're running this notebook locally you may need to install ipytest from pip or conda\n", "#%conda install ipytest\n", "#%pip install ipytest\n", - "import ipytest\n", "\n", + "import os\n", + "import sys\n", + "module_path = os.path.abspath('..')\n", + "if module_path not in sys.path:\n", + " sys.path.append(module_path)\n", + "\n", + "import ipytest\n", "ipytest.autoconfig()" ] }, diff --git a/PortfolioManager/2-Account/account_notebook.ipynb b/PortfolioManager/2-Account/account_notebook.ipynb index 4fa2ed4d..e66ba39e 100644 --- a/PortfolioManager/2-Account/account_notebook.ipynb +++ b/PortfolioManager/2-Account/account_notebook.ipynb @@ -132,10 +132,20 @@ "metadata": {}, "outputs": [], "source": [ + "#Run this cell before running the your testing cell. This will:\n", + "# 1. adjust the system path to locate your solution;\n", + "# 2. setup the ipytest cell magic command.\n", + "#If you're running this notebook locally you may need to install ipytest from pip or conda\n", "#%conda install ipytest\n", "#%pip install ipytest\n", - "import ipytest\n", "\n", + "import os\n", + "import sys\n", + "module_path = os.path.abspath('..')\n", + "if module_path not in sys.path:\n", + " sys.path.append(module_path)\n", + "\n", + "import ipytest\n", "ipytest.autoconfig()" ] }, diff --git a/PortfolioManager/3-Portfolio/portfolio_notebook.ipynb b/PortfolioManager/3-Portfolio/portfolio_notebook.ipynb index 418c86f2..4d800186 100644 --- a/PortfolioManager/3-Portfolio/portfolio_notebook.ipynb +++ b/PortfolioManager/3-Portfolio/portfolio_notebook.ipynb @@ -122,10 +122,20 @@ "metadata": {}, "outputs": [], "source": [ + "#Run this cell before running the your testing cell. This will:\n", + "# 1. adjust the system path to locate your solution;\n", + "# 2. setup the ipytest cell magic command.\n", + "#If you're running this notebook locally you may need to install ipytest from pip or conda\n", "#%conda install ipytest\n", "#%pip install ipytest\n", - "import ipytest\n", "\n", + "import os\n", + "import sys\n", + "module_path = os.path.abspath('..')\n", + "if module_path not in sys.path:\n", + " sys.path.append(module_path)\n", + "\n", + "import ipytest\n", "ipytest.autoconfig()" ] }, diff --git a/PortfolioManager/4-MarketValue/market_value_notebook.ipynb b/PortfolioManager/4-MarketValue/market_value_notebook.ipynb index ff8422ea..f1bf0db3 100644 --- a/PortfolioManager/4-MarketValue/market_value_notebook.ipynb +++ b/PortfolioManager/4-MarketValue/market_value_notebook.ipynb @@ -174,10 +174,20 @@ "metadata": {}, "outputs": [], "source": [ + "#Run this cell before running the your testing cell. This will:\n", + "# 1. adjust the system path to locate your solution;\n", + "# 2. setup the ipytest cell magic command.\n", + "#If you're running this notebook locally you may need to install ipytest from pip or conda\n", "#%conda install ipytest\n", "#%pip install ipytest\n", - "import ipytest\n", "\n", + "import os\n", + "import sys\n", + "module_path = os.path.abspath('..')\n", + "if module_path not in sys.path:\n", + " sys.path.append(module_path)\n", + "\n", + "import ipytest\n", "ipytest.autoconfig()" ] },