diff --git a/.travis.yml b/.travis.yml index 5f2ef9a..c93c529 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,5 @@ language: python -sudo: false - cache: directories: - $HOME/env @@ -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"; diff --git a/examples/mux/mux_files_example.py b/examples/mux/mux_files_example.py index c957bcc..82f1ba6 100644 --- a/examples/mux/mux_files_example.py +++ b/examples/mux/mux_files_example.py @@ -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()}) diff --git a/setup.py b/setup.py index e8c2055..0bfe1e6 100644 --- a/setup.py +++ b/setup.py @@ -10,10 +10,11 @@ description='Multiplex generators for incremental learning', author='Pescador developers', author_email='brian.mcfee@nyu.edu', - 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", @@ -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', diff --git a/tests/test_core.py b/tests/test_core.py index 0f7d0c4..90e51e9 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -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)) diff --git a/tests/test_mux.py b/tests/test_mux.py index 9f27351..60ccbe5 100644 --- a/tests/test_mux.py +++ b/tests/test_mux.py @@ -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', [ @@ -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 @@ -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?