Skip to content

Commit

Permalink
Refactoring of visualization and depth functions.
Browse files Browse the repository at this point in the history
Merge branch 'release/0.3'
  • Loading branch information
vnmabus committed Oct 1, 2019
2 parents b50131f + e0236d9 commit 45227f2
Show file tree
Hide file tree
Showing 139 changed files with 11,807 additions and 5,237 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Code to reproduce the behavior:

```python
import skfda
...

```

**Expected behavior**
A clear and concise description of what you expected to happen, results or figures.


**Version information**
- OS: [e.g. Linux, MacOs, Windows]
- Python version: [e.g. 3.6, 3.7]
- scikit-fda version: [e.g. develop, 0.23]
- Version of other packages involved [e.g. numpy, scipy, matplotlib, ... ]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
32 changes: 30 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ matrix:
- name: "Python 3.7.1 on Xenial Linux"
python: 3.7 # this works for Linux but is ignored on macOS or Windows
dist: xenial # required for Python >= 3.7
env:
- COVERAGE=true # coverage test are only run in python 3.7
- PEP8=true # pep8 checks are only run in python 3.7
- name: "Python 3.7.2 on macOS"
os: osx
osx_image: xcode10.2 # Python 3.7.2 running on macOS 10.14.3
Expand All @@ -15,8 +18,33 @@ matrix:
language: shell # 'language: python' is an error on Travis CI Windows
before_install: choco install python
env: PATH=/c/Python37:/c/Python37/Scripts:$PATH
install: pip3 install --upgrade pip cython numpy || pip3 install --upgrade --user pip cython numpy # all three OSes agree about 'pip3'
- name: "Coverage and pep 8 tests on Python 3.7.1 on Xenial Linux"
python: 3.7 # this works for Linux but is ignored on macOS or Windows
dist: xenial # required for Python >= 3.7
env:
- PEP8COVERAGE=true # coverage test are only
install:
- pip3 install --upgrade pip cython numpy || pip3 install --upgrade --user pip cython numpy # all three OSes agree about 'pip3'
- |
if [[ $PEP8COVERAGE == true ]]; then
pip3 install flake8 || pip3 install --user flake8
pip3 install codecov pytest-cov || pip3 install --user codecov pytest-cov
fi
# 'python' points to Python 2.7 on macOS but points to Python 3.7 on Linux and Windows
# 'python3' is a 'command not found' error on Windows but 'py' works on Windows only
script: python3 setup.py test || python setup.py test
script:
- |
if [[ $PEP8COVERAGE == true ]]; then
flake8 --exit-zero skfda;
coverage run --source=skfda/ setup.py test;
else
python3 setup.py test || python setup.py test;
fi
after_success:
- |
if [[ $PEP8COVERAGE == true ]]; then
codecov
fi
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
include README.rst
include MANIFEST.in
include LICENSE
include VERSION
include pyproject.toml
include *.txt
recursive-include deps *
recursive-include deps *
123 changes: 98 additions & 25 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,48 +1,112 @@
scikit-fda
==========

|build-status| |docs|
.. image:: https://raw.githubusercontent.com/GAA-UAM/scikit-fda/develop/docs/logos/title_logo/title_logo.png
:alt: scikit-fda: Functional Data Analysis in Python

scikit-fda: Functional Data Analysis in Python
===================================================

|python|_ |build-status| |docs| |Codecov|_ |PyPIBadge|_ |license|_

Functional Data Analysis, or FDA, is the field of Statistics that analyses
data that depend on a continuous parameter.

Functional Data Analysis is the field of Statistics that analyses data that
come in the shape of functions. To know more about fda have a look at fda_ or read [RS05]_.
This package offers classes, methods and functions to give support to FDA
in Python. Includes a wide range of utils to work with functional data, and its
representation, exploratory analysis, or preprocessing, among other tasks
such as inference, classification, regression or clustering of functional data.
See documentation for further information on the features included in the
package.

Documentation
=============

This package offers classes, methods and functions to give support to fda
in Python. The idea is to give a wide range of utils to work with functional data
in Python. This utils include discrete points and basis representation of functional
data and allows to calculate basic statistics such as mean, variance or covariance,
smooth the functional data, calculate norms, distances, perform linear regression and
much more.
The documentation is available at
`fda.readthedocs.io/en/stable/ <https://fda.readthedocs.io/en/stable/>`_, which
includes detailed information of the different modules, classes and methods of
the package, along with several examples showing different funcionalities.

For more information read the documentation.
The documentation of the latest version, corresponding with the develop
version of the package, can be found at
`fda.readthedocs.io/en/latest/ <https://fda.readthedocs.io/en/latest/>`_.

Installation
============
Currently, *scikit-fda* is available in Python 3.6 and 3.7, regardless of the
platform.
The stable version can be installed via PyPI_:

.. code::
pip install scikit-fda
Installation from source
------------------------

It is possible to install the latest version of the package, available in the
develop branch, by cloning this repository and doing a manual installation.

Under construction.
.. code::
.. todo:: installation
git clone https://github.com/GAA-UAM/scikit-fda.git
cd scikit-fda/
pip install -r requirements.txt # Install dependencies
python setup.py install
Make sure that your default Python version is currently supported, or change
the python and pip commands by specifying a version, such as ``python3.6``:

.. code::
git clone https://github.com/GAA-UAM/scikit-fda.git
cd scikit-fda/
python3.6 -m pip install -r requirements.txt # Install dependencies
python3.6 setup.py install
Requirements
------------
*scikit-fda* depends on the following packages:

* `setuptools <https://github.com/pypa/setuptools>`_ - Python Packaging
* `cython <https://github.com/cython/cython>`_ - Python to C compiler
* `numpy <https://github.com/numpy/numpy>`_ - The fundamental package for scientific computing with Python
* `pandas <https://github.com/pandas-dev/pandas>`_ - Powerful Python data analysis toolkit
* `scipy <https://github.com/scipy/scipy>`_ - Scientific computation in Python
* `scikit-learn <https://github.com/scikit-learn/scikit-learn>`_ - Machine learning in Python
* `matplotlib <https://github.com/matplotlib/matplotlib>`_ - Plotting with Python
* `mpldatacursor <https://github.com/joferkington/mpldatacursor/>`_ - Interactive data cursors for matplotlib
* `rdata <https://github.com/vnmabus/rdata>`_ - Reader of R datasets in .rda format in Python
* `scikit-datasets <https://github.com/daviddiazvico/scikit-datasets>`_ - Scikit-learn compatible datasets

The dependencies are automatically installed.

Contributions
=============
All contributions are welcome. You can help this project grow in multiple ways,
from creating an issue, reporting an improvement or a bug, to doing a
repository fork and creating a pull request to the development branch.

fda is available in Python 3.5 or above, in all operating systems.
The people involved at some point in the development of the package can be
found in the `contributors
file <https://github.com/GAA-UAM/scikit-fda/blob/develop/THANKS.txt>`_.

.. todo:: test for other python versions
Citation
========
If you find this project useful, please cite:

Documentation
=============
The documentation can be found in https://fda.readthedocs.io/en/latest/
.. todo:: Include citation to scikit-fda paper.

License
=======

References
==========
The package is licensed under the BSD 3-Clause License. A copy of the
license_ can be found along with the code.

.. [RS05] Ramsay, J., Silverman, B. W. (2005). *Functional Data Analysis*. Springer.
.. _examples: https://fda.readthedocs.io/en/latest/auto_examples/index.html
.. _PyPI: https://pypi.org/project/scikit-fda/

.. _fda: http://www.functionaldata.org/
.. |python| image:: https://img.shields.io/pypi/pyversions/scikit-fda.svg
.. _python: https://badge.fury.io/py/scikit-fda

.. |build-status| image:: https://travis-ci.org/GAA-UAM/scikit-fda.svg
.. |build-status| image:: https://travis-ci.org/GAA-UAM/scikit-fda.svg?branch=develop
:alt: build status
:scale: 100%
:target: https://travis-ci.org/GAA-UAM/scikit-fda
Expand All @@ -51,3 +115,12 @@ References
:alt: Documentation Status
:scale: 100%
:target: http://fda.readthedocs.io/en/latest/?badge=latest

.. |Codecov| image:: https://codecov.io/gh/GAA-UAM/scikit-fda/branch/develop/graph/badge.svg
.. _Codecov: https://codecov.io/github/GAA-UAM/scikit-fda?branch=develop

.. |PyPIBadge| image:: https://badge.fury.io/py/scikit-fda.svg
.. _PyPIBadge: https://badge.fury.io/py/scikit-fda

.. |license| image:: https://img.shields.io/badge/License-BSD%203--Clause-blue.svg
.. _license: https://github.com/GAA-UAM/scikit-fda/blob/master/LICENSE.txt
3 changes: 2 additions & 1 deletion THANKS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Miguel Carbajo Berrocal for the basis and discrete representations of functional
Carlos Ramos Carreño for the design, reviews and supervision, and for contributing the datasets module.
Pablo Marcos Manchón for the registration functions, including integration with fdasrsf.
Amanda Hernando Bernabé for visualization and clustering functions.
Pablo Pérez Manso for regression and related utilities.
Pablo Pérez Manso for regression and related utilities.
Sergio Ruiz Lozano for the design of the logo.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.3
0.3
6 changes: 5 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#https://github.com/scikit-learn/scikit-learn/issues/8959
import pytest

# https://github.com/scikit-learn/scikit-learn/issues/8959
import numpy as np
try:
np.set_printoptions(sign=' ')
except TypeError:
pass

collect_ignore = ['setup.py']

pytest.register_assert_rewrite("skfda")
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/auto_examples/
/backreferences/
**/autosummary/
1 change: 1 addition & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ clean:
rm -rf modules/misc/autosummary
rm -rf modules/ml/autosummary
rm -rf modules/ml/clustering/autosummary
rm -rf backreferences

.PHONY: html
html:
Expand Down
7 changes: 7 additions & 0 deletions docs/_templates/autosummary/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. auto{{ objtype }}:: {{ objname }}
.. include:: {{package}}/backreferences/{{fullname}}.examples
31 changes: 31 additions & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}

{% block methods %}
.. automethod:: __init__

{% if methods %}
.. rubric:: Methods

.. autosummary::
{% for item in methods %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: Attributes

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

.. include:: {{package}}/backreferences/{{fullname}}.examples
2 changes: 2 additions & 0 deletions docs/apilist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ API Reference
=============

.. toctree::
:includehidden:
:maxdepth: 4
:caption: Modules:
:titlesonly:

modules/representation
modules/preprocessing
Expand Down
Loading

0 comments on commit 45227f2

Please sign in to comment.