-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
2,200 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (c) 2021-2022 The University of Manchester | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
from .utils_data_view import UtilsDataView | ||
|
||
__all__ = ["UtilsDataView"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright (c) 2021-2022 The University of Manchester | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
from enum import Enum | ||
from spinn_utilities.exceptions import ( | ||
DataNotMocked, DataNotYetAvialable, NotSetupException, ShutdownException) | ||
|
||
|
||
class DataStatus(Enum): | ||
""" | ||
Different states the Data can be in. | ||
This class is designed to used internally by UtilsDataView | ||
""" | ||
NOT_SETUP = (0, NotSetupException) | ||
MOCKED = (1, DataNotMocked) | ||
SETUP = (2, DataNotYetAvialable) | ||
SHUTDOWN = (3, ShutdownException) | ||
|
||
def __new__(cls, value, exception): | ||
# pylint: disable=protected-access | ||
obj = object.__new__(cls) | ||
obj._value_ = value | ||
obj._exception = exception | ||
return obj | ||
|
||
def exception(self, data): | ||
""" | ||
Returns the most suitable data not available exception | ||
:param data: | ||
:rtype: ~pinn_utilities.exceptions.SpiNNUtilsException | ||
""" | ||
return self._exception(data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright (c) 2021-2022 The University of Manchester | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
from enum import Enum | ||
|
||
|
||
class ResetStatus(Enum): | ||
""" | ||
Different states the reset could be in | ||
This class is design to used internally by UtilsDataView | ||
""" | ||
NOT_SETUP = (0) | ||
SETUP = (1) | ||
HAS_RUN = (2) | ||
SOFT_RESET = (3) | ||
HARD_RESET = (4) | ||
|
||
def __new__(cls, value): | ||
# pylint: disable=protected-access | ||
obj = object.__new__(cls) | ||
obj._value_ = value | ||
return obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright (c) 2021-2022 The University of Manchester | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
from enum import Enum | ||
|
||
|
||
class RunStatus(Enum): | ||
""" | ||
Different states the run could be in | ||
This is from the prespective of the users script. | ||
It says nothing about if there is c code running. | ||
Ie Has a sim.run (or similar) call started but not yet returned. | ||
This is combined with the ResetStatus to get the needed status | ||
This class is design to used internally by UtilsDataView | ||
""" | ||
NOT_SETUP = (0) | ||
NOT_RUNNING = (12) | ||
IN_RUN = (2) | ||
STOP_REQUESTED = (3) | ||
STOPPING = (4) | ||
SHUTDOWN = (5) | ||
|
||
def __new__(cls, value): | ||
# pylint: disable=protected-access | ||
obj = object.__new__(cls) | ||
obj._value_ = value | ||
return obj |
Oops, something went wrong.