Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated NengoBones #87

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
required: false
default: false

defaults:
run:
shell: bash -el {0}

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -30,11 +34,15 @@ jobs:
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_CONFIG: ${{ secrets.SSH_CONFIG }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.PUBLIC_GH_TOKEN }}
steps:
- uses: nengo/nengo-bones/actions/setup@main
with:
python-version: "3.8"
- name: Install pandoc
if: ${{ matrix.script == 'docs' }}
run: |
micromamba install pandoc
- name: Install ffmpeg for docs
if: ${{ matrix.script == 'docs' }}
uses: FedericoCarboni/setup-ffmpeg@v2
Expand Down
2 changes: 2 additions & 0 deletions .nengobones.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ docs_conf_py:
examples/notebooks/06-chaotic_attractor.html: examples/notebooks/06-chaotic-attractor.html
nengo_logo: nengo-fpga-full-light.svg
nengo_logo_color: "#541a8b"
sphinx_options:
linkcheck_ignore: [(https:\/\/www\.tulembedded\.com\/FPGA\/ProductsPYNQ-Z2\.html)]

ci_scripts:
- template: static
Expand Down
2 changes: 1 addition & 1 deletion .templates/LICENSE.rst.template
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ NengoFPGA imports or vendorizes several open source libraries.
* `NumPy <https://numpy.org/>`_ - Used under
`BSD license <https://numpy.org/doc/stable/license.html>`__
* `Sphinx <https://www.sphinx-doc.org/>`_ - Used under
`BSD license <https://github.com/sphinx-doc/sphinx/blob/master/LICENSE>`__
`BSD license <https://github.com/sphinx-doc/sphinx/blob/master/LICENSE.rst>`__
* `numpydoc <https://github.com/numpy/numpydoc>`_ - Used under
`BSD license <https://github.com/numpy/numpydoc/blob/master/LICENSE.txt>`__
* `IPython <http://ipython.org/>`_ - Used under
Expand Down
5 changes: 3 additions & 2 deletions LICENSE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ Commercial Use Licenses are available to purchase for a yearly fee.
Academic and Personal Use Licenses for NengoFPGA are available at
a reduced cost.
Both types of licences can be obtained from the
ABR store at `<https://appliedbrainresearch.myshopify.com/collections/all>`_.
ABR store at `<https://www.appliedbrainresearch.com/store>`_.

If you have any sales questions,
please contact `<[email protected]>`_.
If you have any technical support questions, please post them on the ABR
community forums at `<https://forum.nengo.ai/>`_ or contact
`<[email protected]>`_.


This license pertains only to the NengoFPGA interface software. License information
for the supported hardware implementations can be found at their respective license
pages:
Expand All @@ -42,7 +43,7 @@ NengoFPGA imports or vendorizes several open source libraries.
* `NumPy <https://numpy.org/>`_ - Used under
`BSD license <https://numpy.org/doc/stable/license.html>`__
* `Sphinx <https://www.sphinx-doc.org/>`_ - Used under
`BSD license <https://github.com/sphinx-doc/sphinx/blob/master/LICENSE>`__
`BSD license <https://github.com/sphinx-doc/sphinx/blob/master/LICENSE.rst>`__
* `numpydoc <https://github.com/numpy/numpydoc>`_ - Used under
`BSD license <https://github.com/numpy/numpydoc/blob/master/LICENSE.txt>`__
* `IPython <http://ipython.org/>`_ - Used under
Expand Down
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
default_role = "py:obj"
pygments_style = "sphinx"
user_agent = "nengo_fpga"
linkcheck_ignore = [
"(https:\\/\\/www\\.tulembedded\\.com\\/FPGA\\/ProductsPYNQ-Z2\\.html)"
]

project = "NengoFPGA"
authors = "Applied Brain Research"
Expand Down Expand Up @@ -108,7 +111,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']);
Expand Down
14 changes: 13 additions & 1 deletion nengo_fpga/tests/test_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
)


@pytest.mark.xdist_group(name="fpga_config")
def test_init(config_contents, gen_configs, mocker):
"""Test the FPGA network's init function."""

Expand Down Expand Up @@ -117,6 +118,7 @@ def test_func(x):
assert hasattr(dummy_net, "connection")


@pytest.mark.xdist_group(name="fpga_config")
def test_init_default(config_contents, gen_configs, mocker):
"""Test the FPGA network's init function."""

Expand Down Expand Up @@ -164,7 +166,7 @@ def test_init_default(config_contents, gen_configs, mocker):
assert dummy_net.connection.pre == dummy_net.ensemble
assert dummy_net.connection.post == dummy_net.output
assert dummy_net.connection.function is None
assert type(dummy_net.connection.transform) == nengo.transforms.NoTransform
assert isinstance(dummy_net.connection.transform, nengo.transforms.NoTransform)
assert np.all(
dummy_net.connection.eval_points == nengo.Connection.eval_points.default
)
Expand Down Expand Up @@ -208,6 +210,7 @@ def test_data_filepath(dummy_net, mocker):
assert dummy_net.local_data_filepath == os.path.join(path, fname)


@pytest.mark.xdist_group(name="fpga_config")
def test_terminate_client(dummy_net, dummy_com, config_contents, mocker):
"""Test the FPGA network's terminate_client function."""

Expand All @@ -224,6 +227,7 @@ def test_terminate_client(dummy_net, dummy_com, config_contents, mocker):
assert send_mock.call_args_list[0][0][1] == address


@pytest.mark.xdist_group(name="fpga_config")
def test_close(dummy_net, dummy_com, mocker):
"""Test the FPGA network's close function."""

Expand Down Expand Up @@ -268,6 +272,7 @@ def test_close(dummy_net, dummy_com, mocker):
assert np.all(dummy_net.recv_buffer == 0)


@pytest.mark.xdist_group(name="fpga_config")
def test_cleanup(dummy_net, mocker):
"""Test the FPGA network's cleanup function."""

Expand All @@ -293,6 +298,7 @@ def test_cleanup(dummy_net, mocker):
@pytest.mark.parametrize(
"ssh_method", [None, ("ssh_pwd", "passwd"), ("ssh_key", "key-path")]
)
@pytest.mark.xdist_group(name="fpga_config")
def test_connect_ssh_client(
ssh_method, dummy_net, config_contents, gen_configs, mocker
):
Expand Down Expand Up @@ -337,6 +343,7 @@ def test_connect_ssh_client(
)


@pytest.mark.xdist_group(name="fpga_config")
def test_connect_thread_func(dummy_net, dummy_com, config_contents, mocker):
"""
Test the FPGA network's connect_thread_func.
Expand Down Expand Up @@ -412,6 +419,7 @@ def test_connect_thread_func(dummy_net, dummy_com, config_contents, mocker):
net_close_mock.assert_called_once()


@pytest.mark.xdist_group(name="fpga_config")
def test_connect(dummy_net, mocker):
"""Test the FPGA network's connect function."""

Expand Down Expand Up @@ -574,6 +582,7 @@ def test_check_ssh_str(dummy_net):
assert error_strs[-1] == s


@pytest.mark.xdist_group(name="fpga_config")
def test_reset(dummy_net, mocker):
"""Test the FPGA network's reset function."""

Expand All @@ -596,6 +605,7 @@ def test_reset(dummy_net, mocker):
connect_mock.assert_called_once()


@pytest.mark.xdist_group(name="fpga_config")
def test_ssh_string(dummy_net, config_contents):
"""
Test we have the correct arguments in the string command.
Expand Down Expand Up @@ -704,6 +714,7 @@ class DummyRule(nengo.learning_rules.LearningRuleType):
_, _ = validate_net(dummy_net)


@pytest.mark.xdist_group(name="fpga_config")
def test_save_params(config_contents, gen_configs, mocker):
"""Test saving params to file."""

Expand Down Expand Up @@ -859,6 +870,7 @@ def recv_func(data):
assert val == x


@pytest.mark.xdist_group(name="fpga_config")
def test_builder(dummy_net, mocker):
"""Build a few networks to hit all the builder code."""

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
requires = ["setuptools<64", "wheel"]

[tool.black]
target-version = ['py36']
target-version = ['py38']

[tool.isort]
profile = "black"
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

# Automatically generated by nengo-bones, do not edit this file directly

import io
Expand Down Expand Up @@ -69,7 +67,7 @@ def read(*filenames, **kwargs):
"optional": optional_req,
"tests": tests_req,
},
python_requires=">=3.6",
python_requires=">=3.8",
package_data={
"nengo_fpga": [
"fpga_config",
Expand Down