From 4f37c39ae0aec4fd20b7ab01e7f9c99b9358784c Mon Sep 17 00:00:00 2001 From: Trevor Bekolay Date: Tue, 7 Nov 2023 10:45:18 -0600 Subject: [PATCH 1/3] Update NengoBones and fix checks --- .github/workflows/ci.yml | 14 +++++++++++--- .templates/LICENSE.rst.template | 2 +- LICENSE.rst | 3 ++- docs/conf.py | 2 +- docs/examples/custom-module.ipynb | 2 +- docs/modules/nengo_spa.rst | 2 +- nengo_spa/modules/thalamus.py | 1 + nengo_spa/modules/transcode.py | 10 +++++----- nengo_spa/networks/identity_ensemble_array.py | 3 ++- nengo_spa/vocabulary.py | 4 ++-- pyproject.toml | 2 +- setup.py | 4 +--- 12 files changed, 29 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28f643a2f..9b420e8af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,10 @@ on: required: false default: false +defaults: + run: + shell: bash -el {0} + jobs: test: runs-on: ubuntu-latest @@ -25,9 +29,9 @@ jobs: - script: static - script: docs - script: test - numpy-version: numpy==1.16.0 + numpy-version: numpy==1.21.0 scipy-version: scipy==1.4.1 - python-version: "3.7" + python-version: "3.8" - script: test python-version: "3.9" - script: test-coverage @@ -38,11 +42,15 @@ jobs: env: NUMPY: ${{ matrix.numpy-version || 'numpy' }} SCIPY: ${{ matrix.scipy-version || 'scipy' }} - GH_TOKEN: ${{ secrets.GH_TOKEN }} + GH_TOKEN: ${{ secrets.PUBLIC_GH_TOKEN }} steps: - uses: nengo/nengo-bones/actions/setup@main with: python-version: ${{ matrix.python-version || '3.8' }} + - name: Install pandoc + if: ${{ matrix.script == 'docs' }} + run: | + micromamba install pandoc - uses: nengo/nengo-bones/actions/generate-and-check@main - uses: nengo/nengo-bones/actions/run-script@main with: diff --git a/.templates/LICENSE.rst.template b/.templates/LICENSE.rst.template index c24b110b1..d343b5d59 100644 --- a/.templates/LICENSE.rst.template +++ b/.templates/LICENSE.rst.template @@ -8,7 +8,7 @@ NengoSPA imports several open source libraries: * `NumPy `_ - Used under `BSD license `__ * `Sphinx `_ - Used under - `BSD license `__ + `BSD license `__ * `nbsphinx `_ - Used under `MIT license `__ * `matplotlib `_ - Used under diff --git a/LICENSE.rst b/LICENSE.rst index 0344ab75f..3f23f7795 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -27,6 +27,7 @@ If you have any technical support questions, please post them on the ABR community forums at ``_ or contact ``_. + Licensed code ============= @@ -35,7 +36,7 @@ NengoSPA imports several open source libraries: * `NumPy `_ - Used under `BSD license `__ * `Sphinx `_ - Used under - `BSD license `__ + `BSD license `__ * `nbsphinx `_ - Used under `MIT license `__ * `matplotlib `_ - Used under diff --git a/docs/conf.py b/docs/conf.py index 794820c5d..b3446c49a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -107,7 +107,7 @@ var _paq = window._paq = window._paq || []; _paq.push(["setDocumentTitle", document.domain + "/" + document.title]); _paq.push(["setCookieDomain", "*.appliedbrainresearch.com"]); - _paq.push(["setDomains", ["*.appliedbrainresearch.com","*.edge.nengo.ai","*.forum.nengo.ai","*.labs.nengo.ai","*.nengo.ai"]]); + _paq.push(["setDomains", ["*.appliedbrainresearch.com","*.edge.nengo.ai","*.forum.nengo.ai","*.nengo.ai"]]); _paq.push(["enableCrossDomainLinking"]); _paq.push(["setDoNotTrack", true]); _paq.push(['trackPageView']); diff --git a/docs/examples/custom-module.ipynb b/docs/examples/custom-module.ipynb index 4597bd618..37667a81f 100644 --- a/docs/examples/custom-module.ipynb +++ b/docs/examples/custom-module.ipynb @@ -60,7 +60,7 @@ " self,\n", " vocab=nengo.params.Default,\n", " neurons_per_dimension=nengo.params.Default,\n", - " **kwargs\n", + " **kwargs,\n", " ):\n", " super(GatedMemory, self).__init__(**kwargs)\n", "\n", diff --git a/docs/modules/nengo_spa.rst b/docs/modules/nengo_spa.rst index b7f5b78be..50ff4fa97 100644 --- a/docs/modules/nengo_spa.rst +++ b/docs/modules/nengo_spa.rst @@ -13,7 +13,7 @@ nengo\_spa .. function:: nengo_spa.ifmax([name,] condition, actions) - Defines a potential aciton within an `ActionSelection` context. + Defines a potential action within an `ActionSelection` context. :param name: Name for the action. Can be omitted. :type name: str diff --git a/nengo_spa/modules/thalamus.py b/nengo_spa/modules/thalamus.py index 2e0c87f98..242284b2c 100644 --- a/nengo_spa/modules/thalamus.py +++ b/nengo_spa/modules/thalamus.py @@ -242,6 +242,7 @@ def connect_gate(self, index, channel): else: raise NotImplementedError() + # pylint: disable=invalid-unary-operand-type inhibit = [[-self.route_inhibit]] * (target.size_in) self.gate_out_connections[index] = nengo.Connection( self.gates[index], target, transform=inhibit, synapse=self.synapse_inhibit diff --git a/nengo_spa/modules/transcode.py b/nengo_spa/modules/transcode.py index f20392864..5eeafaef8 100644 --- a/nengo_spa/modules/transcode.py +++ b/nengo_spa/modules/transcode.py @@ -44,20 +44,20 @@ def parse_func(*args): class TranscodeFunctionParam(Parameter): - def coerce(self, obj, fn): - fn = super(TranscodeFunctionParam, self).coerce(obj, fn) + def coerce(self, instance, value): + fn = super(TranscodeFunctionParam, self).coerce(instance, value) pointer_cls = (SemanticPointer, PointerSymbol) if fn is None: return fn elif callable(fn): - return self.coerce_callable(obj, fn) - elif not obj.input_vocab and isinstance(fn, (str, pointer_cls)): + return self.coerce_callable(instance, fn) + elif not instance.input_vocab and isinstance(fn, (str, pointer_cls)): return fn else: raise ValidationError( - f"Invalid output type {type(fn)!r}", attr=self.name, obj=obj + f"Invalid output type {type(fn)!r}", attr=self.name, obj=instance ) def coerce_callable(self, obj, fn): diff --git a/nengo_spa/networks/identity_ensemble_array.py b/nengo_spa/networks/identity_ensemble_array.py index 20d9fbe09..e6e5915eb 100644 --- a/nengo_spa/networks/identity_ensemble_array.py +++ b/nengo_spa/networks/identity_ensemble_array.py @@ -187,7 +187,8 @@ def add_output(self, name, function, synapse=None, **conn_kwargs): raise ValidationError( "Must provide one function per ensemble or one function " "each for the first ensemble, the second ensembles, and " - "all remaining ensembles." + "all remaining ensembles.", + attr="function", ) first_fn = function[0] second_fn = function[1] diff --git a/nengo_spa/vocabulary.py b/nengo_spa/vocabulary.py index b927d62ca..415da3673 100644 --- a/nengo_spa/vocabulary.py +++ b/nengo_spa/vocabulary.py @@ -544,8 +544,8 @@ class VocabularyMapParam(nengo.params.Parameter): Sequences of `.Vocabulary` will be coerced to `.VocabularyMap`. """ - def coerce(self, instance, vocab_set): - vocab_set = super(VocabularyMapParam, self).coerce(instance, vocab_set) + def coerce(self, instance, value): + vocab_set = super(VocabularyMapParam, self).coerce(instance, value) if vocab_set is not None and not isinstance(vocab_set, VocabularyMap): try: diff --git a/pyproject.toml b/pyproject.toml index 4e723bccd..b663dab7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ requires = ["setuptools<64", "wheel"] [tool.black] -target-version = ['py36'] +target-version = ['py38'] [tool.isort] profile = "black" diff --git a/setup.py b/setup.py index 131fc34db..4852e2bfe 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - # Automatically generated by nengo-bones, do not edit this file directly import io @@ -72,7 +70,7 @@ def read(*filenames, **kwargs): "optional": optional_req, "tests": tests_req, }, - python_requires=">=3.6", + python_requires=">=3.8", classifiers=[ "Development Status :: 5 - Production/Stable", "Framework :: Nengo", From 5cfac98ea537b78f179db0252f2e829007f91fb5 Mon Sep 17 00:00:00 2001 From: Trevor Bekolay Date: Tue, 7 Nov 2023 10:44:15 -0600 Subject: [PATCH 2/3] Remove fractional binding We will be open sourcing NengoSPA under the GPLv2 license. Fractional binding is patent protected so we are removing it so that users do not use patented systems without realizing it. --- README.rst | 1 - docs/modules/nengo_spa.algebras.rst | 4 - docs/pyplots/power_similarity.py | 26 --- docs/user-guide.rst | 1 - docs/user-guide/fractional-binding.rst | 212 ------------------------- nengo_spa/ast/symbolic.py | 5 - nengo_spa/ast/tests/test_symbolic.py | 11 -- 7 files changed, 260 deletions(-) delete mode 100644 docs/pyplots/power_similarity.py delete mode 100644 docs/user-guide/fractional-binding.rst diff --git a/README.rst b/README.rst index 203932732..efc8c1a04 100644 --- a/README.rst +++ b/README.rst @@ -37,7 +37,6 @@ Feature highlights structures. Different binding operations/algebras can be mixed in a single model. - Seamless integration with non-SPA Nengo models. -- Binding powers and fractional bindings. Project status diff --git a/docs/modules/nengo_spa.algebras.rst b/docs/modules/nengo_spa.algebras.rst index dfb200d67..5987a1046 100644 --- a/docs/modules/nengo_spa.algebras.rst +++ b/docs/modules/nengo_spa.algebras.rst @@ -23,7 +23,6 @@ Base classes .. automodule:: nengo_spa.algebras.base :members: - :show-inheritance: :undoc-members: .. autosummary:: @@ -40,7 +39,6 @@ Holographic reduced representations (HRR) .. automodule:: nengo_spa.algebras.hrr_algebra :members: - :show-inheritance: :undoc-members: .. autosummary:: @@ -55,7 +53,6 @@ Vector-derived transformation binding (VTB) .. automodule:: nengo_spa.algebras.vtb_algebra :members: - :show-inheritance: :undoc-members: .. autosummary:: @@ -70,7 +67,6 @@ Transposed vector-derived transformation binding (TVTB) .. automodule:: nengo_spa.algebras.tvtb_algebra :members: - :show-inheritance: :undoc-members: .. autosummary:: diff --git a/docs/pyplots/power_similarity.py b/docs/pyplots/power_similarity.py deleted file mode 100644 index 239b3867a..000000000 --- a/docs/pyplots/power_similarity.py +++ /dev/null @@ -1,26 +0,0 @@ -import numpy as np - -import nengo_spa as spa -import matplotlib.pyplot as plt - -alg = spa.algebras.HrrAlgebra() -v = alg.create_vector(64, {"positive", "unitary"}) - -xs = np.linspace(1.0, 2.0) -powers = [alg.binding_power(v, x) for x in xs] -v_sims = [np.dot(v, p) for p in powers] -vv = alg.bind(v, v) -vv_sims = [np.dot(vv, p) for p in powers] - -fig = plt.figure() -ax = fig.subplots() - -ax.plot(xs, v_sims, label=r"$\vec{v}$") -ax.plot(xs, vv_sims, label=r"$\vec{v}^2$") -ax.set_xlabel("Power $p$") -ax.set_xlim(1.0, 2.0) -ax.set_ylabel(r"Cosine similarity with $\vec{v}^p$") -ax.set_ylim(0.0, 1.0) -ax.legend() - -fig.show() diff --git a/docs/user-guide.rst b/docs/user-guide.rst index b99dd9c77..fd53a3610 100644 --- a/docs/user-guide.rst +++ b/docs/user-guide.rst @@ -7,4 +7,3 @@ User Guide examples/intro-coming-from-legacy-spa.ipynb examples/custom-module.ipynb user-guide/algebras - user-guide/fractional-binding diff --git a/docs/user-guide/fractional-binding.rst b/docs/user-guide/fractional-binding.rst deleted file mode 100644 index 9410f6ab1..000000000 --- a/docs/user-guide/fractional-binding.rst +++ /dev/null @@ -1,212 +0,0 @@ -Advanced: fractional binding -============================ - -The binding of Semantic Pointers is similar to multiplication. -When you multiply a number repeatedly with itself, -you get a power of this number, e.g. :math:`x \cdot x \cdot x = x^3`. -This concept translates to binding: - -.. math:: - - \vec{v} \circledast \vec{v} \circledast \vec{v} = \vec{v}^3 - -When working with `.SemanticPointer` instances, -you can just use Python's power operator ``**``; -algebras provide a `~.AbstractAlgebra.binding_power` method: - -.. testsetup:: fractional_binding_user_guide - - import nengo_spa as spa - import numpy as np - - d = 64 - algebra = spa.algebras.HrrAlgebra() - positive = spa.SemanticPointer( - algebra.create_vector(d, {spa.algebras.CommonProperties.POSITIVE}), - algebra=algebra - ) - pointer = spa.semantic_pointer.NegativeIdentity(d) * positive - -.. testcode:: fractional_binding_user_guide - - assert np.allclose((pointer * pointer * pointer).v, (pointer ** 3).v) - assert np.allclose((pointer * pointer * pointer).v, algebra.binding_power(pointer.v, 3)) - -The exponent of such a power may also be a real (as in non-integer) number -under certain conditions, e.g. :math:`\vec{v}^{1.23}`. -We call this fractional binding -(or fractional binding powers) -as the vector will be bound only "partially" to itself. -As you let the exponent :math:`p` change from 1 to 2, -the binding power :math:`\vec{v}^p` -will transition continuously from :math:`\vec{v}` to :math:`\vec{v}^2`. - -.. plot:: pyplots/power_similarity.py - -Fractional binding is useful -because it allows encoding real-valued numbers. -One application, -where this is required, -is the representation of continuous space [komer2019]_. - - -Semantic Pointer signs ----------------------- - -Fractional exponents can only be used with certain Semantic Pointers. -Real numbers can serve here as an analogy again. -Consider, for example, :math:`(-1)^{0.5} = \sqrt{-1}`: -there is no solution within the real numbers itself -(you'd need to expand the domain to complex numbers). -Fractional exponents require a non-negative sign of the base. -The concept of a sign can be translated to Semantic Pointers, -albeit a bit more complex, -and a fractional binding requires a Semantic Pointer with non-negative sign. - -A sign of a Semantic Pointer can not just be positive, negative, or zero, -but also indefinite. -There might also be multiple types of negative signs. -Thus, the binding of two Semantic Pointers with negative signs might not be positive. -Only the binding of two Semantic Pointers with the same type of sign will yield -a positive Semantic Pointer. - -Like the sign of a number has a corresponding number -(+1 for the positive sign, —1 for the negative sign, 0 for zero), -certain Semantic Pointers will correspond to the Semantic Pointer signs. -Binding a Semantic Pointer with its sign vector will give a positive Semantic Pointer. - -How exactly the signs work depends on the :doc:`algebra `. -See the documentation of `.HrrSign`, `.VtbSign`, and `.TvtbSign` for more details. - -To determine the sign of a Semantic Pointer use the `~.SemanticPointer.sign` -method: - -.. testcode:: fractional_binding_user_guide - - sign = pointer.sign() - print("Positive?", sign.is_positive()) - print("Negative?", sign.is_negative()) - -.. testoutput:: fractional_binding_user_guide - - Positive? False - Negative? True - -A sign will also correspond to a specific Semantic Pointer. -Binding a Semantic Pointer to the inverse sign Semantic Pointer -will give a positive version of the bound Semantic Pointer -in most algebras. - -.. testcode:: fractional_binding_user_guide - - abs_pointer = ~pointer.sign().to_semantic_pointer() * pointer - print("Positive?", abs_pointer.sign().is_positive()) - -.. testoutput:: fractional_binding_user_guide - - Positive? True - -.. hint:: - - This is analogous to the sign of complex numbers: - - .. math:: - - \mathrm{sign}(z) = \frac{z}{\mathrm{abs}(z)} - - By cross-multiplying we get: - - .. math:: - - \mathrm{abs}(z) = \mathrm{sign}^{-1}(z) \cdot z - -One can also use the `~.SemanticPointer.abs` method -to obtain a positive Semantic Pointer -based on a given Semantic Pointer. -If a new positive Semantic Pointer, -without relation to an existing Semantic Pointer, -is needed, -the `.VectorsWithProperties` generator can be used: - -.. testcode:: fractional_binding_user_guide - - from nengo_spa.algebras import CommonProperties - from nengo_spa.vector_generation import VectorsWithProperties - - gen = VectorsWithProperties(d, {CommonProperties.POSITIVE}, algebra=algebra) - positive_pointer = spa.SemanticPointer(next(gen), algebra=algebra) - - print("Positive?", positive_pointer.sign().is_positive()) - -.. testoutput:: fractional_binding_user_guide - - Positive? True - - -Desirable properties for exponentiated Semantic Pointers --------------------------------------------------------- - -When increasing the exponent in a power of a number, -the result will approach either 0 or grow without bound -(:math:`\lim_{p \rightarrow \infty} x^p = 0` if :math:`0 \leq x < 1`, -:math:`\lim_{p \rightarrow \infty} x^p = \infty` if :math:`x > 1`). -The same can happen for the vector length of the binding power of a Semantic Pointer. -This might be undesirable (e.g. for representation in neurons). -Using a unitary Semantic Pointer ensures that the vectors length will stay constant. -The `.VectorsWithProperties` generator can be used -to create positive unitary Semantic Pointers: - -.. testcode:: fractional_binding_user_guide - - from nengo_spa.algebras import CommonProperties - from nengo_spa.vector_generation import VectorsWithProperties - - gen = VectorsWithProperties( - d, - {CommonProperties.POSITIVE, CommonProperties.UNITARY}, - algebra=algebra - ) - positive_unitary_pointer = spa.SemanticPointer(next(gen), algebra=algebra) - -Note that ``pointer.abs().unitary()`` or ``pointer.unitary().abs()`` is *not* -guaranteed to work because the operation of making a Semantic Pointer unitary -(positive) can destroy the property of being positive (unitary) -if not both constraints are taken into account at the same time. - -The binding powers of a positive, unitary Semantic Pointer -move around a multidimensional circle. -A negative Semantic Pointer will jump -between such multidimensional circles -with each binding -(similar to the powers of a negative number that are alternating -between positive and negative numbers). - - -Exponentiation laws -------------------- - -The usual exponentiation laws do not hold in general for binding powers, -i.e. :math:`(\vec{v}^a)^b \ne \vec{v}^{a \cdot b}` -and :math:`\vec{v}^a \cdot \vec{v}^b \ne \vec{v}^{a + b}`. -For a specific algebra, exponentiation laws might hold under certain conditions. -See `.HrrAlgebra.binding_power`, `.VtbAlgebra.binding_power`, -and `.TvtbAlgebra.binding_power` for details. - - -Negative exponents and approximate inverses -------------------------------------------- - -For real numbers, an exponent of —1 is equivalent to the multiplicative inverse. -Semantic Pointer binding powers work similar, however, -an exponent of —1 represents the approximate inverse here. -Thus, the identity :math:`(\vec{v}^a)^b = \vec{v}^{a \cdot b}` -only holds for unitary Semantic Pointers :math:`\vec{v}`. - - -References ----------- - -.. [komer2019] Komer, B., Stewart, T.C., Voelker, A.R. and Eliasmith, C. - A neural representation of continuous space using fractional binding. - Proceedings of the 41st Annual Meeting of the Cognitive Science - Society. 2019. \ No newline at end of file diff --git a/nengo_spa/ast/symbolic.py b/nengo_spa/ast/symbolic.py index 30aa20f0f..5d97d9e75 100644 --- a/nengo_spa/ast/symbolic.py +++ b/nengo_spa/ast/symbolic.py @@ -138,11 +138,6 @@ def __truediv__(self, other): type_ = infer_types(self, other) return PointerSymbol(self._expr_tree / other._expr_tree, type_) - @symbolic_op - def __pow__(self, other): - type_ = infer_types(self, other) - return PointerSymbol(self._expr_tree**other._expr_tree, type_) - def dot(self, other): other = as_symbolic_node(other) if not isinstance(other, PointerSymbol): diff --git a/nengo_spa/ast/tests/test_symbolic.py b/nengo_spa/ast/tests/test_symbolic.py index 13062cf14..80502879f 100644 --- a/nengo_spa/ast/tests/test_symbolic.py +++ b/nengo_spa/ast/tests/test_symbolic.py @@ -73,17 +73,6 @@ def test_binary_operation_on_pointer_symbols(op, rng): assert_equal(node.output, vocab.parse("A" + op + "B").v) -@pytest.mark.parametrize("scalar", [3, np.float64(3)]) -def test_pow_operation_on_pointer_symbols(scalar, rng): - vocab = spa.Vocabulary(16, pointer_gen=rng) - vocab.populate("A") - - with spa.Network(): - x = eval("PointerSymbol('A', TVocabulary(vocab)) ** scalar") - node = x.construct() - assert_equal(node.output, vocab.parse("A ** 3").v) - - def test_pointer_symbol_mul_with_array(): with pytest.raises(TypeError): PointerSymbol("X") * np.array([1, 2]) From 9c6fb07720bdb0edc0bfab8f85fa2140dcd3bc37 Mon Sep 17 00:00:00 2001 From: Trevor Bekolay Date: Tue, 7 Nov 2023 10:53:11 -0600 Subject: [PATCH 3/3] Switch to GPL v2 license --- .nengobones.yml | 8 +- CONTRIBUTORS.rst | 3 - LICENSE.rst | 315 ++++++++++++++++++++++++++++++++++++++++--- nengo_spa/version.py | 2 +- setup.py | 4 +- 5 files changed, 302 insertions(+), 30 deletions(-) diff --git a/.nengobones.yml b/.nengobones.yml index efacc9247..a06a0cdd1 100644 --- a/.nengobones.yml +++ b/.nengobones.yml @@ -4,7 +4,7 @@ repo_name: nengo/nengo-spa description: An implementation of the Semantic Pointer Architecture for Nengo copyright_start: 2013 -license: abr-free +license: gpl-v2 main_branch: main contributing_rst: {} @@ -154,7 +154,7 @@ pyproject_toml: {} pre_commit_config_yaml: {} version_py: - major: 1 - minor: 3 - patch: 1 + major: 2 + minor: 0 + patch: 0 release: false diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index b8790c9a9..513b9b7a1 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -7,6 +7,3 @@ NengoSPA contributors See https://github.com/nengo/nengo-spa/graphs/contributors for a list of the people who have committed to NengoSPA. Thank you for your contributions! - -For the full list of the many contributors to the Nengo ecosystem, -see https://www.nengo.ai/people/. diff --git a/LICENSE.rst b/LICENSE.rst index 3f23f7795..387cf8281 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -6,26 +6,301 @@ NengoSPA license Copyright (c) 2013-2023 Applied Brain Research -**ABR License** - -NengoSPA is made available under a proprietary license, the -"ABR TECHNOLOGY LICENSE AND USE AGREEMENT" (the "ABR License"). -The main ABR License file is available for download at -``_. -The entire contents of this ``LICENSE.rst`` file, including any -terms and conditions herein, form part of the ABR License. - -Commercial Use Licenses are available to purchase for a yearly fee. -Academic and Personal Use Licenses for NengoSPA are available at -no cost. -Both types of licences can be obtained from the -ABR store at ``_. - -If you have any sales questions, -please contact ``_. -If you have any technical support questions, please post them on the ABR -community forums at ``_ or contact -``_. +**GPL v2 License** + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +:: + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public + License is intended to guarantee your freedom to share and change free + software--to make sure the software is free for all its users. This + General Public License applies to most of the Free Software + Foundation's software and to any other program whose authors commit to + using it. (Some other Free Software Foundation software is covered by + the GNU Lesser General Public License instead.) You can apply it to + your programs, too. + + When we speak of free software, we are referring to freedom, not + price. Our General Public Licenses are designed to make sure that you + have the freedom to distribute copies of free software (and charge for + this service if you wish), that you receive source code or can get it + if you want it, that you can change the software or use pieces of it + in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid + anyone to deny you these rights or to ask you to surrender the rights. + These restrictions translate to certain responsibilities for you if you + distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether + gratis or for a fee, you must give the recipients all the rights that + you have. You must make sure that they, too, receive or can get the + source code. And you must show them these terms so they know their + rights. + + We protect your rights with two steps: (1) copyright the software, and + (2) offer you this license which gives you legal permission to copy, + distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain + that everyone understands that there is no warranty for this free + software. If the software is modified by someone else and passed on, we + want its recipients to know that what they have is not the original, so + that any problems introduced by others will not reflect on the original + authors' reputations. + + Finally, any free program is threatened constantly by software + patents. We wish to avoid the danger that redistributors of a free + program will individually obtain patent licenses, in effect making the + program proprietary. To prevent this, we have made it clear that any + patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and + modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains + a notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", below, + refers to any such program or work, and a "work based on the Program" + means either the Program or any derivative work under copyright law: + that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another + language. (Hereinafter, translation is included without limitation in + the term "modification".) Each licensee is addressed as "you". + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of + running the Program is not restricted, and the output from the Program + is covered only if its contents constitute a work based on the + Program (independent of having been made by running the Program). + Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's + source code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any warranty; + and give any other recipients of the Program a copy of this License + along with the Program. + + You may charge a fee for the physical act of transferring a copy, and + you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion + of it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Program, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work based + on the Program, the distribution of the whole must be on the terms of + this License, whose permissions for other licensees extend to the + entire whole, and thus to each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is to + exercise the right to control the distribution of derivative or + collective works based on the Program. + + In addition, mere aggregation of another work not based on the Program + with the Program (or with a work based on the Program) on a volume of + a storage or distribution medium does not bring the other work under + the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms of + Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, complete source + code means all the source code for all modules it contains, plus any + associated interface definition files, plus the scripts used to + control compilation and installation of the executable. However, as a + special exception, the source code distributed need not include + anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of the + operating system on which the executable runs, unless that component + itself accompanies the executable. + + If distribution of executable or object code is made by offering + access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this License. + However, parties who have received copies, or rights, from you under + this License will not have their licenses terminated so long as such + parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify or + distribute the Program or its derivative works. These actions are + prohibited by law if you do not accept this License. Therefore, by + modifying or distributing the Program (or any work based on the + Program), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject to + these terms and conditions. You may not impose any further + restrictions on the recipients' exercise of the rights granted herein. + You are not responsible for enforcing compliance by third parties to + this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you + may not distribute the Program at all. For example, if a patent + license would not permit royalty-free redistribution of the Program by + all those who receive copies directly or indirectly through you, then + the only way you could satisfy both it and this License would be to + refrain entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable under + any particular circumstance, the balance of the section is intended to + apply and the section as a whole is intended to apply in other + circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of any + such claims; this section has the sole purpose of protecting the + integrity of the free software distribution system, which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. + + This section is intended to make thoroughly clear what is believed to + be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License + may add an explicit geographical distribution limitation excluding + those countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions + of the General Public License from time to time. Such new versions will + be similar in spirit to the present version, but may differ in detail to + address new problems or concerns. + + Each version is given a distinguishing version number. If the Program + specifies a version number of this License which applies to it and "any + later version", you have the option of following the terms and conditions + either of that version or of any later version published by the Free + Software Foundation. If the Program does not specify a version number of + this License, you may choose any version ever published by the Free Software + Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the author + to ask for permission. For software which is copyrighted by the Free + Software Foundation, write to the Free Software Foundation; we sometimes + make exceptions for this. Our decision will be guided by the two goals + of preserving the free status of all derivatives of our free software and + of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, + REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. Licensed code diff --git a/nengo_spa/version.py b/nengo_spa/version.py index 788dacd24..6e8dd8429 100644 --- a/nengo_spa/version.py +++ b/nengo_spa/version.py @@ -11,7 +11,7 @@ tagged with the version. """ -version_info = (1, 3, 1) +version_info = (2, 0, 0) name = "nengo-spa" dev = 0 diff --git a/setup.py b/setup.py index 4852e2bfe..427becce6 100755 --- a/setup.py +++ b/setup.py @@ -59,7 +59,7 @@ def read(*filenames, **kwargs): packages=find_packages(), url="https://www.nengo.ai/nengo-spa", include_package_data=True, - license="Free for non-commercial use", + license="GNU General Public License, version 2", description="An implementation of the Semantic Pointer Architecture for Nengo", long_description=read("README.rst", "CHANGES.rst"), zip_safe=False, @@ -75,7 +75,7 @@ def read(*filenames, **kwargs): "Development Status :: 5 - Production/Stable", "Framework :: Nengo", "Intended Audience :: Science/Research", - "License :: Free for non-commercial use", + "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.6",