Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
3ed08f0
Regression (#560)
joaquinvanschoren Feb 19, 2019
96db525
MAINT remove python2 support (#623)
mfeurer Feb 19, 2019
a2a4ade
[WIP] Add support for Studies (#620)
janvanrijn Feb 22, 2019
89173d1
CI: call conda install only once
mfeurer Feb 23, 2019
aa56dd2
CI: run windows tests in parallel
mfeurer Feb 23, 2019
45fe2a1
[WIP] Fix624 pep8 (#625)
PGijsbers Feb 23, 2019
19c1edd
tiny updates to study PR (#628)
janvanrijn Feb 23, 2019
3a7f5d6
install additional pytest packages
mfeurer Feb 24, 2019
b9b1c5a
CI: parallel unit tests
mfeurer Feb 24, 2019
9474029
Merge pull request #629 from openml/leaner_windows_tests
PGijsbers Feb 25, 2019
0980673
Finish pep8 compliance (#630)
mfeurer Feb 25, 2019
3a23053
adds list studies
janvanrijn Feb 25, 2019
ab5299b
PEP8
janvanrijn Feb 25, 2019
7db4c70
benchmark suite
janvanrijn Feb 25, 2019
42b9668
fix unit tests
janvanrijn Feb 26, 2019
4f60c25
comments by Matthias F.
janvanrijn Feb 26, 2019
98a73b3
Merge pull request #633 from openml/add_#632
janvanrijn Feb 26, 2019
c1defbc
Serialize lists of lists of any depth if all base elements are of typ…
PGijsbers Mar 4, 2019
ad680b5
Doc-string, generator for flatten_all.
PGijsbers Mar 4, 2019
cfb90c3
Test now only executed for sklearn>=0.20.
PGijsbers Mar 5, 2019
b9dd4a5
Add a sentinel to make sure Flow does not yet exist.
PGijsbers Mar 5, 2019
96ddc13
Add support for serializing numpy data types. (#635)
PGijsbers Mar 5, 2019
0e2fc2e
Merge branch 'develop' into fix636
PGijsbers Mar 5, 2019
aa41e59
Refactored for legibility and added comments.
PGijsbers Mar 5, 2019
0235c51
Refactoring run_flow_on_task and doc add for run_model (#516)
ArlindKadra Mar 6, 2019
0a44218
Comment for clarification.
PGijsbers Mar 6, 2019
ab208e0
Add comments and deserialization check to unit test.
PGijsbers Mar 6, 2019
b98987e
Merge branch 'develop' into fix636
PGijsbers Mar 6, 2019
9c74931
Merge pull request #637 from openml/fix636
PGijsbers Mar 6, 2019
94102f3
[MRG] EHN: Add support for pandas DataFrame and SparseDataFrame when …
glemaitre Mar 7, 2019
aecb6ac
Fix612 lazy download dataset (#644)
PGijsbers Mar 18, 2019
5123588
Fix check_datasets_active and corresponding unit test (#642)
PGijsbers Mar 18, 2019
6b081c5
added unit test for new studies (#649)
joaquinvanschoren Mar 19, 2019
3984a64
Prefer lazy loading in unit tests (#655)
PGijsbers Apr 1, 2019
7ec429e
Fix backwards compatibility #646. (#654)
PGijsbers Apr 1, 2019
0f8b7f0
Extension interface (#647)
mfeurer Apr 8, 2019
7e8e904
added upload time and error to list runs (#661)
sahithyaravi Apr 8, 2019
6b5dfe6
Lazy download of data splits (#659)
Neeratyoy Apr 9, 2019
4e3ac42
Issue #621 - better error messages on listing queries. Adding check …
timandrews335 Apr 10, 2019
2db5ec8
fix mypy issues, improve docs
mfeurer Apr 10, 2019
3dc6dee
Merge pull request #668 from openml/fixes
PGijsbers Apr 10, 2019
049b16a
Specify build dependencies through pyproject. Add project_urls, updat…
PGijsbers Apr 10, 2019
ed4912e
Change check for error message as could not sdist off old setup.
PGijsbers Apr 10, 2019
b20102d
Minor text fixes.
PGijsbers Apr 10, 2019
8cc1436
add tag_entity as backend (#667)
sahithyaravi Apr 11, 2019
03210c1
It seems scipy and numpy are no longer required for scikit-learn, and…
PGijsbers Apr 15, 2019
4770a9e
Moved requirements to setup, use requirements of setup file to config…
PGijsbers Apr 15, 2019
5b56127
Fixes a bug that prevents openml from finding the config file (#651)
joaquinvanschoren Apr 15, 2019
0b688e5
Require Python >=3.5
PGijsbers Apr 15, 2019
69e6162
Documentation. Install scikit-learn after OpenML to make sure install…
PGijsbers Apr 15, 2019
28c289f
Add type hint. Just to see if builds are cancelled.
PGijsbers Apr 15, 2019
6a17a48
Type hint. Again to see if rolling build cancels job properly.
PGijsbers Apr 15, 2019
62dd7fb
Type hint. Again a test for Appveyor rolling builds.
PGijsbers Apr 15, 2019
7179553
Type Hint. Test OpenML Appveyor.
PGijsbers Apr 15, 2019
be69384
Type hint. Appveyor test.
PGijsbers Apr 15, 2019
20292c7
Type hint. Appveyor test.
PGijsbers Apr 15, 2019
3937080
Type hint. Appveyor test.
PGijsbers Apr 15, 2019
cf21930
base functionality
janvanrijn Apr 15, 2019
431cc1a
Type hint. Appveyor test.
PGijsbers Apr 15, 2019
6169dec
Type hint. Appveyor test.
PGijsbers Apr 15, 2019
c61064a
All dependencies should be installed through the dependency resolution.
PGijsbers Apr 15, 2019
28077df
further integrated wall time
janvanrijn Apr 15, 2019
67163a2
adds docu
janvanrijn Apr 15, 2019
df8ef8b
Flake8.
PGijsbers Apr 15, 2019
98012d5
typo.
PGijsbers Apr 15, 2019
bf34e11
Remove commented out code.
PGijsbers Apr 15, 2019
7238857
incorporated Pieters review
janvanrijn Apr 15, 2019
d3c165a
removed accuracy
janvanrijn Apr 15, 2019
0608e7a
Changes to satisfy mypy.
PGijsbers Apr 15, 2019
415ee9f
Merge branch 'develop' into pyproject
PGijsbers Apr 15, 2019
a8e92fc
extension refactored code
janvanrijn Apr 15, 2019
2a468f9
Merge pull request #670 from openml/pyproject
PGijsbers Apr 16, 2019
1e37a3a
Refactor for readability and flake compliance.
PGijsbers Apr 16, 2019
80dff77
Some packages only required for tests.
PGijsbers Apr 16, 2019
edef889
resolved conflict
janvanrijn Apr 16, 2019
397f94d
Make oslo a test-only dependency.
PGijsbers Apr 16, 2019
6c00e23
Fix decorator.
PGijsbers Apr 16, 2019
a0a584a
Remove old oslo imports.
PGijsbers Apr 16, 2019
c354007
bugfix
janvanrijn Apr 16, 2019
1458ad1
Flake8. Add thread safety to `get_run`.
PGijsbers Apr 16, 2019
3c39672
added return statement
janvanrijn Apr 16, 2019
69c8892
Updated with this and previous PR.
PGijsbers Apr 16, 2019
a9b0998
Fixed some documentation when I was checking if install dependencies …
PGijsbers Apr 16, 2019
1598922
fix typo.
PGijsbers Apr 16, 2019
331e827
Specify to install test dependencies for contributors.
PGijsbers Apr 16, 2019
26d4c40
Clarify for regular and contributors, since this install is also reac…
PGijsbers Apr 16, 2019
d8e678f
fix dataset parsing for categories
mfeurer Apr 16, 2019
ab8a966
Merge pull request #672 from openml/add_wallclock_measurements
PGijsbers Apr 16, 2019
8726b6c
Add comment as requested by Jan
mfeurer Apr 16, 2019
973d48a
Add note to update CONTRIBUTING.md if things in this script change.
PGijsbers Apr 16, 2019
5814b08
Merge pull request #675 from openml/fix596_dependencies
PGijsbers Apr 16, 2019
4152f91
Merge pull request #676 from openml/fix_dataset_handling
janvanrijn Apr 16, 2019
38e02ef
simplify extension interface
mfeurer Apr 15, 2019
fc46df7
simplify interface further
mfeurer Apr 15, 2019
4e971f4
simplify the extension interface even more
mfeurer Apr 16, 2019
2228059
fix test & pep8 & mypy
mfeurer Apr 16, 2019
deda557
add extra tests, minor refactoring
mfeurer Apr 17, 2019
8abfb23
pep8 and better docstrings
mfeurer Apr 17, 2019
7565e1a
make regex more leniant
mfeurer Apr 17, 2019
2f2c555
incorporate pieter's feedback
mfeurer Apr 18, 2019
2d2d3ed
incorporate pieter's feedback
mfeurer Apr 18, 2019
e354b04
incorporate pieter's feedback
mfeurer Apr 18, 2019
dfe864a
incorporate pieter's feedback
mfeurer Apr 18, 2019
5465c67
Overwrite default code highlighting styles in favor of something with…
PGijsbers Apr 18, 2019
6f50aae
update example on the front docs page
mfeurer Apr 18, 2019
101e9a1
update docs a bit more
mfeurer Apr 18, 2019
16cd03c
Merge pull request #681 from openml/update_startpage_example
PGijsbers Apr 18, 2019
292023e
incorporate pieter's feedback
mfeurer Apr 18, 2019
c7db122
Split study into separate study and suite objects (#682)
mfeurer Apr 19, 2019
c559d11
Added notice to all examples for using the test server. Use test serv…
PGijsbers Apr 19, 2019
e4e385b
Fix59 (#683)
PGijsbers Apr 19, 2019
0b01581
fix prediction indexing
mfeurer Apr 19, 2019
1c5bdd7
add useful error message
mfeurer Apr 19, 2019
46ec3ab
Easy access test server (#680)
PGijsbers Apr 19, 2019
7688c84
Merge branch 'develop' into update_examples
mfeurer Apr 19, 2019
23ccf0f
update function names to reflect recent renaming
mfeurer Apr 19, 2019
2b35edc
update gitignore (#686)
mfeurer Apr 20, 2019
f0ad953
fix examples
mfeurer Apr 20, 2019
c31e6ed
reworking examples a bit based on Pieter's suggestions
mfeurer Apr 21, 2019
79c1953
Merge pull request #684 from openml/update_examples
PGijsbers Apr 23, 2019
f656062
Merge pull request #673 from openml/improve_extension_interface
PGijsbers Apr 23, 2019
813daeb
[WIP] Task upload (#607)
ArlindKadra Apr 26, 2019
72f131a
[MRG] Fix402 (#677)
PGijsbers Apr 29, 2019
7129cf0
Option to return dataframes for listing functions (#662)
Neeratyoy Apr 30, 2019
e049fc6
Changelog update, minor template updates. (#691)
PGijsbers May 10, 2019
eec86a9
New example for evalutions (#688)
Neeratyoy May 13, 2019
4257c48
Removing dependency on scipy.io.arff (#693)
Neeratyoy May 28, 2019
ca3a25f
Fix bugs by using live server due to reduced volatility (#698)
mfeurer May 29, 2019
bed8652
Apidocs (#692)
Neeratyoy May 29, 2019
70bdb54
use older scipy version for older sklearn version
mfeurer May 28, 2019
d3f674f
fix bash syntax error
mfeurer May 28, 2019
5618eb4
try creating tasks multiple times
mfeurer May 29, 2019
c8e8d7c
add error code documentation
mfeurer May 29, 2019
4adb83f
Add else statement to task creation loop
mfeurer May 29, 2019
a25f977
Merge pull request #700 from openml/fix_bugs
PGijsbers May 29, 2019
461814d
prepare new release (#705)
mfeurer Jun 4, 2019
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
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ nosetests.xml
coverage.xml
*,cover
.hypothesis/
prof/

# Translations
*.mo
Expand All @@ -74,3 +75,11 @@ target/
# IDE
.idea
*.swp

# MYPY
.mypy_cache
dmypy.json
dmypy.sock

# Tests
.pytest_cache
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ env:
- TEST_DIR=/tmp/test_dir/
- MODULE=openml
matrix:
- DISTRIB="conda" PYTHON_VERSION="2.7" SKLEARN_VERSION="0.20.0"
- DISTRIB="conda" PYTHON_VERSION="3.5" SKLEARN_VERSION="0.20.0"
- DISTRIB="conda" PYTHON_VERSION="3.6" SKLEARN_VERSION="0.20.0"
- DISTRIB="conda" PYTHON_VERSION="3.7" SKLEARN_VERSION="0.20.0" RUN_FLAKE8="true" SKIP_TESTS="true"
- DISTRIB="conda" PYTHON_VERSION="3.7" SKLEARN_VERSION="0.20.0" COVERAGE="true" DOCPUSH="true"
# Checks for older scikit-learn versions (which also don't nicely work with
# Python3.7)
- DISTRIB="conda" PYTHON_VERSION="3.6" SKLEARN_VERSION="0.19.2"
- DISTRIB="conda" PYTHON_VERSION="3.6" SKLEARN_VERSION="0.18.2"
- DISTRIB="conda" PYTHON_VERSION="3.6" SKLEARN_VERSION="0.18.2" SCIPY_VERSION=1.2.0

# Travis issue
# https://github.com/travis-ci/travis-ci/issues/8920
Expand Down
50 changes: 33 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local disk:
$ cd openml-python
```

3. Swith to the ``develop`` branch:
3. Switch to the ``develop`` branch:

```bash
$ git checkout develop
Expand All @@ -31,7 +31,8 @@ local disk:
$ git checkout -b feature/my-feature
```

Always use a ``feature`` branch. It's good practice to never work on the ``master`` or ``develop`` branch! To make the nature of your pull request easily visible, please perpend the name of the branch with the type of changes you want to merge, such as ``feature`` if it contains a new feature, ``fix`` for a bugfix, ``doc`` for documentation and ``maint`` for other maintenance on the package.
Always use a ``feature`` branch. It's good practice to never work on the ``master`` or ``develop`` branch!
To make the nature of your pull request easily visible, please prepend the name of the branch with the type of changes you want to merge, such as ``feature`` if it contains a new feature, ``fix`` for a bugfix, ``doc`` for documentation and ``maint`` for other maintenance on the package.

4. Develop the feature on your feature branch. Add changed files using ``git add`` and then ``git commit`` files:

Expand Down Expand Up @@ -59,18 +60,25 @@ We recommended that your contribution complies with the
following rules before you submit a pull request:

- Follow the
[pep8 style guilde](https://www.python.org/dev/peps/pep-0008/).
[pep8 style guide](https://www.python.org/dev/peps/pep-0008/).
With the following exceptions or additions:
- The max line length is 100 characters instead of 80.
- When creating a multi-line expression with binary operators, break before the operator.
- Add type hints to all function signatures.
(note: not all functions have type hints yet, this is work in progress.)
- Use the [`str.format`](https://docs.python.org/3/library/stdtypes.html#str.format) over [`printf`](https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting) style formatting.
E.g. use `"{} {}".format('hello', 'world')` not `"%s %s" % ('hello', 'world')`.
(note: old code may still use `printf`-formatting, this is work in progress.)

- If your pull request addresses an issue, please use the pull request title
to describe the issue and mention the issue number in the pull request description. This will make sure a link back to the original issue is
created.

- An incomplete contribution -- where you expect to do more work before
receiving a full review -- should be prefixed `[WIP]` (to indicate a work
in progress) and changed to `[MRG]` when it matures. WIPs may be useful
receiving a full review -- should be submitted as a `draft`. These may be useful
to: indicate you are working on something to avoid duplicated work,
request broad review of functionality or API, or seek collaborators.
WIPs often benefit from the inclusion of a
Drafts often benefit from the inclusion of a
[task list](https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments)
in the PR description.

Expand Down Expand Up @@ -105,18 +113,18 @@ tools:
$ pytest --cov=. path/to/tests_for_package
```

- No pyflakes warnings, check with:
- No style warnings, check with:

```bash
$ pip install pyflakes
$ pyflakes path/to/module.py
$ pip install flake8
$ flake8 --ignore E402,W503 --show-source --max-line-length 100
```

- No PEP8 warnings, check with:
- No mypy (typing) issues, check with:

```bash
$ pip install pep8
$ pep8 path/to/module.py
$ pip install mypy
$ mypy openml --ignore-missing-imports --follow-imports skip
```

Filing bugs
Expand Down Expand Up @@ -151,8 +159,8 @@ following rules before submitting:
New contributor tips
--------------------

A great way to start contributing to scikit-learn is to pick an item
from the list of [Easy issues](https://github.com/openml/openml-python/issues?q=label%3Aeasy)
A great way to start contributing to openml-python is to pick an item
from the list of [Good First Issues](https://github.com/openml/openml-python/labels/Good%20first%20issue)
in the issue tracker. Resolving these issues allow you to start
contributing to the project without much prior knowledge. Your
assistance in this area will be greatly appreciated by the more
Expand All @@ -175,6 +183,14 @@ information.

For building the documentation, you will need
[sphinx](http://sphinx.pocoo.org/),
[matplotlib](http://matplotlib.org/), and
[pillow](http://pillow.readthedocs.io/en/latest/).
[sphinx-bootstrap-theme](https://ryan-roemer.github.io/sphinx-bootstrap-theme/)
[sphinx-bootstrap-theme](https://ryan-roemer.github.io/sphinx-bootstrap-theme/),
[sphinx-gallery](https://sphinx-gallery.github.io/)
and
[numpydoc](https://numpydoc.readthedocs.io/en/latest/).
```bash
$ pip install sphinx sphinx-bootstrap-theme sphinx-gallery numpydoc
```
When dependencies are installed, run
```bash
$ sphinx-build -b html doc YOUR_PREFERRED_OUTPUT_DIRECTORY
```
6 changes: 5 additions & 1 deletion PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ the contribution guidelines: https://github.com/openml/openml-python/blob/master
Please make sure that:

* this pull requests is against the `develop` branch
* you updated all docs
* you updated all docs, this includes the changelog!
* for any new function or class added, please add it to doc/api.rst
* the list of classes and functions should be alphabetical
* for any new functionality, consider adding a relevant example
-->

#### Reference Issue
<!-- Example: Fixes #1234 -->

Expand Down
16 changes: 6 additions & 10 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,18 @@ install:
- rmdir C:\\cygwin /s /q

# Update previous packages and install the build and runtime dependencies of the project.
# XXX: setuptools>23 is currently broken on Win+py3 with numpy
# (https://github.com/pypa/setuptools/issues/728)
- conda update --all --yes setuptools=23
- conda install --yes nb_conda nb_conda_kernels
- conda update conda --yes
- conda update --all --yes

# Install the build and runtime dependencies of the project.
- "cd C:\\projects\\openml-python"
- conda install --quiet --yes scikit-learn=0.18.2
- conda install --quiet --yes mock numpy scipy pytest requests nbformat python-dateutil nbconvert pandas matplotlib seaborn
- pip install liac-arff xmltodict oslo.concurrency
- "pip install .[test]"

- "pip install .[examples,test]"
- conda install --quiet --yes scikit-learn=0.20.0


# Not a .NET project, we build scikit-learn in the install step instead
build: false

test_script:
- "cd C:\\projects\\openml-python"
- "%CMD_IN_ENV% pytest"
- "%CMD_IN_ENV% pytest -n 4 --timeout=600 --timeout-method=thread -sv --ignore='test_OpenMLDemo.py'"
143 changes: 5 additions & 138 deletions ci_scripts/flake8_diff.sh
Original file line number Diff line number Diff line change
@@ -1,140 +1,7 @@
#!/bin/bash

# Inspired from https://github.com/scikit-learn/scikit-learn/blob/master/build_tools/travis/flake8_diff.sh

# This script is used in Travis to check that PRs do not add obvious
# flake8 violations. It relies on two things:
# - find common ancestor between branch and
# openml/openml-python remote
# - run flake8 --diff on the diff between the branch and the common
# ancestor
#
# Additional features:
# - the line numbers in Travis match the local branch on the PR
# author machine.
# - ./ci_scripts/flake8_diff.sh can be run locally for quick
# turn-around

set -e
# pipefail is necessary to propagate exit codes
set -o pipefail

PROJECT=openml/openml-python
PROJECT_URL=https://github.com/$PROJECT.git

# Find the remote with the project name (upstream in most cases)
REMOTE=$(git remote -v | grep $PROJECT | cut -f1 | head -1 || echo '')

# Add a temporary remote if needed. For example this is necessary when
# Travis is configured to run in a fork. In this case 'origin' is the
# fork and not the reference repo we want to diff against.
if [[ -z "$REMOTE" ]]; then
TMP_REMOTE=tmp_reference_upstream
REMOTE=$TMP_REMOTE
git remote add $REMOTE $PROJECT_URL
fi

echo "Remotes:"
echo '--------------------------------------------------------------------------------'
git remote --verbose

# Travis does the git clone with a limited depth (50 at the time of
# writing). This may not be enough to find the common ancestor with
# $REMOTE/develop so we unshallow the git checkout
if [[ -a .git/shallow ]]; then
echo -e '\nTrying to unshallow the repo:'
echo '--------------------------------------------------------------------------------'
git fetch --unshallow
fi

if [[ "$TRAVIS" == "true" ]]; then
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]
then
# In main repo, using TRAVIS_COMMIT_RANGE to test the commits
# that were pushed into a branch
if [[ "$PROJECT" == "$TRAVIS_REPO_SLUG" ]]; then
if [[ -z "$TRAVIS_COMMIT_RANGE" ]]; then
echo "New branch, no commit range from Travis so passing this test by convention"
exit 0
fi
COMMIT_RANGE=$TRAVIS_COMMIT_RANGE
fi
else
# We want to fetch the code as it is in the PR branch and not
# the result of the merge into develop. This way line numbers
# reported by Travis will match with the local code.
LOCAL_BRANCH_REF=travis_pr_$TRAVIS_PULL_REQUEST
# In Travis the PR target is always origin
git fetch origin pull/$TRAVIS_PULL_REQUEST/head:refs/$LOCAL_BRANCH_REF
fi
fi

# If not using the commit range from Travis we need to find the common
# ancestor between $LOCAL_BRANCH_REF and $REMOTE/develop
if [[ -z "$COMMIT_RANGE" ]]; then
if [[ -z "$LOCAL_BRANCH_REF" ]]; then
LOCAL_BRANCH_REF=$(git rev-parse --abbrev-ref HEAD)
fi
echo -e "\nLast 2 commits in $LOCAL_BRANCH_REF:"
echo '--------------------------------------------------------------------------------'
git --no-pager log -2 $LOCAL_BRANCH_REF

REMOTE_DEV_REF="$REMOTE/develop"
# Make sure that $REMOTE_DEV_REF is a valid reference
echo -e "\nFetching $REMOTE_DEV_REF"
echo '--------------------------------------------------------------------------------'
git fetch $REMOTE develop:refs/remotes/$REMOTE_DEV_REF
LOCAL_BRANCH_SHORT_HASH=$(git rev-parse --short $LOCAL_BRANCH_REF)
REMOTE_DEV_SHORT_HASH=$(git rev-parse --short $REMOTE_DEV_REF)

COMMIT=$(git merge-base $LOCAL_BRANCH_REF $REMOTE_DEV_REF) || \
echo "No common ancestor found for $(git show $LOCAL_BRANCH_REF -q) and $(git show $REMOTE_DEV_REF -q)"

if [ -z "$COMMIT" ]; then
exit 1
fi

COMMIT_SHORT_HASH=$(git rev-parse --short $COMMIT)

echo -e "\nCommon ancestor between $LOCAL_BRANCH_REF ($LOCAL_BRANCH_SHORT_HASH)"\
"and $REMOTE_DEV_REF ($REMOTE_DEV_SHORT_HASH) is $COMMIT_SHORT_HASH:"
echo '--------------------------------------------------------------------------------'
git --no-pager show --no-patch $COMMIT_SHORT_HASH

COMMIT_RANGE="$COMMIT_SHORT_HASH..$LOCAL_BRANCH_SHORT_HASH"

if [[ -n "$TMP_REMOTE" ]]; then
git remote remove $TMP_REMOTE
fi

else
echo "Got the commit range from Travis: $COMMIT_RANGE"
fi

echo -e '\nRunning flake8 on the diff in the range' "$COMMIT_RANGE" \
"($(git rev-list $COMMIT_RANGE | wc -l) commit(s)):"
echo '--------------------------------------------------------------------------------'
# We need the following command to exit with 0 hence the echo in case
# there is no match
MODIFIED_FILES="$(git diff --name-only $COMMIT_RANGE || echo "no_match")"

check_files() {
files="$1"
shift
options="$*"
if [ -n "$files" ]; then
# Conservative approach: diff without context (--unified=0) so that code
# that was not changed does not create failures
git diff --unified=0 $COMMIT_RANGE -- $files | flake8 --ignore E402 --diff --show-source $options
fi
}

if [[ "$MODIFIED_FILES" == "no_match" ]]; then
echo "No file has been modified"
else

check_files "$(echo "$MODIFIED_FILES" | grep -v ^examples)"
check_files "$(echo "$MODIFIED_FILES" | grep ^examples)" \
--config ./examples/.flake8
fi
echo -e "No problem detected by flake8\n"
# Update /CONTRIBUTING.md if these commands change.
# The reason for not advocating using this script directly is that it
# might not work out of the box on Windows.
flake8 --ignore E402,W503 --show-source --max-line-length 100 $options
mypy openml --ignore-missing-imports --follow-imports skip
25 changes: 15 additions & 10 deletions ci_scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,29 @@ popd
# provided versions
conda create -n testenv --yes python=$PYTHON_VERSION pip
source activate testenv
pip install pytest pytest-xdist pytest-timeout numpy scipy cython scikit-learn==$SKLEARN_VERSION \
oslo.concurrency

if [[ -v SCIPY_VERSION ]]; then
conda install --yes scipy=$SCIPY_VERSION
fi

python --version
pip install -e '.[test]'
python -c "import numpy; print('numpy %s' % numpy.__version__)"
python -c "import scipy; print('scipy %s' % scipy.__version__)"

if [[ "$EXAMPLES" == "true" ]]; then
pip install matplotlib jupyter notebook nbconvert nbformat jupyter_client \
ipython ipykernel pandas seaborn
pip install -e '.[examples]'
fi
if [[ "$DOCTEST" == "true" ]]; then
pip install pandas sphinx_bootstrap_theme
pip install sphinx_bootstrap_theme
fi
if [[ "$COVERAGE" == "true" ]]; then
pip install codecov pytest-cov
fi
if [[ "$RUN_FLAKE8" == "true" ]]; then
pip install flake8
pip install flake8 mypy
fi

python --version
python -c "import numpy; print('numpy %s' % numpy.__version__)"
python -c "import scipy; print('scipy %s' % scipy.__version__)"
pip install -e '.[test]'
# Install scikit-learn last to make sure the openml package installation works
# from a clean environment without scikit-learn.
pip install scikit-learn==$SKLEARN_VERSION
2 changes: 1 addition & 1 deletion ci_scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ run_tests() {
PYTEST_ARGS=''
fi

pytest -n 4 --timeout=600 --timeout-method=thread -sv --ignore='test_OpenMLDemo.py' $PYTEST_ARGS $test_dir
pytest -n 4 --duration=20 --timeout=600 --timeout-method=thread -sv --ignore='test_OpenMLDemo.py' $PYTEST_ARGS $test_dir
}

if [[ "$RUN_FLAKE8" == "true" ]]; then
Expand Down
7 changes: 7 additions & 0 deletions doc/_static/codehighlightstyle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.highlight .n { color: #000000 } /* code */
.highlight .c1 { color: #1d8908 } /* comments */
.highlight .mi { color: #0d9fe3; font-weight: bold } /* integers */
.highlight .s1 { color: #d73c00 } /* string */
.highlight .o { color: #292929 } /* operators */
/* Background color for code highlights. Color for bash highlights */
pre { background-color: #fbfbfb; color: #000000 }
Loading