Skip to content

Commit

Permalink
Merge pull request #156 from hugovk/add-3.7
Browse files Browse the repository at this point in the history
Add support for Python 3.7
  • Loading branch information
bmcfee authored Aug 12, 2019
2 parents 8bfa3ca + b29eabe commit 7d14790
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
language: python

sudo: false

cache:
directories:
- $HOME/env
Expand All @@ -15,6 +13,11 @@ python:
- "3.5"
- "3.6"

matrix:
include:
- python: 3.7
dist: xenial

before_install:
- bash .travis_dependencies.sh
- export PATH="$HOME/env/miniconda$TRAVIS_PYTHON_VERSION/bin:$PATH";
Expand Down
2 changes: 1 addition & 1 deletion examples/mux/mux_files_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ def npz_generator(npz_path):
# At this point, you can use the Mux as a streamer normally:

for data in mux(max_iter=10):
print(dict((k, v.shape) for k, v in data.items()))
print({k: v.shape for k, v in data.items()})
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
description='Multiplex generators for incremental learning',
author='Pescador developers',
author_email='[email protected]',
url='http://github.com/pescadores/pescador',
download_url='http://github.com/pescadores/pescador/releases',
url='https://github.com/pescadores/pescador',
download_url='https://github.com/pescadores/pescador/releases',
packages=find_packages(),
long_description='Multiplex generators for incremental learning',
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
classifiers=[
"License :: OSI Approved :: ISC License (ISCL)",
"Programming Language :: Python",
Expand All @@ -26,6 +27,7 @@
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
keywords='machine learning',
license='ISC',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def test_streamer_cycle(generate):
gen = streamer(cycle=True)

for i, x in enumerate(gen):
data_results.append((isinstance(x, dict) and 'X' in x))
data_results.append(isinstance(x, dict) and 'X' in x)
if (i + 1) >= count_max:
break
assert (len(data_results) == count_max and all(data_results))
Expand Down
8 changes: 4 additions & 4 deletions tests/test_mux.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ def test_mux_of_mux():

train_result = list(train_mux.iterate(100))
sample_counts = collections.Counter(train_result)
assert set(sample_counts.keys()) == set([
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'])
assert set(sample_counts.keys()) == {
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'}


@pytest.mark.parametrize('mux_class', [
Expand Down Expand Up @@ -647,7 +647,7 @@ def test_shuffled_mux_with_empty_streams(self):
assert len(samples) == 30

counter = collections.Counter(samples)
assert set(counter.keys()) == set(['a', 'b', 'c'])
assert set(counter.keys()) == {'a', 'b', 'c'}
for key in ['a', 'b', 'c']:
assert counter[key] > 0

Expand All @@ -664,7 +664,7 @@ def test_shuffled_mux_weights(self):
counter = collections.Counter(samples)

# Test that there is [a, b, c] in the set
assert set(counter.keys()) == set(['a', 'b', 'c'])
assert set(counter.keys()) == {'a', 'b', 'c'}

# Test the statistics on the counts.
# Does the sampling approximately match the weights?
Expand Down

0 comments on commit 7d14790

Please sign in to comment.