From d68dc1032d88353756417125961ad91f1c565d50 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 2 Jan 2024 13:20:34 +0000 Subject: [PATCH 1/5] remove distutils --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index b3e5b4a..74a91dc 100644 --- a/setup.py +++ b/setup.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import distutils.dir_util from setuptools import setup import os +import shutil import sys @@ -26,9 +26,9 @@ this_dir = os.path.dirname(os.path.abspath(__file__)) build_dir = os.path.join(this_dir, "build") if os.path.isdir(build_dir): - distutils.dir_util.remove_tree(build_dir) + shutil.rmtree(build_dir) egg_dir = os.path.join( this_dir, "sPyNNaker8NewModelTemplate.egg-info") if os.path.isdir(egg_dir): - distutils.dir_util.remove_tree(egg_dir) + shutil.rmtree(egg_dir) setup() From 828a7dacd4cd8a79c27234a3aac972180fd27b1f Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 2 Jan 2024 13:36:27 +0000 Subject: [PATCH 2/5] python 3.12 --- .github/workflows/c_actions.yml | 4 ++-- .github/workflows/python_actions.yml | 6 +++--- setup.cfg | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/c_actions.yml b/.github/workflows/c_actions.yml index 639934c..3681666 100644 --- a/.github/workflows/c_actions.yml +++ b/.github/workflows/c_actions.yml @@ -33,11 +33,11 @@ jobs: uses: ./support/actions/apt-get-install with: packages: doxygen gcc-arm-none-eabi - - name: Configure Python 3.8 + - name: Configure Python 3.12 # Note: Python is needed for spinn_utilities.make_tools when building uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Set environment variables run: | diff --git a/.github/workflows/python_actions.yml b/.github/workflows/python_actions.yml index aa15fc8..d0ed016 100644 --- a/.github/workflows/python_actions.yml +++ b/.github/workflows/python_actions.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9, "3.10", "3.11"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] steps: # Check out the code and critical support code - name: Checkout @@ -82,7 +82,7 @@ jobs: exitcheck: 39 - name: Run rat copyright enforcement - if: matrix.python-version == 3.8 + if: matrix.python-version == 3.12 uses: ./support/actions/check-copyrights with: config_file: rat_asl20.xml @@ -94,5 +94,5 @@ jobs: # base-path: ${{ env.CODE_PATHS }} - name: Validate CITATION.cff - if: matrix.python-version == 3.8 + if: matrix.python-version == 3.12 uses: dieghernan/cff-validator@main diff --git a/setup.cfg b/setup.cfg index 107c2f5..f974ccf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,11 +30,11 @@ classifiers = Operating System :: Microsoft :: Windows Operating System :: MacOS Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 maintainer = SpiNNakerTeam maintainer_email = spinnakerusers@googlegroups.com keywords = @@ -42,7 +42,7 @@ keywords = pynn [options] -python_requires = >=3.7, <4 +python_requires = >=3.8, <4 packages = find: zip_safe = True include_package_data = True From 19db698a639a7290e2dd7a74252c844fc049ee51 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 2 Jan 2024 15:44:34 +0000 Subject: [PATCH 3/5] use supers synapse_structure --- .../stdp/timing_dependence/my_timing_dependence.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/python_models8/neuron/plasticity/stdp/timing_dependence/my_timing_dependence.py b/python_models8/neuron/plasticity/stdp/timing_dependence/my_timing_dependence.py index 122f012..5ac93a0 100644 --- a/python_models8/neuron/plasticity/stdp/timing_dependence/my_timing_dependence.py +++ b/python_models8/neuron/plasticity/stdp/timing_dependence/my_timing_dependence.py @@ -12,8 +12,7 @@ class MyTimingDependence(AbstractTimingDependence): "_a_minus", "_a_plus", "_my_depression_parameter", - "_my_potentiation_parameter", - "_synapse_structure"] + "_my_potentiation_parameter"] NUM_PARAMETERS = 2 @@ -27,12 +26,13 @@ def __init__( A_plus=0.01, A_minus=0.01): + # TODO: Update to match the synapse structure in the C code + super().__init__(SynapseStructureWeightOnly()) + # TODO: Store any parameters self._my_potentiation_parameter = my_potentiation_parameter self._my_depression_parameter = my_depression_parameter - # TODO: Update to match the synapse structure in the C code - self._synapse_structure = SynapseStructureWeightOnly() # Are these in the c code? self._a_plus = A_plus @@ -113,12 +113,6 @@ def write_parameters( def get_parameter_names(self): return ['my_potentiation_parameter', 'my_depression_parameter'] - @property - def synaptic_structure(self): - """ Get the synaptic structure of the plastic part of the rows - """ - return self._synapse_structure - @property def A_plus(self): return self._a_plus From 79ccd2bc12356672d4276842b464ecb85ba6e59e Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 2 Jan 2024 15:48:06 +0000 Subject: [PATCH 4/5] flake8 --- .../plasticity/stdp/timing_dependence/my_timing_dependence.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python_models8/neuron/plasticity/stdp/timing_dependence/my_timing_dependence.py b/python_models8/neuron/plasticity/stdp/timing_dependence/my_timing_dependence.py index 5ac93a0..acbae24 100644 --- a/python_models8/neuron/plasticity/stdp/timing_dependence/my_timing_dependence.py +++ b/python_models8/neuron/plasticity/stdp/timing_dependence/my_timing_dependence.py @@ -33,7 +33,6 @@ def __init__( self._my_potentiation_parameter = my_potentiation_parameter self._my_depression_parameter = my_depression_parameter - # Are these in the c code? self._a_plus = A_plus self._a_minus = A_minus From f07151c9bb43f52ea3c124b1acbc2f6c1d6036b5 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 2 Jan 2024 15:57:38 +0000 Subject: [PATCH 5/5] add get_delay_minimum --- python_models8/connectors/my_connector.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python_models8/connectors/my_connector.py b/python_models8/connectors/my_connector.py index 9149239..5396954 100644 --- a/python_models8/connectors/my_connector.py +++ b/python_models8/connectors/my_connector.py @@ -28,8 +28,14 @@ def __init__(self, weights=0.0, delays=1, allow_self_connections=True @overrides(AbstractConnector.get_delay_maximum) def get_delay_maximum(self, synapse_info): + # TODO call self._get_delay_maximum if needed return 16 + @overrides(AbstractConnector.get_delay_minimum) + def get_delay_minimum(self, synapse_info): + # TODO call self._get_delay_minimum if needed + return 1 + @overrides(AbstractGenerateConnectorOnHost.create_synaptic_block) def create_synaptic_block( self, post_slices, post_vertex_slice, synapse_type, synapse_info):