From f3aecf275e5716f133d2c3d91d0631def1851731 Mon Sep 17 00:00:00 2001 From: Trevor Bekolay Date: Mon, 4 Jun 2018 19:46:07 -0400 Subject: [PATCH] Remove everything from main namespace Instead, everything should be explicitly imported from its specific submodule. --- docs/deeplearning.rst | 4 ++-- nengo_extras/__init__.py | 6 ------ nengo_extras/tests/test_convnet.py | 2 +- nengo_extras/tests/test_keras.py | 4 ++-- nengo_extras/tests/test_neurons.py | 3 +-- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/docs/deeplearning.rst b/docs/deeplearning.rst index a8b6c9c..030275d 100644 --- a/docs/deeplearning.rst +++ b/docs/deeplearning.rst @@ -160,6 +160,6 @@ Networks Processes ========= -.. autoclass:: nengo_extras.Conv2d +.. autoclass:: nengo_extras.convnet.Conv2d -.. autoclass:: nengo_extras.Pool2d +.. autoclass:: nengo_extras.convnet.Pool2d diff --git a/nengo_extras/__init__.py b/nengo_extras/__init__.py index d8d2723..79038a5 100644 --- a/nengo_extras/__init__.py +++ b/nengo_extras/__init__.py @@ -1,11 +1,5 @@ from .version import version as __version__ from .rc import rc -# --- nengo_extras namespace (API) -from .convnet import Conv2d, Pool2d -from .neurons import FastLIF, SoftLIFRate -from . import ( - camera, data, dists, graphviz, gui, networks, neurons, probe, vision) - __copyright__ = "2015-2018, Applied Brain Research" __license__ = "Free for non-commercial use; see LICENSE.rst" diff --git a/nengo_extras/tests/test_convnet.py b/nengo_extras/tests/test_convnet.py index 880e1d7..c9e17c7 100644 --- a/nengo_extras/tests/test_convnet.py +++ b/nengo_extras/tests/test_convnet.py @@ -4,7 +4,7 @@ import nengo from nengo.utils.stdlib import Timer -from nengo_extras import Conv2d, Pool2d +from nengo_extras.convnet import Conv2d, Pool2d @pytest.mark.parametrize('local', [False, True]) diff --git a/nengo_extras/tests/test_keras.py b/nengo_extras/tests/test_keras.py index 9daad42..3282d0f 100644 --- a/nengo_extras/tests/test_keras.py +++ b/nengo_extras/tests/test_keras.py @@ -23,7 +23,7 @@ def test_softlif_layer(noise_model, plt): x = np.linspace(-10, 30, nx) y = model.predict(np.ones((ni, 1)) * x) - y0 = nengo_extras.SoftLIFRate(**params).rates(x, 1., 1.) + y0 = nengo_extras.neurons.SoftLIFRate(**params).rates(x, 1., 1.) plt.plot(x, y.mean(axis=0), 'b') if noise_model != 'none': @@ -58,7 +58,7 @@ def test_softlif_derivative(noise_model, plt): x = np.linspace(-10, 30, 1024).reshape(-1, 1) dy = df([x])[0] - dy0 = nengo_extras.SoftLIFRate(**params).derivative(x, 1., 1.) + dy0 = nengo_extras.neurons.SoftLIFRate(**params).derivative(x, 1., 1.) plt.plot(x, dy) plt.plot(x, dy0, 'k--') diff --git a/nengo_extras/tests/test_neurons.py b/nengo_extras/tests/test_neurons.py index 6792b7d..5b3ef5e 100644 --- a/nengo_extras/tests/test_neurons.py +++ b/nengo_extras/tests/test_neurons.py @@ -4,8 +4,7 @@ import numpy as np import pytest -from nengo_extras import FastLIF, SoftLIFRate -from nengo_extras.neurons import rates_isi, rates_kernel +from nengo_extras.neurons import FastLIF, rates_isi, rates_kernel, SoftLIFRate def test_softlifrate_rates(plt):