diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index d4c5ae669219..0cbb665bac8f 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -5,4 +5,4 @@ contact_links:
about: Please ask questions like "How do I achieve x?" here.
- name: Discord
url: https://discord.gg/AUWVs3XaCS
- about: We maintain a Discord] server where contributors and active users can interact!
\ No newline at end of file
+ about: Chat with contributors and active users of NautilusTrader on our Discord server!
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 66b5db8d7fae..59cb7697ab8b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,4 +46,4 @@ output.json
examples/backtest/notebooks/catalog
nautilus_trader/**/.gitignore
docs/**/*.ipynb
-!nautilus_trader/core/pytime.h
\ No newline at end of file
+!nautilus_trader/core/pytime.h
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 589e31fa4c3f..7b592f1e7562 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -22,23 +22,23 @@ repos:
- id: check-xml
- id: check-yaml
- - repo: https://github.com/codespell-project/codespell
- rev: v2.1.0
- hooks:
- - id: codespell
- description: Checks for common misspellings.
- types_or: [python, cython, rst, markdown]
- exclude: "nautilus_trader/adapters/betfair/parsing.py|nautilus_trader/adapters/betfair/execution.py|tests/integration_tests/adapters/betfair/test_kit.py"
+# - repo: https://github.com/codespell-project/codespell
+# rev: v2.1.0
+# hooks:
+# - id: codespell
+# description: Checks for common misspellings.
+# types_or: [python, cython, rst, markdown]
+# exclude: "nautilus_trader/adapters/betfair/parsing.py|nautilus_trader/adapters/betfair/execution.py|tests/integration_tests/adapters/betfair/test_kit.py"
- repo: https://github.com/hadialqattan/pycln
- rev: v1.1.0
+ rev: v1.2.4
hooks:
- id: pycln
name: pycln (Python unused imports)
exclude: "nautilus_trader/live/node.py|nautilus_trader/adapters/betfair/execution.py"
- repo: https://github.com/psf/black
- rev: 21.12b0
+ rev: 22.1.0
hooks:
- id: black
args: [
@@ -73,6 +73,7 @@ repos:
]
additional_dependencies: [
pydantic,
+ types-frozendict,
types-orjson,
types-pytz,
types-redis,
@@ -85,6 +86,7 @@ repos:
- id: flake8
name: flake8 (Python)
additional_dependencies:
+ - bandit==1.7.2 # Pin due issue https://github.com/PyCQA/bandit/issues/841
- flake8-2020
- flake8-bandit
- flake8-bugbear
@@ -108,6 +110,7 @@ repos:
- id: flake8
name: flake8 (Cython)
additional_dependencies:
+ - bandit==1.7.2 # Pin due issue https://github.com/PyCQA/bandit/issues/841
- flake8-2020
- flake8-bandit
- flake8-bugbear
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8598c5850f1d..41671343ebe2 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -35,8 +35,7 @@ To contribute, the following steps should be followed;
### Tips
- Conform to the established coding practices, see _Coding Standards_ in the
- [Developer Guide](https://docs.nautilustrader.io/developer-guide).
-
+ [Developer Guide](https://docs.nautilustrader.io/developer_guide/index.html).
- Keep PR's small and focused.
- Reference the related GitHub issue(s) in the PR comment.
diff --git a/README.md b/README.md
index 4c8db05177fd..da608d2021c3 100644
--- a/README.md
+++ b/README.md
@@ -13,11 +13,11 @@
| `master` | ![version](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fnautechsystems%2Fnautilus_trader%2Fmaster%2Fversion.json) | [![build](https://github.com/nautechsystems/nautilus_trader/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/nautechsystems/nautilus_trader/actions/workflows/build.yml) |
| `develop` | ![version](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fnautechsystems%2Fnautilus_trader%2Fdevelop%2Fversion.json) | [![build](https://github.com/nautechsystems/nautilus_trader/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/nautechsystems/nautilus_trader/actions/workflows/build.yml) |
-| Platform | Rust | Python |
-|:-----------------|:--------|:-------|
-| Linux (x86_64) | `TBA` | `3.8+` |
-| macOS (x86_64) | `TBA` | `3.8+` |
-| Windows (x86_64) | `TBA` | `3.8+` |
+| Platform | Rust | Python |
+|:-----------------|:----------|:-------|
+| Linux (x86_64) | `1.59.0+` | `3.8+` |
+| macOS (x86_64) | `1.59.0+` | `3.8+` |
+| Windows (x86_64) | `1.59.0+` | `3.8+` |
- **Website:** https://nautilustrader.io
- **Docs:** https://docs.nautilustrader.io
@@ -44,16 +44,16 @@ including FX, Equities, Futures, Options, CFDs, Crypto and Betting - across mult
## Features
-- **Fast:** C-level speed through Cython. Asynchronous networking with `uvloop`.
+- **Fast:** C-level speed through Cython. Asynchronous networking with [uvloop](https://github.com/MagicStack/uvloop).
- **Reliable:** Type safety through Cython. Redis backed performant state persistence.
- **Flexible:** OS independent, runs on Linux, macOS, Windows. Deploy using Docker.
- **Integrated:** Modular adapters mean any REST, WebSocket, or FIX API can be integrated.
-- **Advanced:** Time-in-force options `GTD`, `IOC`, `FOK` etc, advanced order types and triggers, `post-only`, `reduce-only`, and icebergs. Contingency order lists including `OCO`, `OTO` etc.
+- **Advanced:** Time in force `IOC`, `FOK`, `GTD`, `AT_THE_OPEN`, `AT_THE_CLOSE`, advanced order types and conditional triggers. Execution instructions `post-only`, `reduce-only`, and icebergs. Contingency order lists including `OCO`, `OTO`.
- **Backtesting:** Run with multiple venues, instruments and strategies simultaneously using historical quote tick, trade tick, bar, order book and custom data with nanosecond resolution.
- **Live:** Use identical strategy implementations between backtesting and live deployments.
- **Multi-venue:** Multiple venue capabilities facilitate market making and statistical arbitrage strategies.
- **AI Agent Training:** Backtest engine fast enough to be used to train AI trading agents (RL/ES).
-- **Distributed:** Run backtests synchronously or as a graph distributed across a `dask` cluster.
+- **Distributed:** Run backtests synchronously or as a graph distributed across a [dask](https://dask.org/) cluster.
![Alt text](https://github.com/nautechsystems/nautilus_trader/blob/develop/docs/_images/nautilus-art.png?raw=true "nautilus")
> *nautilus - from ancient Greek 'sailor' and naus 'ship'.*
@@ -77,7 +77,7 @@ professional quantitative traders and trading firms.
Python was originally created decades ago as a simple scripting language with a clean straight
forward syntax. It has since evolved into a fully fledged general purpose object-oriented
-programming language. Based on the TIOBE index, Python is currently the most popular programming language in the world.
+programming language. Based on the TIOBE index, Python is currently the most popular programming language in the world.
Not only that, Python has become the _de facto lingua franca_ of data science, machine learning, and artificial intelligence.
The language out of the box is not without its drawbacks however, especially in the context of
@@ -95,6 +95,25 @@ The project heavily utilizes Cython to provide static type safety and increased
for Python through [C extension modules](https://docs.python.org/3/extending/extending.html). The vast majority of the production code is actually
written in Cython, however the libraries can be accessed from both pure Python and Cython.
+## What is Rust?
+
+[Rust](https://www.rust-lang.org/) is a multi-paradigm programming language designed for performance and safety, especially safe
+concurrency. Rust is blazingly fast and memory-efficient (comparable to C and C++) with no runtime or
+garbage collector. It can power mission-critical systems, run on embedded devices, and easily
+integrates with other languages.
+
+Rust’s rich type system and ownership model guarantees memory-safety and thread-safety deterministically —
+eliminating many classes of bugs at compile-time.
+
+The project increasingly utilizes Rust for core performance-critical components. Python language binding is handled through
+Cython, with static libraries linked at compile-time before the wheel binaries are packaged, so a user
+does not need to have Rust installed to run NautilusTrader. In the future as more Rust code is introduced,
+[PyO3](https://pyo3.rs/v0.15.1/) will be leveraged for easier Python bindings.
+
+The `rust-experimental` branch is likely to run for at least another release cycle while the Python -> Rust bindings for core objects
+are bedded down, and more automated testing is written. Present benchmarks show instantiation of core objects is between 2-3x faster
+even when wrapped in a Python class using Cython, with comparisons and arithmetic operations achieving an order of magnitude improvement.
+
## Architecture (data flow)
![Architecture](https://github.com/nautechsystems/nautilus_trader/blob/develop/docs/_images/architecture-overview.png?raw=true "architecture")
@@ -114,29 +133,64 @@ NautilusTrader is designed in a modular way to work with 'adapters' which provid
connectivity to data publishers and/or trading venues - converting their raw API
into a unified interface. The following integrations are currently supported:
-| Name | ID | Type | Status | Docs |
-|:--------------------------------------------------------|:--------|:------------------------|:------------------------------------------------------|:------------------------------------------------------------------|
-[Betfair](https://betfair.com) | BETFAIR | Sports Betting Exchange | ![status](https://img.shields.io/badge/beta-yellow) | [Guide](https://docs.nautilustrader.io/integrations/betfair.html) |
-[Binance](https://binance.com) | BINANCE | Crypto Exchange | ![status](https://img.shields.io/badge/beta-yellow) | [Guide](https://docs.nautilustrader.io/integrations/binance.html) |
-[Binance US](https://binance.us) | BINANCE | Crypto Exchange | ![status](https://img.shields.io/badge/beta-yellow) | [Guide](https://docs.nautilustrader.io/integrations/binance.html) |
-[FTX](https://ftx.com) | FTX | Crypto Exchange | ![status](https://img.shields.io/badge/beta-yellow) | [Guide](https://docs.nautilustrader.io/integrations/ftx.html) |
-[FTX US](https://ftx.us) | FTX | Crypto Exchange | ![status](https://img.shields.io/badge/beta-yellow) | [Guide](https://docs.nautilustrader.io/integrations/ftx.html) |
-[Interactive Brokers](https://www.interactivebrokers.com) | IB | Brokerage (multi-venue) | ![status](https://img.shields.io/badge/planning-gray) | [Guide](https://docs.nautilustrader.io/integrations/ib.html) |
+| Name | ID | Type | Status | Docs |
+|:--------------------------------------------------------|:--------|:------------------------|:--------------------------------------------------------|:------------------------------------------------------------------|
+[Betfair](https://betfair.com) | BETFAIR | Sports Betting Exchange | ![status](https://img.shields.io/badge/beta-yellow) | [Guide](https://docs.nautilustrader.io/integrations/betfair.html) |
+[Binance](https://binance.com) | BINANCE | Crypto Exchange (CEX) | ![status](https://img.shields.io/badge/beta-yellow) | [Guide](https://docs.nautilustrader.io/integrations/binance.html) |
+[Binance US](https://binance.us) | BINANCE | Crypto Exchange (CEX) | ![status](https://img.shields.io/badge/beta-yellow) | [Guide](https://docs.nautilustrader.io/integrations/binance.html) |
+[Binance Futures](https://www.binance.com/en/futures) | BINANCE | Crypto Exchange (CEX) | ![status](https://img.shields.io/badge/building-orange) | [Guide](https://docs.nautilustrader.io/integrations/binance.html) |
+[FTX](https://ftx.com) | FTX | Crypto Exchange (CEX) | ![status](https://img.shields.io/badge/beta-yellow) | [Guide](https://docs.nautilustrader.io/integrations/ftx.html) |
+[FTX US](https://ftx.us) | FTX | Crypto Exchange (CEX) | ![status](https://img.shields.io/badge/beta-yellow) | [Guide](https://docs.nautilustrader.io/integrations/ftx.html) |
+[Interactive Brokers](https://www.interactivebrokers.com) | IB | Brokerage (multi-venue) | ![status](https://img.shields.io/badge/beta-yellow) | [Guide](https://docs.nautilustrader.io/integrations/ib.html) |
Refer to the [Integrations](https://docs.nautilustrader.io/integrations/index.html) documentation for further details.
## Installation
+### From PyPI
+
We recommend running the platform with the latest stable version of Python, and in a virtual environment to isolate the dependencies.
To install the latest binary wheel from PyPI:
pip install -U nautilus_trader
-To install on ARM architectures such as MacBook Pro M1 / Apple Silicon, this stackoverflow thread is useful:
-https://stackoverflow.com/questions/65745683/how-to-install-scipy-on-apple-silicon-arm-m1
+To install `numpy` and `scipy` on ARM architectures such as MacBook Pro M1 / Apple Silicon, [this stackoverflow thread](https://stackoverflow.com/questions/65745683/how-to-install-scipy-on-apple-silicon-arm-m1)
+is useful.
+
+### From Source
+Installation from source requires the latest stable `rustc` and `cargo` to compile the Rust libraries.
+For the Python part, it's possible to install from source using `pip` if you first install the build dependencies
+as specified in the `pyproject.toml`. However, we highly recommend installing using [poetry](https://python-poetry.org/) as below.
-Refer to the [Installation Guide](https://docs.nautilustrader.io/1_getting_started/1_installation.html) for other options and further details.
+1. Install [rustup](https://rustup.rs/) (the Rust toolchain installer):
+ - Linux and macOS:
+ ```
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
+ ```
+ - Windows:
+ - Download and install [`rustup-init.exe`](https://win.rustup.rs/x86_64)
+ - Install "Desktop development with C++" with [Build Tools for Visual Studio 2019](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16)
+
+2. Enable `cargo` in the current shell:
+ - Linux and macOS:
+ ```
+ source $HOME/.cargo/env
+ ```
+ - Windows:
+ - Start a new PowerShell
+
+3. Install poetry (or follow the installation guide on their site):
+
+ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
+
+4. Clone the source with `git`, and install from the projects root directory:
+
+ git clone https://github.com/nautechsystems/nautilus_trader
+ cd nautilus_trader
+ poetry install --no-dev
+
+Refer to the [Installation Guide](https://docs.nautilustrader.io/getting_started/installation.html) for other options and further details.
## Versioning and releases
@@ -144,13 +198,13 @@ NautilusTrader is currently following a bi-weekly beta release schedule.
The API is becoming more stable, however breaking changes are still possible between releases.
Documentation of these changes in the release notes are made on a best-effort basis.
-The `master` branch will always reflect the source code for the latest released version.
-
-The `develop` branch is normally very active with frequent commits, we aim to maintain a stable
+### Branches
+- `master` branch will always reflect the source code for the latest released version.
+- `develop` branch is normally very active with frequent commits and may contain experimental features. We aim to maintain a stable
passing build on this branch.
The current roadmap has a goal of achieving a stable API for a `2.x` version. From this
-point we will follow a more formal process for releases, with deprecation periods for any API changes.
+point we will follow a formal process for releases, with deprecation periods for any API changes.
## Makefile
@@ -296,7 +350,7 @@ Refer to the [CONTRIBUTING.md](https://github.com/nautechsystems/nautilus_trader
Please make all pull requests to the `develop` branch.
## Community
-We maintain a [Discord](https://discord.gg/AUWVs3XaCS) server where contributors and active users of NautilusTrader can interact!
+Chat with contributors and active users of NautilusTrader on our [Discord](https://discord.gg/AUWVs3XaCS) server!
## License
@@ -309,4 +363,5 @@ Contributors are also required to sign a standard Contributor License Agreement
Copyright (C) 2015-2022 Nautech Systems Pty Ltd. All rights reserved.
https://nautechsystems.io
-![nautechsystems](https://github.com/nautechsystems/nautilus_trader/blob/develop/docs/_images/ns-logo.png?raw=true "nautechsystems") ![cython](https://github.com/nautechsystems/nautilus_trader/blob/develop/docs/_images/cython-logo.png?raw=true "cython")
+![nautechsystems](https://github.com/nautechsystems/nautilus_trader/blob/develop/docs/_images/ns-logo.png?raw=true "nautechsystems")
+
diff --git a/RELEASES.md b/RELEASES.md
index 7d687b6e0ff1..843020d40cee 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -1,3 +1,42 @@
+# NautilusTrader 1.139.0 Beta
+
+## Release Notes
+
+Released on 11th March 2022 (UTC).
+
+### Breaking Changes
+- Renamed `CurrencySpot` to `CurrencyPair`.
+- Renamed `PerformanceAnalyzer` to `PortfolioAnalyzer`.
+- Renamed `BacktestDataConfig.data_cls_path` to `data_cls`.
+- Renamed `BinanceTicker` to `BinanceSpotTicker`.
+- Renamed `BinanceSpotExecutionClient` to `BinanceExecutionClient`.
+
+### Enhancements
+- Added initial **(beta)** Binance Futures adapter implementation.
+- Added initial **(beta)** Interactive Brokers adapter implementation.
+- Added custom portfolio statistics.
+- Added `CryptoFuture` instrument.
+- Added `OrderType.MARKET_TO_LIMIT`.
+- Added `OrderType.MARKET_IF_TOUCHED`.
+- Added `OrderType.LIMIT_IF_TOUCHED`.
+- Added `MarketToLimitOrder` order type.
+- Added `MarketIfTouchedOrder` order type.
+- Added `LimitIfTouchedOrder` order type.
+- Added `Order.has_price` property (convenience).
+- Added `Order.has_trigger_price` property (convenience).
+- Added `msg` param to `LoggerAdapter.exception()`.
+- Added WebSocket `log_send` and `log_recv` config options.
+- Added WebSocket `auto_ping_interval` (seconds) config option.
+- Replaced `msgpack` with `msgspec` (faster drop in replacement https://github.com/jcrist/msgspec).
+- Improved exception messages by providing helpful context.
+- Improved `BacktestDataConfig` API: now takes either a type of `Data` _or_ a fully qualified path string.
+
+### Fixes
+- Fixed FTX execution WebSocket 'ping strategy'.
+- Fixed non-deterministic config dask tokenization.
+
+---
+
# NautilusTrader 1.138.0 Beta
## Release Notes
@@ -80,7 +119,7 @@ Released on 12th January 2022 (UTC).
### Fixes
- Fixed parsing of `BarType` with symbols including hyphens `-`.
-- Fixed `BinanceTicker` `__repr__` (was missing whitespace after a comma).
+- Fixed `BinanceSpotTicker` `__repr__` (was missing whitespace after a comma).
- Fixed `DataEngine` requests for historical `TradeTick`.
- Fixed `DataEngine` `_handle_data_response` typing of `data` to `object`.
@@ -784,7 +823,7 @@ for `OrderFill` events, as well as additional order states and events.
- Removed redundant `OrderFilled.leaves_qty`.
- `BacktestEngine` constructor simplified.
- `BacktestMarketDataClient` no longer needs instruments.
-- Rename `PerformanceAnalyzer.get_realized_pnls` to `.realized_pnls`.
+- Rename `PortfolioAnalyzer.get_realized_pnls` to `.realized_pnls`.
### Enhancements
- Re-engineered `BacktestEngine` to take data directly.
diff --git a/build.py b/build.py
index 99a6dd9b5ae7..e793d1c955a9 100644
--- a/build.py
+++ b/build.py
@@ -172,7 +172,7 @@ def build() -> None:
# universal files containing multiple architectures. To determine the
# “64-bitness” of the current interpreter, it is more reliable to query the
# sys.maxsize attribute:
- bits = "64-bit" if sys.maxsize > 2 ** 32 else "32-bit"
+ bits = "64-bit" if sys.maxsize > 2**32 else "32-bit"
print("Project: nautilus_trader")
print(f"System: {platform.system()} {bits}")
print(f"Python: {platform.python_version()}")
diff --git a/docs/_images/ferris.png b/docs/_images/ferris.png
new file mode 100644
index 000000000000..ac945b11dd38
Binary files /dev/null and b/docs/_images/ferris.png differ
diff --git a/docs/_images/nt-black.png b/docs/_images/nt-black.png
deleted file mode 100644
index ad491cd41355..000000000000
Binary files a/docs/_images/nt-black.png and /dev/null differ
diff --git a/docs/_images/nt-white-large.png b/docs/_images/nt-white-large.png
new file mode 100644
index 000000000000..2cc8c66e9db8
Binary files /dev/null and b/docs/_images/nt-white-large.png differ
diff --git a/docs/_static/custom.css b/docs/_static/custom.css
index 28290a450a44..83f53b19c844 100644
--- a/docs/_static/custom.css
+++ b/docs/_static/custom.css
@@ -76,13 +76,16 @@ h1, h2, h3 {
padding-left: 0;
margin-top: 0;
}
+/*.md-header-nav__button:hover {*/
+/* opacity: 1;*/
+/*}*/
.md-tabs {
box-shadow: 0 0 0.2rem rgb(0 0 0 / 10%), 0 0.2rem 0.4rem rgb(0 0 0 / 20%);
transition: transform .25s cubic-bezier(.1,.7,.1,1),box-shadow .25s;
}
.md-typeset code {
background-color: transparent;
- color: #00bdd6;
+ color: #f92672;
display: inline-block;
}
.md-nav__link[data-md-state=blur] {
@@ -97,7 +100,11 @@ h1, h2, h3 {
.md-nav {
font-size: .7rem;
}
-.md-nav__link--active, .md-nav__link:active, .md-nav__link:focus, .md-nav__link:hover {
+.md-nav__link--active .md-nav__link,
+.md-nav__link:active,
+.parent-active-menu > a,
+.md-nav__link:focus,
+.md-nav__link:hover {
color: #00bdd6;
}
.md-typeset .admonition, .md-typeset details {
@@ -121,24 +128,145 @@ background-color: rgba(0,0,0,.54);
.md-typeset pre {
color: #D3D3D3;
}
+.py.attribute .sig-name.descname .pre {
+ color: #00bdd6;
+}
+/*.py.method span {
+ color: #ae81ff;
+}*/
+.py.class .pre {
+ color: #00bdd6;
+}
+dl.py.class {
+ background: rgb(0 0 0 / 12%);
+ color: #f8f8f2;
+ margin: 1em 0;
+ padding: 10px 10px 6px;
+ border-radius: 0.1rem;
+}
+.py.class .py.method, .py.class .py.attribute {
+ background: rgb(40 47 56 / 30%);
+ color: #f8f8f2;
+ margin: 1em 0;
+ padding: 10px 10px 6px;
+ border-radius: 0.1rem;
+}
+.py.class .docutils.literal.notranslate .pre{
+ color: #f92672;
+}
+.py.class em.sig-param .pre, .py.class .sig-return .pre {
+ color: #fff;
+}
+.md-source__facts li {
+ padding: 0 !important;
+}
+#menu .md-nav__item {
+ padding-right: 30px!important;
+ padding: 0 0 0 12px!important
+}
+.md-nav__item {
+ position: relative;
+}
+.arrow {
+ color: #fff;
+ font-size: 10px;
+ transition: 0.25s ease;
+ position: absolute;
+ right: 4px;
+ top: 0;
+ border-radius: 100%;
+ height: 0.9rem;
+ width: 0.9rem;
+ transition: background-color .25s,transform .25s;
+ z-index: 9999;
+ display: flex;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ -ms-flex-pack: center;
+ justify-content: center;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ -ms-flex-align: center;
+ align-items: center;
+ -webkit-box-flex: 0;
+ -webkit-flex: 0 0 auto;
+ -ms-flex: 0 0 auto;
+ flex: 0 0 auto;
+}
+.arrow:hover {
+ background-color: rgb(40, 47, 56) !important;
+ color: #00bdd6;
+}
+.arrow.arrow-animate{
+ transform: rotate(90deg);
+ background-color: rgb(40, 47, 56) !important;
+ color: #fff!important;
+}
+/*.md-nav__link--active .arrow.arrow-animate{
+ transform: rotate(180deg);
+}*/
+.md-nav__item .md-nav__link:hover,
+.md-nav__item:hover > .md-nav__link {
+ color: #00bdd6;
+}
+.md-nav__item:hover .arrow {
+ color: #00bdd6;
+}
+.submenu {
+ display: none;
+}
+/*.md-nav__link--active .submenu {
+ display: block;
+}*/
+.md-nav__link:hover/*,
+.md-nav__item.selected > .md-nav__link*/ {
+ color: #00bdd6 !important;
+}
+.md-nav__link--active .submenu .md-nav__link {
+ color: #fff;
+}
+.md-nav__link--active .submenu .md-nav__link--active > a {
+ color: #00bdd6;
+}
+.md-nav__link {
+ width: 80%;
+}
+.md-tabs {
+ overflow: initial;
+}
+.md-tabs__item {
+ padding-right: 0.4rem;
+ padding-left: 0.4rem;
+}
+dl.function.py .pre {
+ color: #00bdd6;
+}
+em.sig-param .pre {
+ color: #fff!important;
+}
@media only screen and (min-width: 60em) {
.md-search__inner {
padding: 0.34rem 0;
}
}
@media only screen and (max-width: 76.1875em) {
- .md-nav {
- background-color: transparent;
+ .md-nav__button img {
+ width: auto;
}
- html .md-nav--primary .md-nav__title--site {
+ .md-nav,
+ html .md-nav--primary .md-nav__title--site {
background-color: #282f38 !important;
}
html .md-nav--primary .md-nav__title--site .md-nav__button {
display: block;
left: 0;
width: 100%;
- margin-left: 0;
+ margin-left: 5px;
padding-left: 0;
}
html .md-nav--primary .md-nav__title~.md-nav__list {
@@ -146,6 +274,7 @@ background-color: rgba(0,0,0,.54);
}
.md-nav--primary .md-nav__item { /* menus font */
font-size: 0.7rem;
+ border-top: 0;
}
.md-nav__list ul.md-nav__list {
padding-left: 24px;
@@ -156,7 +285,22 @@ background-color: rgba(0,0,0,.54);
html .md-nav--primary .md-nav__title {
height: 4rem;
}
-
+ .arrow {
+ top: 8px;
+ right: 16px;
+ }
+ .md-nav__item .md-nav__item a {
+ padding-left: 0 !important;
+ }
+ html .md-nav--primary .md-nav__title--site .md-nav__button {
+ top: -10px;
+ }
+ .md-nav--primary {
+ overflow-y: auto;
+ }
+ .md-nav--primary .md-nav__link {
+ padding: 0.2rem 0.8rem;
+ }
}
@@ -184,5 +328,4 @@ background-color: rgba(0,0,0,.54);
max-width: 100%;
float: none;
}
-
}
diff --git a/docs/_static/fontawesome.css b/docs/_static/fontawesome.css
new file mode 100644
index 000000000000..b2ceba3d321f
--- /dev/null
+++ b/docs/_static/fontawesome.css
@@ -0,0 +1,307 @@
+@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700;800&family=Playfair+Display:wght@400;500;600;700;800;900&display=swap');
+
+:root {
+ /* Use softer blue from bootstrap's default info color */
+ --pst-color-info: 23, 162, 184;
+}
+html, body {
+ background-color: #1d2228;
+}
+body, input {
+ color: #fff;
+ font-family: 'Open Sans', sans-serif;
+}
+h1, h2, h3, h4, h5, h6 {
+ font-family: 'Open Sans', sans-serif;
+}
+.header-logo img {
+ width: auto;
+}
+.body {
+ width: auto;
+ font-family: 'Open Sans', sans-serif;
+ color:#4A4A4A; /* numpy.org body color */
+}
+pre, code {
+ font-size: 100%;
+ line-height: 155%;
+}
+h1, h2, h3 {
+ color: #d2d7f99e !important;
+ font-weight: 500 !important;
+}
+.md-header-nav__button.md-logo * {
+ display: block;
+ width: 230px;
+ height: auto;
+}
+.md-header, .md-hero {
+ background-color: rgb(40, 47, 56) !important;
+}
+.md-header {
+ height: 2.8rem;
+}
+.md-tabs__list {
+ margin: 0 0 0px 13rem;
+}
+.md-tabs__link {
+ font-size: .7rem;
+ opacity: 0.8;
+}
+.md-typeset a {
+ color: #00bdd6 !important;
+}
+.md-typeset { /* main body font */
+ font-size: .78rem;
+ line-height: 1.5;
+}
+.md-typeset h1 {
+ margin: 0 0 1rem !important;
+ color: #d2d7f99e !important;
+}
+.md-footer-copyright {
+ color: hsla(0,0%,100%,.3);
+ font-size: .67rem;
+}
+.md-footer-meta {
+ background-color: #16171d !important;
+ text-align: center;
+}
+.md-hero__inner {
+ margin-top: 0;
+ padding: 0 0.7rem 0.4rem;
+}
+.md-header-nav__button {
+ margin-left: 0;
+ padding-left: 0;
+ margin-top: 0;
+}
+.md-tabs {
+ box-shadow: 0 0 0.2rem rgb(0 0 0 / 10%), 0 0.2rem 0.4rem rgb(0 0 0 / 20%);
+ transition: transform .25s cubic-bezier(.1,.7,.1,1),box-shadow .25s;
+}
+.md-typeset code {
+ background-color: transparent;
+ color: #f92672;
+ display: inline-block;
+}
+.md-nav__link[data-md-state=blur] {
+ color: #00bdd6;
+}
+.md-footer-nav {
+ background-color: #181c21;
+}
+.toctree-wrapper.compound {
+ display: none;
+}
+.md-nav {
+ font-size: .7rem;
+}
+.md-nav__link--active .md-nav__link,
+.md-nav__link:active,
+.md-nav__link:focus,
+.md-nav__link:hover {
+ color: #00bdd6;
+}
+.md-typeset .admonition, .md-typeset details {
+ font-size: 0.66rem;
+}
+.md-typeset blockquote {
+ border-left: 0.2rem solid #d2d7f952;
+}
+.md-typeset blockquote {
+ color: #d2d7f99e;
+ margin-left: 0;
+ margin-right: 0;
+}
+.md-header-nav__topic {
+ display: none;
+ width: 0 !important;
+}
+.md-typeset table:not([class]) th {
+background-color: rgba(0,0,0,.54);
+}
+.md-typeset pre {
+ color: #D3D3D3;
+}
+.py.attribute .sig-name.descname .pre {
+ color: #00bdd6;
+}
+/*.py.method span {
+ color: #ae81ff;
+}*/
+.py.class .pre {
+ color: #00bdd6;
+}
+dl.py.class {
+ background: rgb(0 0 0 / 12%);
+ color: #f8f8f2;
+ margin: 1em 0;
+ padding: 10px 10px 6px;
+ border-radius: 0.1rem;
+}
+
+.py.class .py.method, .py.class .py.attribute {
+ background: rgb(40 47 56 / 30%);
+ color: #f8f8f2;
+ margin: 1em 0;
+ padding: 10px 10px 6px;
+ border-radius: 0.1rem;
+}
+.py.class .docutils.literal.notranslate .pre{
+ color: #f92672;
+}
+.py.class em.sig-param .pre, .py.class .sig-return .pre {
+ color: #fff;
+}
+.md-source__facts li {
+ padding: 0 !important;
+}
+#menu .md-nav__item {
+ padding-right: 30px!important;
+ padding: 0 0 0 12px!important
+}
+.md-nav__item {
+ position: relative;
+}
+.arrow {
+ color: #fff;
+ font-size: 10px;
+ transition: 0.25s ease;
+ position: absolute;
+ right: 4px;
+ top: 0;
+ border-radius: 100%;
+ height: 0.9rem;
+ width: 0.9rem;
+ transition: background-color .25s,transform .25s;
+ z-index: 99;
+ display: flex;
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-box-pack: center;
+ -webkit-justify-content: center;
+ -ms-flex-pack: center;
+ justify-content: center;
+ -webkit-box-align: center;
+ -webkit-align-items: center;
+ -ms-flex-align: center;
+ align-items: center;
+ -webkit-box-flex: 0;
+ -webkit-flex: 0 0 auto;
+ -ms-flex: 0 0 auto;
+ flex: 0 0 auto;
+}
+.arrow:hover {
+ background-color: rgb(0 189 214 / 20%);
+ color: #fff!important;
+}
+.arrow.arrow-animate{
+ transform: rotate(90deg);
+ background-color: rgb(0 189 214 / 20%);
+ color: #fff!important;
+}
+/*.md-nav__link--active .arrow.arrow-animate{
+ transform: rotate(180deg);
+}*/
+
+.md-nav__item .md-nav__link:hover,
+.md-nav__item:hover > .md-nav__link {
+ color: #00bdd6;
+}
+.md-nav__item:hover .arrow {
+ color: #00bdd6;
+}
+.submenu {
+ display: none;
+}
+/*.md-nav__link--active .submenu {
+ display: block;
+}*/
+.md-nav__link:hover/*,
+.md-nav__item.selected > .md-nav__link*/ {
+ color: #00bdd6 !important;
+}
+.md-nav__link--active .submenu .md-nav__link {
+ color: #fff;
+}
+.md-nav__link--active .submenu .md-nav__link--active > a {
+ color: #00bdd6;
+}
+
+
+@media only screen and (min-width: 60em) {
+ .md-search__inner {
+ padding: 0.34rem 0;
+ }
+}
+@media only screen and (max-width: 76.1875em) {
+ .md-nav,
+ html .md-nav--primary .md-nav__title--site {
+ background-color: #282f38 !important;
+ }
+ html .md-nav--primary .md-nav__title--site .md-nav__button {
+ display: block;
+ left: 0;
+ width: 100%;
+ margin-left: 0;
+ padding-left: 0;
+ }
+ html .md-nav--primary .md-nav__title~.md-nav__list {
+ background-color: rgb(32 38 46 / 94%) !important;
+ }
+ .md-nav--primary .md-nav__item { /* menus font */
+ font-size: 0.7rem;
+ border-top: 0;
+ }
+ .md-nav__list ul.md-nav__list {
+ padding-left: 24px;
+ }
+ .md-nav__list ul.md-nav__list .md-nav__item {
+ font-size: 0.65rem;
+ }
+ html .md-nav--primary .md-nav__title {
+ height: 4rem;
+ }
+ .arrow {
+ top: 12px;
+ right: 16px;
+ }
+ .md-nav__item .md-nav__item a {
+ padding-left: 0 !important;
+ }
+ .md-nav--primary .md-nav__link {
+ padding: 0.2rem 0.8rem 0.2rem 0;
+ }
+
+}
+
+
+@media only screen and (min-width: 76.25em) {
+ .md-tabs {
+ background-color: rgb(32 38 46 / 94%) !important;
+ }
+}
+
+@media only screen and (max-width: 59.9375em) {
+ html .md-nav__link[for=__toc]~.md-nav {
+ display: none;
+ }
+ html .md-nav__link[for=__toc]:after {
+ content: none;
+ }
+ .md-nav__source {
+ background-color: #1d2228;
+ box-shadow: 0 0 0.2rem rgb(0 0 0 / 10%), 0 0.2rem 0.4rem rgb(0 0 0 / 20%);
+ }
+}
+
+@media only screen and (min-width: 45em) {
+ .md-footer-copyright {
+ max-width: 100%;
+ float: none;
+ }
+
+}
diff --git a/docs/_static/script.js b/docs/_static/script.js
new file mode 100644
index 000000000000..2ef0ec251c9b
--- /dev/null
+++ b/docs/_static/script.js
@@ -0,0 +1,66 @@
+$(document).ready(function(){
+ setmenu();
+
+ function setmenu() {
+ $("#menu .md-nav__link--active").each(function() {
+
+ if($(this).parent().closest('.submenu').length!=0){
+ $(this).children().closest('.submenu').addClass('active-submenu').slideDown(220);
+ $(this).children().closest('.arrow').addClass("arrow-animate");
+
+ submenus = $(this).parent().closest('.submenu');
+ $(submenus).parent().closest('.md-nav__item').addClass("parent-active-menu");
+ $(submenus).addClass('active-submenu').slideDown(220);
+
+ submenus = $(submenus).parent().closest('.submenu');
+ $(submenus).parent().closest('.md-nav__item').addClass("parent-active-menu");
+ $(submenus).addClass('active-submenu').slideDown(220);
+
+ } else {
+ submenus = $(this).children().closest('.submenu');
+ $(submenus).parent().closest('.md-nav__item').addClass("parent-active-menu");
+ $(submenus).addClass('active-submenu').slideDown(220);
+ }
+ setarrows();
+ });
+ }
+
+ function setarrows(){
+ $(".parent-active-menu").each(function() {
+ $(this).children().closest('.arrow').addClass("arrow-animate");
+ });
+ }
+
+ $('.arrow').on('click', function(e) {
+ if($(this).hasClass('arrow-animate')){
+ $(this).removeClass('arrow-animate');
+ $(this).next().slideUp(220);
+ } else {
+ parent=$(this).parent();
+ //Main menu
+ if($(parent).parent().hasClass('md-nav__list')){
+ $(".arrow-animate").each(function() {
+ currentParent=$(this).parent();
+ if($(currentParent).parent().hasClass('md-nav__list')){
+ $(this).removeClass('arrow-animate');
+ $(this).next().slideUp(220);
+ }
+ });
+ }else{
+ //Submenu
+ parent=$(this).closest('li').siblings().has('span');
+ $(parent).children().each(function() {
+ if($(this).hasClass('arrow-animate')){
+ $(this).removeClass('arrow-animate');
+ $(this).next().slideUp(220);
+ }
+ });
+ }
+ $(this).addClass('arrow-animate');
+ $(this).next().slideDown(220);
+ }
+
+ });
+
+
+});
\ No newline at end of file
diff --git a/docs/_templates/globaltoc.html b/docs/_templates/globaltoc.html
new file mode 100644
index 000000000000..0beafdd9bf16
--- /dev/null
+++ b/docs/_templates/globaltoc.html
@@ -0,0 +1,27 @@
+{% set toctree = toctree(maxdepth=theme_globaltoc_depth|toint, collapse=theme_globaltoc_collapse|tobool, includehidden=theme_globaltoc_includehidden|tobool) %}
+{% if toctree and sidebars and 'globaltoc.html' in sidebars %}
+ {% set toctree_nodes = derender_toc(toctree, False) %}
+
+ {# TODO: Fallback to toc? #}
+{% endif %}
\ No newline at end of file
diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html
index 2d0624f3a7d0..9b7021bfdc5e 100644
--- a/docs/_templates/layout.html
+++ b/docs/_templates/layout.html
@@ -1,5 +1,4 @@
-{# Import the theme's layout. #}
-{% extends '!layout.html' %}
+{%- extends "basic/layout.html" %}
{% set sphinx_material_include_searchbox=True %}
@@ -39,7 +38,7 @@
}
{% endblock %}
-
+
@@ -67,7 +66,7 @@