Skip to content

Commit

Permalink
Merge branch 'develop' into persistence-datafusion
Browse files Browse the repository at this point in the history
  • Loading branch information
twitu committed Apr 11, 2023
2 parents a972924 + 6b1ccf8 commit cb45043
Show file tree
Hide file tree
Showing 125 changed files with 4,538 additions and 1,378 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ repos:
exclude: "docs/_pygments/monokai.py"

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.1.1
rev: v1.2.0
hooks:
- id: mypy
args: [
Expand All @@ -111,7 +111,7 @@ repos:
]

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.260
rev: v0.0.261
hooks:
- id: ruff

Expand Down
5 changes: 5 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Released on TBD (UTC).

### Enhancements
- Added `Order.signed_decimal_qty()`
- Added `Cache.orders_for_exec_algorithm(...)`
- Added `Cache.orders_for_exec_spawn(...)`
- Added `TWAPExecAlgorithm` and `TWAPExecAlgorithmConfig` to examples
- Build out `ExecAlgorithm` base class for implementing 'first class' executon algorithms
- Rewired execution for improved flow flexibility between emulated orders, execution algorithms and the `RiskEngine`
- Now stripping debug symbols after build (reduced binary sizes)

### Fixes
Expand Down
18 changes: 14 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import sysconfig
from datetime import datetime
from pathlib import Path
from typing import Optional

import numpy as np
from Cython.Build import build_ext
Expand Down Expand Up @@ -121,7 +122,9 @@ def _build_extensions() -> list[Extension]:
# disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
# https://stackoverflow.com/questions/52749662/using-deprecated-numpy-api
# From the Cython docs: "For the time being, it is just a warning that you can ignore."
define_macros = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
define_macros: list[tuple[str, Optional[str]]] = [
("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"),
]
if PROFILE_MODE or ANNOTATION_MODE:
# Profiling requires special macro directives
define_macros.append(("CYTHON_TRACE", "1"))
Expand All @@ -131,6 +134,9 @@ def _build_extensions() -> list[Extension]:

if platform.system() == "Darwin":
extra_compile_args.append("-Wno-unreachable-code-fallthrough")
extra_link_args.append("-flat_namespace")
extra_link_args.append("-undefined")
extra_link_args.append("suppress")

if platform.system() != "Windows":
# Suppress warnings produced by Cython boilerplate
Expand Down Expand Up @@ -258,8 +264,12 @@ def _strip_unneeded_symbols() -> None:
try:
print("Stripping unneeded symbols from binaries...")
for so in itertools.chain(Path("nautilus_trader").rglob("*.so")):
strip_cmd = f"strip --strip-unneeded {so}"
print(strip_cmd)
if platform.system() == "Linux":
strip_cmd = f"strip --strip-unneeded {so}"
elif platform.system() == "Darwin":
strip_cmd = f"strip -x {so}"
else:
raise RuntimeError(f"Cannot strip symbols for platform {platform.system()}")
subprocess.run(
strip_cmd,
check=True,
Expand Down Expand Up @@ -292,7 +302,7 @@ def build() -> None:
# Copy the build back into the source tree for development and wheel packaging
_copy_build_dir_to_project(cmd)

if platform.system() == "Linux":
if platform.system() in ("Linux", "Darwin"):
_strip_unneeded_symbols()


Expand Down
26 changes: 26 additions & 0 deletions docs/api_reference/execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
.. automodule:: nautilus_trader.execution
```

## Components

```{eval-rst}
.. automodule:: nautilus_trader.execution.algorithm
:show-inheritance:
:inherited-members:
:members:
:member-order: bysource
```

```{eval-rst}
.. automodule:: nautilus_trader.execution.client
:show-inheritance:
Expand All @@ -12,6 +22,14 @@
:member-order: bysource
```

```{eval-rst}
.. automodule:: nautilus_trader.execution.emulator
:show-inheritance:
:inherited-members:
:members:
:member-order: bysource
```

```{eval-rst}
.. automodule:: nautilus_trader.execution.engine
:show-inheritance:
Expand All @@ -20,6 +38,14 @@
:member-order: bysource
```

```{eval-rst}
.. automodule:: nautilus_trader.execution.matching_core
:show-inheritance:
:inherited-members:
:members:
:member-order: bysource
```

## Messages

```{eval-rst}
Expand Down
Loading

0 comments on commit cb45043

Please sign in to comment.