Skip to content

Commit a9f39c6

Browse files
author
James Mac Hale
committed
Rewriting readme 6.
1 parent 47352e1 commit a9f39c6

2 files changed

Lines changed: 31 additions & 23 deletions

File tree

tutorials.00.index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
This page serves as the index for a series of tutorials on using and building
55
ORE python wrappers and wheels.
66

7-
[Run Jupyter Notebook Examples using the published ORE Python module](tutorials.06.notebooks.md)
8-
97
[Installing ORE Python Libraries and Example Scripts on Windows](tutorials.01.install_windows.md)
108

119
[Installing ORE Python Libraries and Example Scripts on Posix Systems (e.g. MacOS and Linux)](tutorials.02.install_posix.md)
@@ -16,3 +14,5 @@ ORE python wrappers and wheels.
1614

1715
[Managing Wheels](tutorials.05.wheels.md)
1816

17+
[Run Jupyter Notebook Examples using the published ORE Python module](tutorials.06.notebooks.md)
18+

tutorials.06.notebooks.md

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,56 @@
11
# Run Juyper Notebook examples using the ORE Python wheels
22

3-
This tutorial is aimed at the user who wants to install the ORE
4-
Python module and use it to execute example Jupyter notebooks provided on
5-
https://github.com/OpenSourceRisk/ORE-SWIG. No compilation is necessary.
3+
This tutorial is aimed at the user who wants to install the pre-built ORE
4+
Python module and use it to execute example Jupyter notebooks provided in
5+
[the notebooks directory](https://github.com/OpenSourceRisk/ORE-SWIG/tree/master/OREAnalytics-SWIG/Python/Examples/Notebooks). No compilation is necessary.
66

77
[Back to tutorials index](tutorials.00.index.md)
88

99
**Please note** that (as of October 2023) the published ORE Python wheels are
1010
available for Python versions 3.8 up to 3.11 for Windows, Linux and macOS arm64,
11-
and Python versions up to 3.10 for Intel Mac users.
11+
and Python versions up to 3.10 for Intel Mac users.
1212

13-
We assume below that the python executable points to a permissible Python 3 version.
13+
We assume below that the python executable points to a permissible Python 3 version. You can check your system's default python version with
1414

15-
## Create a virtual environemnt
15+
python --version
1616

17-
python -m venv venv
17+
## Quick Set Up and First Run
1818

19-
## Activate the virtual environment (Windows)
19+
Please note that these steps must be executed sequentially in a single command prompt/shell. The working directory, for ease, should be OREAnalytics-SWIG/Python/Examples/Notebooks.
2020

21-
CALL .\venv\Scripts\activate.bat
21+
1. Create a virtual environment:
2222

23-
## Activate the virtual environment (Linux, Mac)
23+
``` python -m venv venv ```
2424

25-
source "$(pwd)/venv/bin/activate"
25+
2. Activate the virtual environment:
2626

27-
## Upgrade pip
27+
(Windows): ```.\venv\Scripts\activate.bat ```
28+
29+
(Linux, Mac): ```source "$(pwd)/venv/bin/activate" ```
2830

29-
python -m pip install --upgrade pip
31+
3. Install required Python modules. The notebook examples require Jupyter, the ORE Python module and a few additional packages for e.g. plotting. To install these in the virtual environment please make sure to execute this **after** activating the virtual environment as above.
3032

31-
## Install required Python modules
33+
``` python -m pip install open-source-risk-engine matplotlib pandas plotly jupyter_server==2.8.0 jupyter ```
3234

33-
The Notebook examples require Jupyter, the ORE Python module and a few additional packages.
35+
4. Launch Jupyter! This opens a browser window that shows the list of Example folders on the left hand side. Double click to change into any of the Example folders and then double click the Jupyter notebook to open.
3436

35-
python -m pip install open-source-risk-engine pytest matplotlib pandas plotly jupyter_server==2.8.0 jupyter
37+
``` python -m jupyterlab ```
3638

37-
## Launch Jupyter with reference to the Notebooks directory
39+
## Normal Usage
3840

39-
python -m jupyterlab --notebook-dir=/path/to/OREAnalytics-SWIG/Python/Examples/Notebooks
41+
After the first time run, you simply need to activate the virtual environment and run jupyter lab.
4042

41-
This opens a browser window that shows the list of Example folders on the left hand side.
42-
Double click to change into any of the Example folders and then double click the Jupyter notebook to open.
43+
(Windows): ```.\venv\Scripts\activate.bat ```
44+
45+
(Linux, Mac): ```source "$(pwd)/venv/bin/activate" ```
46+
47+
python -m jupyterlab
4348

4449
## Exit the virtual environment
4550

46-
deactivate
51+
To deactivate the virtual environment you can simply close the command prompt/terminal window. Othewise you can run the relevant deactivation script (assuming that the working directory is the Notebooks directory:
4752

53+
(Windows): ```.\venv\Scripts\deactivate.bat ```
54+
55+
(Linux, Mac): ```source "$(pwd)/venv/bin/deactivate" ```
4856

0 commit comments

Comments
 (0)