Skip to content

Commit 46fd17b

Browse files
authored
Merge branch 'master' into improve-testing
2 parents 5335fcc + a60eaf0 commit 46fd17b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+5150
-718
lines changed

.github/FUNDING.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: rtavenar

.github/ISSUE_TEMPLATE/bug_report.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
A short code sample to reproduce the code
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**Environment (please complete the following information):**
20+
- OS: [e.g. iOS]
21+
- tslearn version [e.g. 0.2.2]
22+
23+
**Additional context**
24+
Add any other context about the problem here.
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: new feature
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.

.readthedocs.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation in the docs/ directory with Sphinx
9+
sphinx:
10+
configuration: tslearn/docs/conf.py
11+
12+
# Build documentation with MkDocs
13+
#mkdocs:
14+
# configuration: mkdocs.yml
15+
16+
# Optionally build your docs in additional formats such as PDF and ePub
17+
formats: all
18+
19+
# Optionally set the version of Python and requirements required to build your docs
20+
python:
21+
version: 3.7
22+
install:
23+
- requirements: tslearn/docs/requirements_rtd.txt
24+
- method: setuptools
25+
path: .
26+
27+
build:
28+
image: latest

.travis.yml

+15-7
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@ install:
2525
- conda config --set always_yes yes --set changeps1 no
2626
- conda update -q conda
2727
- conda info -a
28-
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION Cython numpy>=1.14 scipy tensorflow keras
29-
scikit-learn numba joblib>=0.12
28+
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION Cython numpy>=1.14 scipy tensorflow==1.* keras
29+
scikit-learn numba joblib>=0.12 pandas
3030
- source activate test-environment
3131
- pip install pytest
32+
- if [[ "$TRAVIS_PYTHON_VERSION" == 3.* ]];
33+
then pip install cesium;
34+
else export DO_NOT_TEST_CESIUM_CAST=1;
35+
fi
3236
- if [[ "$NUMBA_DISABLE_JIT" == 1 ]]; then pip install coverage==4.3 "pytest-cov<2.6"; fi
3337
- pip install argparse
34-
- pip install codeclimate-test-reporter
38+
- pip install codeclimate-test-reporter codecov
3539
- rm -f tslearn/*.c
3640
- python setup.py build_ext --inplace
3741

@@ -40,10 +44,14 @@ script:
4044
- python -c "import keras.backend";
4145
sed -i -e 's/"backend":[[:space:]]*"[^"]*/"backend":\ "'$KERAS_BACKEND'/g' ~/.keras/keras.json;
4246
echo -e "Running tests with the following config:\n$(cat ~/.keras/keras.json)";
43-
- if [[ "$NUMBA_DISABLE_JIT" == 1 ]]; then
44-
python -m pytest -v tslearn tslearn/tests/ --doctest-modules --ignore tslearn/docs --ignore tslearn/deprecated.py --ignore tslearn/tests/test_estimators.py $KERAS_IGNORE --cov=tslearn;
45-
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then codeclimate-test-reporter; fi
46-
else travis_wait 40 python -m pytest -v tslearn tslearn/tests/ --doctest-modules --ignore tslearn/docs --ignore tslearn/deprecated.py $KERAS_IGNORE; fi
47+
- if [ "$NUMBA_DISABLE_JIT" == 1 ];
48+
then python -m pytest -v tslearn tslearn/tests/ --doctest-modules --ignore tslearn/docs --ignore tslearn/deprecated.py $KERAS_IGNORE --cov=tslearn;
49+
else python -m pytest -v tslearn tslearn/tests/ --doctest-modules --ignore tslearn/docs --ignore tslearn/deprecated.py $KERAS_IGNORE;
50+
fi
51+
52+
after_success:
53+
- if [ "$NUMBA_DISABLE_JIT" == 1 ]; then codeclimate-test-reporter; fi
54+
- if [ "$NUMBA_DISABLE_JIT" == 1 ]; then codecov; fi
4755

4856
notifications:
4957
email: false

CHANGELOG.md

+94-9
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,109 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4-
The format is based on
4+
The format is based on
55
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6-
and this project adheres to
6+
and this project adheres to
77
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

99
Changelogs for this project are recorded in this file since v0.2.0.
1010

11+
## [v0.3.1]
12+
13+
### Fixed
14+
15+
* Fixed a bug in `TimeSeriesSVC` and `TimeSeriesSVR` that caused user-input
16+
`gamma` to be ignored (always treated as if it were `"auto"`) for `gak` kernel
17+
18+
## [v0.3.0]
19+
20+
### Changed
21+
22+
* `dtw_barycenter_averaging` is made faster by using vectorized computations
23+
* `dtw_barycenter_averaging` can be restarted several times to reach better
24+
local optima using a parameter `n_init` set to 1 by default
25+
* Functions `load_timeseries_txt` and `save_timeseries_txt` from the utils
26+
module have changed their names to `load_time_series_txt` and
27+
`save_time_series_txt`. Old names can still be used but considered deprecated
28+
and removed from the public API documentation for the sake of harmonization
29+
* Default value for the maximum number of iterations to train `ShapeletModel`
30+
and `SerializableShapeletModel` is now set to 10,000 (used to be 100)
31+
* `TimeSeriesScalerMeanVariance` and `TimeSeriesScalerMinMax` now ignore any
32+
NaNs when calling their respective `transform` methods in order to better
33+
mirror scikit-learn's handling of missing data in preprocessing.
34+
* `KNeighborsTimeSeries` now accepts variable-length time series as inputs
35+
when used with metrics that can deal with it (eg. DTW)
36+
37+
### Added
38+
39+
* `KNeighborsTimeSeriesRegressor` is a new regressor based on
40+
k-nearest-neighbors that accepts the same metrics as
41+
`KNeighborsTimeSeriesClassifier`
42+
* A `set_weights` method is added to the `ShapeletModel` and
43+
`SerializableShapeletModel` estimators
44+
* `subsequence_path` and `subsequence_cost_matrix` are now part of the public
45+
API and properly documented as such with an example use case in which more than
46+
one path could be of interest (cf. `plot_sdtw.py`)
47+
* `verbose` levels can be set for all functions / classes that use `joblib`
48+
for parallel computations and `joblib` levels are used;
49+
* conversion functions are provided in the `utils` module to interact with
50+
other Python time series packages (`pyts`, `sktime`, `cesium`, `seglearn`,
51+
`tsfresh`, `stumpy`, `pyflux`)
52+
* `dtw_barycenter_averaging_subgradient` is now available to compute DTW
53+
barycenter based on subgradient descent
54+
* `dtw_limited_warping_length` is provided as a way to compute DTW under upper
55+
bound constraint on warping path length
56+
* `BaseModelPackage` is a base class for serializing models to hdf5, json and
57+
pickle. h5py is added to requirements for hdf5 support.
58+
* `BaseModelPackage` is used to add serialization functionality to the
59+
following models: `GlobalAlignmentKernelKMeans`, `TimeSeriesKMeans`,
60+
`KShape`, `KNeighborsTimeSeries`, `KNeighborsTimeSeriesClassifier`,
61+
`PiecewiseAggregateApproximation`, `SymbolicAggregateApproximation`,
62+
and `OneD_SymbolicAggregateApproximation`
63+
64+
### Changed
65+
66+
* When constrained DTW is used, if the name of the constraint is not given but
67+
its parameter is set, that is now considered sufficient to identify the
68+
constraint.
69+
70+
## [v0.2.4]
71+
72+
### Fixed
73+
74+
* The `tests` subdirectory is now made a python package and hence included in
75+
wheels
76+
77+
## [v0.2.2]
78+
79+
### Fixed
80+
81+
* The way version number is retrieved in `setup.py` was not working properly
82+
on Python 3.4 (and made the install script fail), switched back to the previous
83+
version
84+
85+
## [v0.2.1]
86+
87+
### Added
88+
89+
* A `RuntimeWarning` is raised when an `'itakura'` constraint is set
90+
that is unfeasible given the provided shapes.
91+
92+
### Fixed
93+
94+
* `'itakura'` and `'sakoe_chiba'` were swapped in `metrics.compute_mask`
95+
1196
## [v0.2.0]
1297

1398
### Added
1499

15-
* `tslearn` estimators are now automatically tested to match `sklearn`
16-
requirements "as much as possible" (cf. `tslearn` needs in
100+
* `tslearn` estimators are now automatically tested to match `sklearn`
101+
requirements "as much as possible" (cf. `tslearn` needs in
17102
terms of data format, _etc._)
18103
* `cdist_dtw` and `cdist_gak` now have a `n_jobs` parameter to parallelize
19104
distance computations using `joblib.Parallel`
20-
* `n_jobs` is also available as a prameter in
21-
`silhouette_score`, `TimeSeriesKMeans`, `KNeighborsTimeSeries`,
105+
* `n_jobs` is also available as a prameter in
106+
`silhouette_score`, `TimeSeriesKMeans`, `KNeighborsTimeSeries`,
22107
`KNeighborsTimeSeriesClassifier`, `TimeSeriesSVC`,
23108
`TimeSeriesSVR` and `GlobalAlignmentKernelKMeans`
24109

@@ -29,12 +114,12 @@ distance computations using `joblib.Parallel`
29114
cross-validation tools, even (for those concerned) with variable-length data
30115
* doctests have been reduced to those necessary for documentation purposes, the
31116
other tests being moved to `tests/*.py`
32-
* The list of authors for the `tslearn` bibliographic reference has been
117+
* The list of authors for the `tslearn` bibliographic reference has been
33118
updated to include Johann Faouzi and Gilles Van de Wiele
34119
* In `TimeSeriesScalerMinMax`, `min` and `max` parameters are now deprecated
35120
in favor of `value_range`. Will be removed in v0.4
36-
* In `TimeSeriesKMeans` and `silhouette_score`, `'gamma_sdtw'` is now
37-
deprecated as a key for `metric_params` in favor of `gamma`. Will be removed
121+
* In `TimeSeriesKMeans` and `silhouette_score`, `'gamma_sdtw'` is now
122+
deprecated as a key for `metric_params` in favor of `gamma`. Will be removed
38123
in v0.4
39124

40125
### Removed

CODE_OF_CONDUCT.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at [http://contributor-covenant.org/version/1/4][version]
72+
73+
[homepage]: http://contributor-covenant.org
74+
[version]: http://contributor-covenant.org/version/1/4/

0 commit comments

Comments
 (0)