Skip to content

Commit 3facce5

Browse files
author
Jan Schaffranek
committed
Added fastvector example
1 parent 15cc396 commit 3facce5

File tree

13 files changed

+534
-2
lines changed

13 files changed

+534
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ instance/
6969
.scrapy
7070

7171
# Sphinx documentation
72-
docs/_build/
72+
documentation/_build/
7373

7474
# PyBuilder
7575
target/

GenerateDoc.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
cd documentation
2+
call sphinx-apidoc -o source/ ../fastvector/
3+
call make html
4+
cd ..

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,31 @@
1-
# Python-Project-Template
1+
![Python](https://img.shields.io/badge/python-3.5%20%7C%203.6%20%7C%203.7-blue)
2+
![License](https://camo.githubusercontent.com/890acbdcb87868b382af9a4b1fac507b9659d9bf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)
3+
<!-- [![Release](https://img.shields.io/github/v/release/franneck94/cpp-project-template)](https://travis-ci.org/github/franneck94/Cpp-Project-Template)
4+
[![Project Status: Active.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
5+
[![Travis CI](https://api.travis-ci.org/franneck94/Cpp-Project-Template.svg?branch=master)](https://travis-ci.org/github/franneck94/Cpp-Project-Template)
6+
[![codecov](https://codecov.io/gh/franneck94/Cpp-Project-Template/branch/master/graph/badge.svg)](https://codecov.io/gh/franneck94/Cpp-Project-Template) -->
7+
8+
# Template For Python Projects
9+
10+
This is a template for Python projects. What you get:
11+
12+
- External libraries installed and managed by [Pip](https://pypi.org/project/pip/) or [Conda](https://anaconda.com/)
13+
- Setup for tests using [Pytest](https://docs.pytest.org/en/stable/)
14+
- Continuous testing with [Travis-CI](https://travis-ci.org/)
15+
- Code coverage reports, including automatic upload to [Codecov](https://codecov.io)
16+
- Code documentation with [Sphinx](https://www.sphinx-doc.org/en/master/)
17+
- Optional: Use of the [VSCode](https://code.visualstudio.com/) IDE with useful extensions, like the Python and UnitTest extensions
18+
19+
## Structure
20+
``` text
21+
├── setup.py
22+
└── documentation
23+
├── fastvector
24+
│   └── __init__.py
25+
│   └── vector.py
26+
└── tests
27+
├── test_vector.py
28+
```
29+
30+
Sources of the package go in [fastvector/](fastvector/) and
31+
tests go in [tests/](tests/).

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/source/conf.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import os
14+
import sys
15+
sys.path.insert(0, os.path.abspath('../../fastvector/'))
16+
17+
# -- Project information -----------------------------------------------------
18+
19+
project = 'FastVector'
20+
copyright = '2020, Jan Schaffranek'
21+
author = 'Jan Schaffranek'
22+
23+
# The full version, including alpha/beta/rc tags
24+
release = '0.1.0'
25+
26+
27+
# -- General configuration ---------------------------------------------------
28+
29+
# Add any Sphinx extension module names here, as strings. They can be
30+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
31+
# ones.
32+
extensions = [
33+
'sphinx.ext.viewcode',
34+
'sphinx.ext.autodoc',
35+
'numpydoc',
36+
]
37+
38+
# Add any paths that contain templates here, relative to this directory.
39+
templates_path = ['_templates']
40+
41+
# List of patterns, relative to source directory, that match files and
42+
# directories to ignore when looking for source files.
43+
# This pattern also affects html_static_path and html_extra_path.
44+
exclude_patterns = []
45+
46+
47+
# -- Options for HTML output -------------------------------------------------
48+
49+
# The theme to use for HTML and HTML Help pages. See the documentation for
50+
# a list of builtin themes.
51+
#
52+
html_theme = 'sphinx_rtd_theme'
53+
54+
# Add any paths that contain custom static files (such as style sheets) here,
55+
# relative to this directory. They are copied after the builtin static files,
56+
# so a file named 'default.css' will overwrite the builtin 'default.css'.
57+
html_static_path = ['_static']

docs/source/fastvector.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
fastvector package
2+
==================
3+
4+
Submodules
5+
----------
6+
7+
fastvector.vector module
8+
------------------------
9+
10+
.. automodule:: fastvector.vector
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
:special-members:
15+
16+
17+
Module contents
18+
---------------
19+
20+
.. automodule:: fastvector
21+
:members:
22+
:undoc-members:
23+
:show-inheritance:
24+
:special-members:

docs/source/index.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Welcome to FastVector's documentation!
2+
====================================
3+
4+
Hello this is a simple package for 2D vectors!
5+
You can do simple vector operations like: addition, subtraction, etc.
6+
7+
Indices and tables
8+
==================
9+
10+
* :ref:`genindex`
11+
* :ref:`modindex`

docs/source/modules.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fastvector
2+
=========
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
fastvector

fastvector/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .vector import VectorND

0 commit comments

Comments
 (0)