Skip to content

Commit

Permalink
Throw error on config not found
Browse files Browse the repository at this point in the history
- Removed tcp_socket attribute which did nothing
- Changed warning to an error since ID extraction
  will be unsuccessful later anyways
- Update bones
  • Loading branch information
bmorcos committed Apr 9, 2020
1 parent 9955721 commit a246890
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ before_install:
# upgrade pip
- pip install pip --upgrade
# install/run nengo-bones
- pip install nengo-bones
- pip install git+https://github.com/nengo/nengo-bones#egg=nengo-bones
- bones-generate --output-dir .ci ci-scripts
- if [[ "$TRAVIS_PYTHON_VERSION" < "3.6" ]]; then
echo "Skipping bones-check because Python $TRAVIS_PYTHON_VERSION < 3.6";
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Release History
(`#50 <https://github.com/nengo/nengo-fpga/pull/50>`__)
- Improved socket communication for better performance.
(`#52 <https://github.com/nengo/nengo-fpga/pull/52>`__)
- Throw an error with invalid config in ID script.
(`#53 <https://github.com/nengo/nengo-fpga/pull/53>`__)

**Fixed**

Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"sphinx.ext.viewcode",
"nbsphinx",
"nengo_sphinx_theme",
"nengo_sphinx_theme.ext.backoff",
"nengo_sphinx_theme.ext.redirects",
"numpydoc",
]
Expand Down Expand Up @@ -63,6 +64,7 @@
linkcheck_anchors = True
default_role = "py:obj"
pygments_style = "sphinx"
user_agent = "nengo_fpga"

project = "NengoFPGA"
authors = "Applied Brain Research"
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/notebooks/06-chaotic-attractor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@
"\n",
"import nengo\n",
"\n",
"from mpl_toolkits.mplot3d import Axes3D\n",
"\n",
"import nengo_fpga\n",
"from nengo_fpga.networks import FpgaPesEnsembleNetwork\n",
"\n",
"from mpl_toolkits.mplot3d import Axes3D\n",
"from anim_utils import make_anim_chaotic"
]
},
Expand Down
8 changes: 4 additions & 4 deletions nengo_fpga/id_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import socket
import os
import sys
import threading
import numpy as np
import paramiko
Expand Down Expand Up @@ -54,12 +55,12 @@ def __init__(self, fpga_name, max_attempts=5, timeout=5):
self.tcp_recv = None # Placeholder until socket is connected

else:
# FPGA name not found, throw a warning.
# FPGA name not found, unable to retrieve ID
print(
"WARNING: Specified FPGA configuration '" + fpga_name + "' not found.",
"ERROR: Specified FPGA configuration '" + fpga_name + "' not found.",
flush=True,
)
self.tcp_socket = None
sys.exit()

def cleanup(self):
"""Shutdown socket and SSH connection"""
Expand Down Expand Up @@ -256,7 +257,6 @@ def recv_id(self):

if __name__ == "__main__":
import argparse
import sys

parser = argparse.ArgumentParser(
description="Generic script for running the ID Extractor on the "
Expand Down

0 comments on commit a246890

Please # to comment.