Skip to content

Commit

Permalink
Merge 8468fec into 000155b
Browse files Browse the repository at this point in the history
  • Loading branch information
axelfahy committed Jun 27, 2019
2 parents 000155b + 8468fec commit de1cb5e
Show file tree
Hide file tree
Showing 22 changed files with 308 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -45,6 +45,7 @@ coverage_html_report
.cache
nosetests.xml
coverage.xml
.coveralls.yml
*.cover
.hypothesis/
.pytest_cache/
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -6,8 +6,9 @@ install:
- pip install -r requirements_dev.txt
- pip install -e .
script:
- pytest --cov=bff
- flake8 bff
- pytest --codestyle --docstyle --pylint --pylint-rcfile=.pylintrc --pylint-error-types=CWEF
- pytest --cov=bff tests
after_success:
- coveralls
deploy:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -38,7 +38,7 @@ pip install -e .
## Tests

```sh
pytest --cov==bff
make all
```

## Release History
Expand Down
20 changes: 20 additions & 0 deletions doc/Makefile
@@ -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 = source
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)
35 changes: 35 additions & 0 deletions doc/make.bat
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
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
80 changes: 80 additions & 0 deletions doc/source/conf.py
@@ -0,0 +1,80 @@
import recommonmark
from recommonmark.transform import AutoStructify

# 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:
# http://www.sphinx-doc.org/en/master/config

# -- 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 = 'bff'
copyright = '2019, Axel Fahy'
author = 'Axel Fahy'

# The full version, including alpha/beta/rc tags
release = '0.1.4'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'recommonmark',
'sphinx.ext.autodoc',
'sphinx_autodoc_typehints',
'sphinx.ext.napoleon', # Needed to separate type from variable name in docstrings.
'numpydoc',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme' # Read the Docs theme.

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Theme from Read the Docs.
html_theme_options = {
'display_version': False,
'prev_next_buttons_location': 'both',
# Toc options
'collapse_navigation': False,
'sticky_navigation': True,
}

def setup(app):
app.add_config_value('recommonmark_config', {
'url_resolver': lambda url: github_doc_root + url,
'auto_toc_tree_section': 'Contents',
}, True)
app.add_transform(AutoStructify)

22 changes: 22 additions & 0 deletions doc/source/fancy.rst
@@ -0,0 +1,22 @@
bff
===

All of bff's functions.

.. autosummary::
:nosignatures:
:toctree: generated/

bff.concat_with_categories
bff.get_peaks
bff.idict
bff.mem_usage_pd
bff.parse_date
bff.plot_history
bff.plot_predictions
bff.plot_series
bff.plot_true_vs_pred
bff.read_sql_by_chunks
bff.sliding_window
bff.value_2_list

6 changes: 6 additions & 0 deletions doc/source/generated/bff.concat_with_categories.rst
@@ -0,0 +1,6 @@
bff.concat\_with\_categories
============================

.. currentmodule:: bff

.. autofunction:: concat_with_categories
6 changes: 6 additions & 0 deletions doc/source/generated/bff.get_peaks.rst
@@ -0,0 +1,6 @@
bff.get\_peaks
==============

.. currentmodule:: bff

.. autofunction:: get_peaks
6 changes: 6 additions & 0 deletions doc/source/generated/bff.idict.rst
@@ -0,0 +1,6 @@
bff.idict
=========

.. currentmodule:: bff

.. autofunction:: idict
6 changes: 6 additions & 0 deletions doc/source/generated/bff.mem_usage_pd.rst
@@ -0,0 +1,6 @@
bff.mem\_usage\_pd
==================

.. currentmodule:: bff

.. autofunction:: mem_usage_pd
6 changes: 6 additions & 0 deletions doc/source/generated/bff.parse_date.rst
@@ -0,0 +1,6 @@
bff.parse\_date
===============

.. currentmodule:: bff

.. autofunction:: parse_date
6 changes: 6 additions & 0 deletions doc/source/generated/bff.plot_history.rst
@@ -0,0 +1,6 @@
bff.plot\_history
=================

.. currentmodule:: bff

.. autofunction:: plot_history
6 changes: 6 additions & 0 deletions doc/source/generated/bff.plot_predictions.rst
@@ -0,0 +1,6 @@
bff.plot\_predictions
=====================

.. currentmodule:: bff

.. autofunction:: plot_predictions
6 changes: 6 additions & 0 deletions doc/source/generated/bff.plot_series.rst
@@ -0,0 +1,6 @@
bff.plot\_series
================

.. currentmodule:: bff

.. autofunction:: plot_series
6 changes: 6 additions & 0 deletions doc/source/generated/bff.plot_true_vs_pred.rst
@@ -0,0 +1,6 @@
bff.plot\_true\_vs\_pred
========================

.. currentmodule:: bff

.. autofunction:: plot_true_vs_pred
6 changes: 6 additions & 0 deletions doc/source/generated/bff.read_sql_by_chunks.rst
@@ -0,0 +1,6 @@
bff.read\_sql\_by\_chunks
=========================

.. currentmodule:: bff

.. autofunction:: read_sql_by_chunks
6 changes: 6 additions & 0 deletions doc/source/generated/bff.sliding_window.rst
@@ -0,0 +1,6 @@
bff.sliding\_window
===================

.. currentmodule:: bff

.. autofunction:: sliding_window
6 changes: 6 additions & 0 deletions doc/source/generated/bff.value_2_list.rst
@@ -0,0 +1,6 @@
bff.value\_2\_list
==================

.. currentmodule:: bff

.. autofunction:: value_2_list
31 changes: 31 additions & 0 deletions doc/source/index.rst
@@ -0,0 +1,31 @@
.. bff documentation master file, created by
sphinx-quickstart on Thu Jun 27 21:58:58 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
bff
===

*Best Fancy Functions, your Best Friend Forever*

The bff package contains some utility functions from plots to data manipulations and could become your new bff.

The goal of this package is to have easy access of the functions I am using frequently on projects.

This is still a work in progress, contributions are welcome.

Contents
--------

.. toctree::
:maxdepth: 2
:caption: Getting Started

quickstart

.. toctree::
:maxdepth: 2
:caption: User Guide

fancy

39 changes: 39 additions & 0 deletions doc/source/quickstart.rst
@@ -0,0 +1,39 @@
.. _quickstart:

Quick Start
===========

Install bff
-----------

If you use ``pip``, you can install it with::

pip install bff

Development
-----------

You can run the test using::

make all

This will run unittests for code and code style checks.

Contributing
------------

Contributions are welcome!

If you want to contribute, you should proceed as follows::

1. Fork it (<https://github.com/yourname/yourproject/fork>)
2. Create your feature branch (`git checkout -b feature/fooBar`)
3. Commit your changes (`git commit -am 'Add some fooBar'`)
4. Push to the branch (`git push origin feature/fooBar`)
5. Create a new Pull Request

If this is supposed to be a new realease, the new version must be set in the tag::

git tag vx.y.z
git push --tags

5 changes: 5 additions & 0 deletions requirements_dev.txt
@@ -1,8 +1,13 @@
coveralls
flake8
numpydoc
pytest
pytest-codestyle
pytest-cov
pytest-docstyle
pytest-pylint
python-coveralls
recommonmark
Sphinx
sphinx-autodoc-typehints
sphinx-rtd-theme

0 comments on commit de1cb5e

Please sign in to comment.