Skip to content

Commit

Permalink
move code into examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed May 9, 2024
1 parent 98aed42 commit 12e9b2a
Show file tree
Hide file tree
Showing 43 changed files with 57 additions and 42 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ jobs:
uses: ./support/actions/install-matplotlib

- name: Lint with flake8
run: flake8 examples balanced_random learning sudoku synfire
run: flake8 examples

- name: Lint with pylint
uses: ./support/actions/pylint
with:
package: examples balanced_random learning sudoku synfire
package: examples
exitcheck: 39

validate:
Expand Down
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added examples/pendulum/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sudoku/set_numbers.py → examples/sudoku/set_numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
import functools
import pyNN.spiNNaker as p
from sudoku.utils import puzzles, get_rates
from examples.sudoku.utils import puzzles, get_rates


class GUI(object):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
2 changes: 1 addition & 1 deletion sudoku/sudoku_main.py → examples/sudoku/sudoku_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from pyNN.random import RandomDistribution
import pyNN.spiNNaker as p
import spynnaker.pyNN.external_devices as ext
from sudoku.utils import puzzles, get_rates
from examples.sudoku.utils import puzzles, get_rates

run_time = 20000 # run time in milliseconds
neurons_per_digit = 5 # number of neurons per digit
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions integration_tests/script_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@ def build_scripts(self):
exceptions = {}
exceptions["pushbot_ethernet_example.py"] = "Needs a physical pushbot"
exceptions["pushbot_light_follower.py"] = "Runs forever"
exceptions["pendulum_follow_c_vis.py"] = "Visualiser"
exceptions["spike_filter.py"] = "Uses pyplot"
exceptions["pendulum_follow_python_vis.py"] = "Uses pyplot"
exceptions["sudoku_main.py"] = "Visualiser"

# For branches these raise a SkipTest quoting the time given
# For cron and manual runs these just and a warning
too_long = {}
too_long["stdp_triplet.py"] = "10 minutes"

self.create_test_scripts(
["examples","balanced_random", "learning", "synfire"],
too_long, exceptions)
["examples"], too_long, exceptions)


if __name__ == '__main__':
Expand Down
File renamed without changes.
Empty file.
File renamed without changes.
84 changes: 48 additions & 36 deletions integration_tests/test_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ def test_examples_external_devices_examples_live_examples_balanced_random_live_r
def test_examples_external_devices_examples_pushbot_spinnaker_link_example(self):
self.check_script("examples/external_devices_examples/pushbot_spinnaker_link_example.py")

# Not testing file due to: Visualiser
# examples/pendulum/pendulum_follow_c_vis.py

# Not testing file due to: Uses pyplot
# examples/pendulum/spike_filter.py

# Not testing file due to: Uses pyplot
# examples/pendulum/pendulum_follow_python_vis.py

def test_examples_if_curr_alpha(self):
self.check_script("examples/if_curr_alpha.py")

Expand All @@ -117,6 +126,15 @@ def test_examples_spike_time_compare(self):
def test_examples_stdp_example_cond(self):
self.check_script("examples/stdp_example_cond.py")

def test_examples_sudoku_set_numbers(self):
self.check_script("examples/sudoku/set_numbers.py")

def test_examples_sudoku_utils(self):
self.check_script("examples/sudoku/utils.py")

# Not testing file due to: Visualiser
# examples/sudoku/sudoku_main.py

def test_examples_stdp_pairing(self):
self.check_script("examples/stdp_pairing.py")

Expand Down Expand Up @@ -150,6 +168,36 @@ def test_examples_current_injection_example(self):
def test_examples_stdp_example(self):
self.check_script("examples/stdp_example.py")

def test_examples_synfire_synfire(self):
self.check_script("examples/synfire/synfire.py")

def test_examples_synfire_synfire_collab(self):
self.check_script("examples/synfire/synfire_collab.py")

def test_examples_learning_random_dist(self):
self.check_script("examples/learning/random_dist.py")

def test_examples_learning_stdp(self):
self.check_script("examples/learning/stdp.py")

def test_examples_learning_struct_pl(self):
self.check_script("examples/learning/struct_pl.py")

def test_examples_learning_split_struct_pl_stdp_split(self):
self.check_script("examples/learning/split/struct_pl_stdp_split.py")

def test_examples_learning_split_struct_pl_split(self):
self.check_script("examples/learning/split/struct_pl_split.py")

def test_examples_learning_split_stdp_split(self):
self.check_script("examples/learning/split/stdp_split.py")

def test_examples_learning_simple(self):
self.check_script("examples/learning/simple.py")

def test_examples_learning_struct_pl_stdp(self):
self.check_script("examples/learning/struct_pl_stdp.py")

def test_examples_stdp_example_get_plastic_params(self):
self.check_script("examples/stdp_example_get_plastic_params.py")

Expand Down Expand Up @@ -185,39 +233,3 @@ def test_examples_extra_models_examples_IF_curr_exp_ca2_adaptive(self):

def test_examples_extra_models_examples_IF_cond_exp_stoc(self):
self.check_script("examples/extra_models_examples/IF_cond_exp_stoc.py")

def test_balanced_random_balanced_random(self):
self.check_script("balanced_random/balanced_random.py")

def test_balanced_random_split_balanced_random_split(self):
self.check_script("balanced_random/split/balanced_random_split.py")

def test_learning_random_dist(self):
self.check_script("learning/random_dist.py")

def test_learning_stdp(self):
self.check_script("learning/stdp.py")

def test_learning_struct_pl(self):
self.check_script("learning/struct_pl.py")

def test_learning_split_struct_pl_stdp_split(self):
self.check_script("learning/split/struct_pl_stdp_split.py")

def test_learning_split_struct_pl_split(self):
self.check_script("learning/split/struct_pl_split.py")

def test_learning_split_stdp_split(self):
self.check_script("learning/split/stdp_split.py")

def test_learning_simple(self):
self.check_script("learning/simple.py")

def test_learning_struct_pl_stdp(self):
self.check_script("learning/struct_pl_stdp.py")

def test_synfire_synfire(self):
self.check_script("synfire/synfire.py")

def test_synfire_synfire_collab(self):
self.check_script("synfire/synfire_collab.py")

0 comments on commit 12e9b2a

Please sign in to comment.