Skip to content

Commit

Permalink
Update changelog and add sphinx documentation (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtilly authored Jun 17, 2021
1 parent 147c3de commit 09d1e77
Show file tree
Hide file tree
Showing 10 changed files with 186 additions and 16 deletions.
14 changes: 14 additions & 0 deletions .github/actions/docs/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Run image
description: Run private container from GitHub Packages Registry after Docker login
inputs:
python_version:
description: 'Python version'
required: true
runs:
using: 'docker'
image: docker.pkg.github.com/***REMOVED***/***REMOVED***:latest
args:
- /bin/bash
- "-l"
- "-c"
- "./.github/workflows/docs.sh ${{ inputs.python_version }}"
36 changes: 34 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,40 @@ jobs:
uses: ./.github/actions/unittests
with:
python_version: ${{ matrix.PYTHON_VERSION }}
# - name: Publish Docs
# run: cd docs/_build/html && gsutil -m cp -r * gs://***REMOVED***/${GITHUB_REPOSITORY}/${GITHUB_SHA}/
docs:
name: "Documentation"
runs-on: ubuntu-latest
env:
CI: True
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['3.8']
steps:
- name: Docker login
run: docker login docker.pkg.github.com -u ${{ github.actor }} -p ${{ secrets.FQ_GH_TOKEN }}
- name: Pull image
run: docker pull docker.pkg.github.com/***REMOVED***/***REMOVED***:latest
- name: Checkout branch
uses: actions/[email protected]
with:
ref: ${{ github.head_ref }}
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '290.0.1'
project_id: ${{ secrets.GCP_UPLOAD_PROJECT_ID }}
service_account_email: ${{ secrets.GCP_UPLOAD_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_UPLOAD_SA_KEY }}
export_default_credentials: true
- name: Run CI inside of container
uses: ./.github/actions/docs
with:
python_version: ${{ matrix.PYTHON_VERSION }}
- name: Publish Docs
run: cd docs/_build/html && gsutil -m cp -r * gs://***REMOVED***/${GITHUB_REPOSITORY}/${GITHUB_SHA}/
- name: Publish Docs as latest
run: cd docs/_build/html && gsutil -m cp -r * gs://***REMOVED***/${GITHUB_REPOSITORY}/latest/
if: github.ref == 'refs/heads/master'
linux-conda-build:
name: "Linux - conda-build - Python ${{ matrix.CONDA_BUILD_YML }}"
runs-on: ubuntu-latest
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -exo pipefail

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source ${SCRIPT_DIR}/base.sh $*

yq -Y '. + {dependencies: [.dependencies[], "python=3.8"] }' environment.yml > /tmp/environment.yml
mamba env create -f /tmp/environment.yml
conda activate $(yq -r .name environment.yml)
pip install --no-use-pep517 --no-deps --disable-pip-version-check -e .

pushd $(pwd)/docs
make html
popd
20 changes: 8 additions & 12 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,24 @@
Changelog
=========

2.0.1 - 2021-06-15
2.0.0 - 2021-06-17
------------------

**Other changes**:

We removed the dependency on ``sparse_dot_mkl``. We now use ``scipy.sparse.csr_matvec`` instead of ``sparse_dot_mkl.dot_product_mkl`` on all platforms, because the former suffered from poor performance, especially on narrow problems.
**Breaking changes**:

2.0.0 - 2021-06-10
------------------
We renamed several public functions to make them private. These include functions in :mod:`quantcore.matrix.benchmark` that are unlikely to be used outside of this package as well as

**Breaking change**:
- :func:`quantcore.matrix.dense_matrix._matvec_helper`
- :func:`quantcore.matrix.sparse_matrix._matvec_helper`.
- :func:`quantcore.matrix.split_matrix._prepare_out_array`.

Renaming several public functions to make them private.

**Other changes**:

Updating linter
- We removed the dependency on ``sparse_dot_mkl``. We now use :func:`scipy.sparse.csr_matvec` instead of :func:`sparse_dot_mkl.dot_product_mkl` on all platforms, because the former suffered from poor performance, especially on narrow problems. This also means that we removed the function :func:`quantcore.matrix.sparse_matrix._dot_product_maybe_mkl`.
- We updated the pre-commit hooks and made sure the code is line with the new hooks.


Changelog
=========

1.0.6 - 2020-04-26
------------------

Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1 change: 1 addition & 0 deletions docs/changelog.rst
34 changes: 34 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = "quantcore.matrix"
copyright = "2021, QuantCo, Inc."
author = "QuantCo, Inc."

extensions = ["numpydoc", "sphinxcontrib.apidoc"]

apidoc_module_dir = "../src/quantcore"
apidoc_output_dir = "api"
apidoc_separate_modules = True
apidoc_extra_args = ["--implicit-namespaces"]

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
18 changes: 18 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Welcome to quantcore.matrix!
==========================================

.. toctree::
:maxdepth: 2
:caption: Contents:

API Reference <api/modules>
Changelog <changelog>



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
9 changes: 7 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,19 @@ dependencies:
- flake8
- jemalloc
- libblas>=0=*mkl
- make
- mako
- matplotlib-base
- mkl-include
- numpydoc
- pandas
- pip
- pre-commit
- pytest
- pytest-xdist
- seaborn-base
- setuptools_scm
- sphinx
- sphinx_rtd_theme
- sphinxcontrib-apidoc
- xsimd
- matplotlib
- seaborn

0 comments on commit 09d1e77

Please sign in to comment.