If you're reading this section, you're probably interested in contributing to QuantLab. Welcome and thanks for your interest in contributing!
Please take a look at the Contributor documentation, familiarize yourself with using the Jupyter Notebook, and introduce yourself on the mailing list and share what area of the project you are interested in working on.
We have labeled some issues as sprint friendly that we believe are good examples of small, self contained changes. We encourage those that are new to the code base to implement and/or ask questions about these issues.
For general documentation about contributing to Jupyter projects, see the Project Jupyter Contributor Documentation.
All source code is written in TypeScript. See the Style Guide.
Building the QuantLab from its GitHub source code requires Node.js version
6+ and Node's package manager, npm.
If you use conda, you can get them with:
conda install -c conda-forge nodejsIf you use Homebrew on Mac OS X:
brew install nodeYou can also use the installer from the Node.js website.
QuantLab requires Jupyter Notebook version 4.2 or later.
If you use conda, you can install it as:
conda install notebookYou may also want to install nb_conda_kernels to have a kernel option for different conda environments
conda install nb_conda_kernelsIf you use pip you can install it as:
pip install notebookFork the QuantLab repository.
Once you have installed the dependencies mentioned above, use the following steps::
git clone https://github.com/<your-github-username>/quantlab.git
cd quantlab
pip install -e . # will take a long time to build everything
npm install
npm run build:main
jupyter serverextension enable --py quantlab
Notes:
-
At times, it may be necessary to clean your local repo with the command
git clean -fdx. -
If
pipgives aVersionConflicterror, it usually means that the installed version ofquantlab_launcheris out of date. Runpip install --upgrade quantlab_launcherto get the latest version. -
To install QuantLab in isolation for a single conda/virtual environment, you can add the
--sys-prefixflag to the extension activation above; this will tie the installation to thesys.prefixlocation of your environment, without writing anything in your user-wide settings area (which are visible to all your envs):
jupyter serverextension enable --py --sys-prefix quantlab
Start QuantLab in development mode:
jupyter quantlab --dev-modeDevelopment mode ensures that you are running the JavaScript assets that are built in the dev-installed Python package. When running from source in development mode, the page will have a red stripe at the top to indicate it is an unreleased version.
npm run build:test
npm testTo install and build the examples in the examples directory:
npm run build:examplesTo run a specific example, change to the example's directory (i.e.
examples/filebrowser) and enter:
python main.pyThe QuantLab application is made up of two major parts:
- an npm package
- a Jupyter server extension (Python package)
Each part is named quantlab. The developer tutorial documentation
provides additional architecture information.
The repository consists of many npm packages that are managed using the lerna
build tool. The npm package source files are in the packages/ subdirectory.
Prerequisites
- node (preferably version 5 or later)
- Jupyter notebook server version 4.2 or later (to run examples)
npm install --save quantlabgit clone https://github.com/quantlabio/quantlab.git
cd quantlab
npm install
npm run build:packagesRebuild
npm run clean
npm run build:packagesThe Jupyter server extension source files are in the quantlab/
subdirectory. To use this extension, make sure the Jupyter notebook server
version 4.2 or later is installed.
When you make a change to QuantLab npm package source files, run:
npm run buildto build the changes and then refresh your browser to see the changes.
To have the system build after each source file change, run:
npm run watchand refresh the browser.
-
By default, the application will load from the QuantLab staging directory (default is
<sys-prefix>/share/jupyter/quantlab/build. If you wish to run the core application in<git root>/quantlab/build, runjupyter quantlab --core-mode. This is the core application that will be shipped. -
If working with extensions, see the extension documentation on https://quantlab-tutorial.readthedocs.io/en/latest/index.html.
-
The npm modules are fully compatible with Node/Babel/ES6/ES5. Simply omit the type declarations when using a language other than TypeScript.