Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/remove makefile #30

Merged
merged 6 commits into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ data/

### Sphinx Doc ###
docs/build/*
public/*
docs/source/api/

### Python execution ###
scripts/__pycache__/
tests/output/

12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,21 @@ install:

script:
# Run phase of our CI pipeline
- make unitTests
- make doc
# Run unitTests
- nosetests --nocapture -v tests/test.py

# Generate rst files from docstring
- sphinx-apidoc -fMeT -o docs/source/api scripts
# Build documentation
- sphinx-build docs/source docs/build
- touch docs/build/.nojekyll

deploy:
- provider: pages:git
verbose: true
edge: true
token: $GITHUB_TOKEN
local_dir: ./public/
local_dir: ./docs/build
on:
branch: master
condition: $TRAVIS_PYTHON_VERSION = 3.8
17 changes: 15 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,21 @@
This mini project was developed during the M05 course "reproducibility and open science"
taught by Idiap as part of the AI master 2020-2021.

.. topic:: Working hypothesis
Working hypothesis
------------------

It is possible to perform human activity recognition using data from continuous ambient sensors
It is possible to perform human activity recognition using data from continuous ambient sensors

Dataset
-------

The dataset that was used for this project is the following: https://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+from+Continuous+Ambient+Sensor+Data.
It represents ambient data collected in 30 homes with volunteer residents.
Data are collected continuously while residents perform their normal routines.
It contains 36 features measured plus one output for the classification label of the activity, for
a total of 13956534 entries.

Machine learning
----------------

Random forest classifiers from scikit-learn were used to obtains the results presented in this project.
42 changes: 0 additions & 42 deletions docs/Makefile

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/algorithm.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/analysis.rst

This file was deleted.

9 changes: 9 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
API Documentation
=================

Information on specific functions, classes, and methods.

.. toctree::
:glob:

api/*
35 changes: 19 additions & 16 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

# -- Project information -----------------------------------------------------
AUTHOR='Spano Amara, Devènes Steve'
VERSION = "0.1.0" # subprocess.check_output(["git", "describe"]).decode('UTF-8')
VERSION = "0.2.0"

project = 'M05 miniProject'
copyright = '2020'
author = 'Spano Amara, Devènes Steve'
import time
copyright = u"%s" % time.strftime("%Y")

author = AUTHOR

Expand All @@ -37,23 +37,35 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
#'sphinx.ext.autodoc',
"sphinx.ext.doctest",
'sphinx.ext.napoleon',
'sphinx.ext.intersphinx',
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
]

intersphinx_mapping = dict(
python=('https://docs.python.org/3', None),
numpy=("https://numpy.org/doc/stable/", None),
scipy=("https://docs.scipy.org/doc/scipy/reference", None)
)

# Generates auto-summary automatically
autosummary_generate = True

# Also document special classes like __init__
autoclass_content = 'both'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
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 = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'pastie'
pygments_style = 'sphinx'

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

Expand All @@ -71,7 +83,7 @@
# 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']
#html_static_path = ['_static']


# -- Extension configuration -------------------------------------------------
Expand All @@ -95,15 +107,6 @@
'titles_only': False,
}

# html_context = {
# "display_gitlab": True,
# "gitlab_user": "",
# "gitlab_repo": "",
# "gitlab_version": "master",
# "conf_py_path": "/docs/source/",
# "gitlab_host": "",
# }

# html_logo = '../../img/****.svg'
html_title = 'M05 MiniProject docs'

Expand Down
7 changes: 0 additions & 7 deletions docs/source/database.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/download_data.rst

This file was deleted.

4 changes: 2 additions & 2 deletions docs/source/guide.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
============
===========
User Guide
============
===========

This guide explains how to use this package and obtain results published in our
paper. Results can be re-generated automatically by executing the following
Expand Down
6 changes: 3 additions & 3 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Welcome to M05 miniProject's documentation!
===========================================
Human Activity Recognition from Continuous Ambient Sensor Data
==============================================================

Documentation
-------------
Expand All @@ -9,7 +9,7 @@ Documentation
installation
guide
troubleshooting
modules
api


Authors
Expand Down
15 changes: 9 additions & 6 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Installation
------------

This package depends on the python libraries listed in requirements.txt to run properly.
This package depends on the python libraries listed in `requirements.txt <https://github.com/sdevenes/M05_MiniProject/blob/master/requirements.txt>`_ to run properly.
Please install a modern version of these packages before trying to run the code examples.
Or create directly a conda virtual environment using the conda.yml file as in the following
Or create directly a conda virtual environment using the requirements.txt file as in the following
exemple.

To download a copy of this package, clone it from its repository in GitHub:
Expand All @@ -21,11 +21,14 @@ To download a copy of this package, clone it from its repository in GitHub:
Building the documentation
--------------------------

The project documentation is generated with sphinx and can simply be build using the command:
The project documentation is generated with sphinx and can simply be build using these two commands:

.. code:: sh

$ make doc
$ sphinx-apidoc -fMeT -o docs/source/api scripts
$ sphinx-build docs/source docs/build

The python API documentation will be automatically generated for all the python modules located
in `scripts <https://github.com/sdevenes/M05_MiniProject/tree/feature/documentation/scripts>`_, as long as their docstring is completed.
The first command will generates restructured files containing API documentation for all the python
modules located in `scripts <https://github.com/sdevenes/M05_MiniProject/tree/master/scripts>`_
based on their docstring. And the second command will packages all the rst files together and build this
html doc.
11 changes: 0 additions & 11 deletions docs/source/modules.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/paper.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Unit tests are available for the project and can be run simply with the followin

.. code-block:: shell

(project) $ make unitTests
(project) $ nosetests --nocapture -v tests/test.py

.. note::
the tests are implemented using `nose <https://pypi.org/project/nose/>`_ python package, it needs to be installed beforhand
Expand Down
22 changes: 0 additions & 22 deletions makefile

This file was deleted.