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

Remove deprecated stuff #1265

Merged
merged 66 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
0deb8a8
remove stubs for moved stuff
Christian-B Dec 8, 2022
963e762
remove more deprecated stuff
Christian-B Dec 9, 2022
f005cad
remove unused import
Christian-B Dec 12, 2022
8451b53
remove extra comma
Christian-B Dec 12, 2022
28180ff
merge
Christian-B Feb 6, 2023
58767a2
merged in master
Christian-B Feb 6, 2023
aeaba1b
merged in master
Christian-B Feb 10, 2023
e8f73b7
merge
Christian-B Feb 13, 2023
70914ad
merge
Christian-B Feb 16, 2023
9c15259
merged in master
Christian-B Feb 16, 2023
b92c6be
merged in master
Christian-B Feb 20, 2023
cde8365
merge
Christian-B Feb 24, 2023
13d1592
merged in master
Christian-B Mar 6, 2023
e19b926
merged in master
Christian-B Mar 7, 2023
bcbc54a
merged in master
Christian-B Mar 8, 2023
7c46598
merge
Christian-B Mar 8, 2023
7b65464
merge
Christian-B Mar 10, 2023
d4c1cf6
merged in master
Christian-B Mar 28, 2023
6fffc11
merged in master
Christian-B Mar 30, 2023
fce9dad
merge
Christian-B Apr 4, 2023
ca5f576
merged in master
Christian-B Apr 4, 2023
91cca4a
merged in master
Christian-B Apr 11, 2023
cddf9f6
merged in master
Christian-B Apr 12, 2023
b946642
merged in master
Christian-B Apr 13, 2023
baf55d7
merged in master
Christian-B Apr 14, 2023
749cf14
merged in master
Christian-B Apr 18, 2023
6968f1a
merge
Christian-B Apr 20, 2023
9d3cae7
merged in master
Christian-B Apr 24, 2023
c5ed3fc
merged in master
Christian-B Apr 24, 2023
2887ca5
merged in master
Christian-B Apr 24, 2023
b140f5b
merged in master
Christian-B Apr 26, 2023
7bc67c4
use pop.mean_spike_count() not pop.meanSpikeCount
Christian-B Apr 26, 2023
dee2d44
merged in master
Christian-B Apr 26, 2023
ba0ce15
merged in master
Christian-B Apr 27, 2023
7c6a461
merged in master
Christian-B May 2, 2023
aa8a37d
merged in master
Christian-B May 3, 2023
4bc7f23
merged in master
Christian-B May 4, 2023
47b1547
merged in master
Christian-B May 16, 2023
90b9342
merged in master
Christian-B May 25, 2023
55f7238
merged in master
Christian-B May 25, 2023
05e5076
merged in master
Christian-B May 26, 2023
5fcaf74
merged in master
Christian-B May 30, 2023
9d8b723
merged in master
Christian-B Jun 1, 2023
43016d0
merged in master
Christian-B Jun 2, 2023
8e5f830
merged in master
Christian-B Jun 15, 2023
2188ddc
merged in master
Christian-B Jun 15, 2023
f7b0846
merged in master
Christian-B Jun 15, 2023
18a404e
merged in master
Christian-B Jun 15, 2023
5978c2c
merged in master
Christian-B Jun 20, 2023
c60fe9a
merged in master
Christian-B Jun 21, 2023
465a6c5
merged in master
Christian-B Jul 5, 2023
6272e4d
merged in master
Christian-B Jul 5, 2023
f2f0fb5
merged in master
Christian-B Jul 6, 2023
cfe7290
merged in master
Christian-B Jul 6, 2023
0129cb4
merged in master
Christian-B Jul 6, 2023
1ad7081
merged in master
Christian-B Jul 10, 2023
8f16fb5
merged in master
Christian-B Jul 18, 2023
8d09c31
merged in master
Christian-B Jul 20, 2023
25603c5
merged in master
Christian-B Jul 28, 2023
c9fc286
merged in master
Christian-B Aug 15, 2023
657b513
merged in master
Christian-B Aug 17, 2023
efa16ab
merged in master
Christian-B Sep 11, 2023
694472d
merged in master
Christian-B Sep 11, 2023
647efd6
merged in master
Christian-B Sep 14, 2023
8ba8aca
merged in master
Christian-B Sep 15, 2023
6daf369
merged in master
Christian-B Sep 26, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/python_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ jobs:
coveralls-token: ${{ secrets.GITHUB_TOKEN }}

- name: Lint with flake8
run: flake8 ${{ env.BASE_PKG }} spynnaker8 unittests spynnaker_integration_tests
run: flake8 ${{ env.BASE_PKG }} unittests spynnaker_integration_tests

- name: Lint with pylint
uses: ./support/actions/pylint
with:
package: ${{ env.BASE_PKG }} spynnaker8
package: ${{ env.BASE_PKG }}
language: en_GB

validate:
Expand Down
46 changes: 0 additions & 46 deletions spynnaker/pyNN/abstract_spinnaker_common.py

This file was deleted.

144 changes: 0 additions & 144 deletions spynnaker/pyNN/models/populations/population_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ def _we_dont_do_this_now(*args): # pylint: disable=unused-argument
raise NotImplementedError("sPyNNaker does not currently do this")


def _this_is_wholly_deprecated(msg, *args): # pylint: disable=unused-argument
# pragma: no cover
raise NotImplementedError(msg)


class PopulationBase(object, metaclass=AbstractBase):
r"""
Shared methods between :py:class:`Population`\ s and
Expand Down Expand Up @@ -75,16 +70,6 @@ def __add__(self, other):
# TODO: support assemblies
_we_dont_do_this_now(other) # pragma: no cover

def getSpikes(self, *args, **kwargs): # pylint: disable=unused-argument
"""
.. deprecated:: 5.0
Use ``get_data('spikes')`` instead.
"""
logger.warning(
'getSpikes is deprecated. Call transfered to get_data("spikes") '
'without additional arguments')
return self.get_data("spikes")

@abstractmethod
def get_data(self, variables='all', gather=True, clear=False,
annotations=None):
Expand Down Expand Up @@ -112,17 +97,6 @@ def get_data(self, variables='all', gather=True, clear=False,
:rtype: ~neo.core.Block
"""

def get_gsyn(self, *args, **kwargs): # pylint: disable=unused-argument
"""
.. deprecated:: 5.0
Use ``get_data(['gsyn_exc', 'gsyn_inh'])`` instead.
"""
logger.warning(
'get_gsyn is deprecated. '
'Call transfered to get_data(["gsyn_exc", "gsyn_inh"]) '
'without additional arguments')
return self.get_data(['gsyn_exc', 'gsyn_inh'])

@abstractmethod
def get_spike_counts(self, gather=True):
"""
Expand All @@ -142,16 +116,6 @@ def get_spike_counts(self, gather=True):
:rtype: dict(int, int)
"""

def get_v(self, *args, **kwargs): # pylint: disable=unused-argument
"""
.. deprecated:: 5.0
Use ``get_data('v')`` instead.
"""
logger.warning(
'getSpikes is deprecated. '
'Call transfered to get_data("v") without additional arguments')
return self.get_data("v")

@abstractmethod
def inject(self, current_source):
"""
Expand Down Expand Up @@ -185,16 +149,6 @@ def local_size(self):
"is_local always returns size")
return len(self)

def meanSpikeCount(self, *args, **kwargs):
"""
.. deprecated:: 5.0
Use ``mean_spike_count()`` instead.
"""
logger.warning(
'meanSpikeCount is deprecated. '
'Call transfered to mean_spike_count with additional arguements')
return self.mean_spike_count(*args, **kwargs)

def mean_spike_count(self, gather=True):
"""
Returns the mean number of spikes per neuron.
Expand Down Expand Up @@ -284,57 +238,6 @@ def write_data(self, io, variables='all', gather=True, clear=False,
"""
# pylint: disable=too-many-arguments

def printSpikes(self, filename, gather=True):
"""
.. deprecated:: 5.0
Use ``write_data(file, 'spikes')`` instead.

.. note::
Method signature is the PyNN0.7 one
"""
if not gather:
warn_once(
logger, "sPyNNaker only supports gather=True. We will run "
"as if gather was set to True.")
logger.warning(
'printSpikes is deprecated. '
'Call transfered to write_data(file, "spikes", gatherer) instead.')
self.write_data(filename, 'spikes', gather=True)

def print_gsyn(self, filename, gather=True):
"""
.. deprecated:: 5.0
Use ``write_data(file, ['gsyn_exc', 'gsyn_inh'])`` instead.

.. note::
Method signature is the PyNN0.7 one
"""
if not gather:
warn_once(
logger, "sPyNNaker only supports gather=True. We will run "
"as if gather was set to True.")
logger.warning(
'print_gsyn is deprecated. Call transfered to '
'write_data(file, ["gsyn_exc", "gsyn_inh"], gatherer) instead.')
self.write_data(filename, ['gsyn_exc', 'gsyn_inh'], gather=True)

def print_v(self, filename, gather=True):
"""
.. deprecated:: 5.0
Use ``write_data(file, 'v')`` instead.

.. note::
Method signature is the PyNN0.7 one
"""
if not gather:
warn_once(
logger, "sPyNNaker only supports gather=True. We will run "
"as if gather was set to True.")
logger.warning(
'print_v is deprecated. '
'Call transfered to write_data(file, "v", gatherer) instead.')
self.write_data(filename, 'v', gather=True)

def receptor_types(self):
"""
.. note::
Expand Down Expand Up @@ -362,45 +265,6 @@ def record(self, variables, to_file=None, sampling_interval=None):
multiple of the simulation timestep.
"""

def record_gsyn(self, sampling_interval=1, to_file=None):
"""
.. deprecated:: 5.0
Use ``record(['gsyn_exc', 'gsyn_inh'])`` instead.

.. note::
Method signature is the PyNN 0.7 one
with the extra non-PyNN `sampling_interval` and `indexes`
"""
logger.warning(
'record_gsyn is deprecated. Call transfered to '
'record(["gsyn_exc", "gsyn_inh"], tofile) instead.')
return self.record(
['gsyn_exc', 'gsyn_inh'], to_file=to_file,
sampling_interval=sampling_interval)

def record_v(self, sampling_interval=1, to_file=None):
"""
.. deprecated:: 5.0
Use ``record('v')`` instead.

.. note::
Method signature is the PyNN 0.7 one
with the extra non-PyNN `sampling_interval` and `indexes`
"""
logger.warning('record_v is deprecated. '
'Call transfered to record(["v"], .....) instead.')
return self.record(
'v', to_file=to_file,
sampling_interval=sampling_interval)

def rset(self, *args, **kwargs):
"""
.. deprecated:: 5.0
Use ``set(parametername=rand_distr)`` instead.
"""
_this_is_wholly_deprecated(
" Use set(parametername=rand_distr) instead.", args, kwargs)

def save_positions(self, file): # pylint: disable=redefined-builtin
"""
Save positions to file. The output format is index x y z
Expand All @@ -424,14 +288,6 @@ def structure(self):
# TODO: support neuron positions and spaces
_we_dont_do_this_now() # pragma: no cover

def tset(self, **kwargs):
"""
.. deprecated:: 5.0
Use ``set(parametername=value_array)`` instead.
"""
_this_is_wholly_deprecated(
"Use set(parametername=value_array) instead.", kwargs)

@abstractproperty
def _vertex(self):
"""
Expand Down
2 changes: 0 additions & 2 deletions spynnaker/pyNN/setup_pynn.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ def install_sPyNNaker_into(module):
spinnaker_init = os.path.join(spinnaker_dir, "__init__.py")
with open(spinnaker_init, "w", encoding="utf-8") as spinn_file:
spinn_file.write("from spynnaker.pyNN import *\n")
# To revert back to spynnaker8 use this line instead of the above
# spinn_file.write("from spynnaker8 import *\n")

print(f"Created {spinnaker_init} to point to spynnaker.pyNN")

Expand Down
6 changes: 2 additions & 4 deletions spynnaker/pyNN/spinnaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
spynnaker_splitter_selector)
from spynnaker.pyNN.utilities import constants
from spynnaker.pyNN.utilities.neo_buffer_database import NeoBufferDatabase
from spynnaker.pyNN.utilities.utility_calls import (
moved_in_v7_warning)


logger = FormatAdapter(logging.getLogger(__name__))

Expand Down Expand Up @@ -194,7 +193,7 @@ def state(self):
Used to bypass the dual level object.

:return: the SpiNNaker object
:rtype: ~spynnaker8.spinnaker.SpiNNaker
:rtype: ~spynnaker.pyNN.SpiNNaker
"""
return self

Expand Down Expand Up @@ -385,7 +384,6 @@ def register_binary_search_path(search_path):
:param str search_path: absolute search path for binaries
"""
# pylint: disable=protected-access
moved_in_v7_warning("register_binary_search_path is now a View method")
SpynnakerDataView.register_binary_search_path(search_path)

def _execute_spynnaker_ordered_covering_compressor(self):
Expand Down
41 changes: 0 additions & 41 deletions spynnaker/pyNN/utilities/utility_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,47 +389,6 @@ def get_n_bits(n_values):
return int(math.ceil(math.log2(n_values)))


def moved_in_v6(old_location, _):
"""
Tells the users that old code is no longer implemented.

:param str old_location: old import
:raise: NotImplementedError
"""
raise NotImplementedError(f"Old import: {old_location}")


def moved_in_v7(old_location, new_location):
"""
Warns the users that they are using an old import.

In version 8 this will be upgraded to a exception and then later removed

:param str old_location: old import
:param str new_location: new import
:raise NotImplementedError: if in CONTINUOUS_INTEGRATION
"""
if os.environ.get('CONTINUOUS_INTEGRATION', 'false').lower() == 'true':
raise NotImplementedError(f"Old import: {old_location}")
logger.warning("File {} moved to {}. Please fix your imports. "
"In version 8 this will fail completely.",
old_location, new_location)


def moved_in_v7_warning(message):
"""
Warns the user that they are using old code.

In version 8 this will be upgraded to a exception and then later removed

:param str message:
:raise NotImplementedError: if in CONTINUOUS_INTEGRATION
"""
if os.environ.get('CONTINUOUS_INTEGRATION', 'false').lower() == 'true':
raise NotImplementedError(message)
logger.warning("{} In version 8 old call will fail completely.", message)


def get_time_to_write_us(n_bytes, n_cores):
"""
Determine how long a write of a given number of bytes will take in us.
Expand Down
Loading