Skip to content

Commit

Permalink
Merge pull request #117 from hudson-and-thames/develop
Browse files Browse the repository at this point in the history
Release 1.0.0
  • Loading branch information
Jackal08 committed May 12, 2024
2 parents e141ba1 + 9df60a8 commit 32ccd56
Show file tree
Hide file tree
Showing 60 changed files with 455 additions and 359 deletions.
8 changes: 6 additions & 2 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[bumpversion]
current_version = 0.9.1
current_version = 1.0.0
commit = False
tag = False
tag_name = {new_version}

[bumpversion:file:setup.cfg]
[bumpversion:file:pyproject.toml]
search = version = "{current_version}"
replace = version = "{new_version}"

[bumpversion:file:docs/source/conf.py]
search = release = "{current_version}"
replace = release = "{new_version}"
66 changes: 0 additions & 66 deletions .circleci/config.yml

This file was deleted.

1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ directory = build/coverage/html

[run]
branch = True
parallel = True
omit =
*__init__*
arbitragelab/network/imports.py
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/publish-final-dist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Distribution to PyPI

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]'

jobs:
build-and-publish-final-dist:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'

- name: Install Poetry
run: |
pip install poetry
- name: Install dependencies
run: |
poetry install --without docs,tests
- name: Build the package
run: |
poetry build
- name: Publish to TestPyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry publish
37 changes: 37 additions & 0 deletions .github/workflows/publish-test-dist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish Distribution to TestPyPI

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+-dev'

jobs:
build-and-publish-test-dist:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Install Poetry
run: |
pip install poetry
- name: Install dependencies
run: |
poetry install --without docs,tests
- name: Build the package
run: |
poetry build
- name: Publish to TestPyPI
env:
POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry publish -r testpypi
126 changes: 126 additions & 0 deletions .github/workflows/python-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Test code and documentation

on:
push:
branches:
- develop
pull_request:
branches:
- develop

jobs:
test-code-style:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: |
pip install --upgrade pip
pip install poetry
- name: Install dependencies
run: |
poetry install --without docs
- name: Run Pylint
run: |
poetry run pylint arbitragelab tests --rcfile=.pylintrc --output-format=text --output=pylint-report.txt
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: pylint-report-${{ matrix.python-version }}
path: pylint-report.txt


test-coverage:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: |
pip install --upgrade pip
pip install poetry
- name: Install dependencies
run: |
poetry install --without docs
- name: Run tests with coverage
run: |
poetry run pytest tests/ --cov=arbitragelab --cov-report=term --cov-branch --cov-config=.coveragerc
- name: Generate coverage HTML report
run: poetry run coverage html

- name: Upload Coverage HTML Report as Artifact
uses: actions/upload-artifact@v4
with:
name: coverage-html-${{ matrix.python-version }}
path: build/coverage/html/index.html

- name: Check coverage
run: poetry run coverage report --fail-under=100

test-docs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: |
pip install poetry
- name: Install requirements
run: |
poetry install --without tests
- name: Build documentation
run: |
cd docs
poetry run make html
- name: Run doctests
run: |
cd docs
poetry run make doctest
- name: Upload doctest results as an artifact
uses: actions/upload-artifact@v4
with:
name: doctest-results
path: docs/build/doctest/output.txt

12 changes: 6 additions & 6 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ load-plugins=
# Reference: http://pylint-messages.wikidot.com/all-codes
disable=I,
maybe-no-member,
star-args,
abstract-class-not-used,
# star-args,
# abstract-class-not-used,
duplicate-code,
superfluous-parens,
abstract-class-little-used,
# abstract-class-little-used,
too-few-public-methods,
RP0401,
RP0801,
Expand All @@ -70,7 +70,7 @@ output-format=text
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output=no
#files-output=no

# Tells whether to display a full report or only the messages
reports=yes
Expand All @@ -91,7 +91,7 @@ msg-template={C}:{line:3d},{column:2d}: [{obj}] {msg} ({msg_id} - {symbol})
[BASIC]

# List of builtins function names that should not be used, separated by a comma
bad-functions=map,filter,apply,input
#bad-functions=map,filter,apply,input

# Regular expression which should only match correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
Expand Down Expand Up @@ -275,4 +275,4 @@ int-import-graph=

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
overgeneral-exceptions=builtins.Exception
22 changes: 9 additions & 13 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

build:
os: ubuntu-22.04
os: "ubuntu-22.04"
tools:
python: "3.8"
jobs:
post_create_environment:
# Install poetry
- pip install poetry
post_install:
# Install dependencies
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --only docs

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py

# Optionally build your docs in additional formats such as PDF
formats: []

# Optionally set the version of Python and requirements required to build your docs
python:
install:
- requirements: docs/source/requirements.txt
configuration: docs/source/conf.py

1 change: 1 addition & 0 deletions arbitragelab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
ArbitrageLab helps portfolio managers and traders who want to leverage the power of Statistical Arbitrage by providing
reproducible, interpretable, and easy to use tools.
"""
# pylint: disable=consider-using-from-import

import arbitragelab.codependence as codependence
import arbitragelab.cointegration_approach as cointegration_approach
Expand Down
2 changes: 1 addition & 1 deletion arbitragelab/codependence/codependence_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from arbitragelab.codependence.optimal_transport import optimal_transport_dependence


# pylint: disable=invalid-name
# pylint: disable=invalid-name, unnecessary-lambda-assignment
def get_dependence_matrix(df: pd.DataFrame, dependence_method: str, theta: float = 0.5,
n_bins: int = None, normalize: bool = True,
estimator: str = 'standard', target_dependence: str = 'comonotonicity',
Expand Down
1 change: 1 addition & 0 deletions arbitragelab/codependence/optimal_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Implementations of Optimal Copula Transport dependence measure proposed by Marti et al.: https://arxiv.org/abs/1610.09659
And implemented in the blog post by Marti: https://gmarti.gitlab.io/qfin/2020/06/25/copula-optimal-transport-dependence.html
"""
# pylint: disable=broad-exception-raised

import warnings
import numpy as np
Expand Down
1 change: 1 addition & 0 deletions arbitragelab/cointegration_approach/coint_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
This module allows simulation of cointegrated time series pairs.
"""
# pylint: disable=consider-using-f-string

from typing import Tuple, Optional

Expand Down
Loading

0 comments on commit 32ccd56

Please sign in to comment.