diff --git a/spinn_machine/version/version_factory.py b/spinn_machine/version/version_factory.py index 646dc850..e655ff10 100644 --- a/spinn_machine/version/version_factory.py +++ b/spinn_machine/version/version_factory.py @@ -92,6 +92,9 @@ def version_factory() -> AbstractVersion: return Version5() if version is None: - raise SpinnMachineException("cfg [Machine]version {version} is None") - + machine_name = get_config_str_or_none("Machine", "machineName") + raise SpinnMachineException( + "cfg [Machine]version {version} is None. " + f"Other cfg settings are {machine_name=} {spalloc_server=}, " + f"{remote_spinnaker_url=} {width=} {height=}") raise SpinnMachineException(f"Unexpected cfg [Machine]version {version}") diff --git a/unittests/data/test_data.py b/unittests/data/test_data.py index 6a65e38b..bf0753d1 100644 --- a/unittests/data/test_data.py +++ b/unittests/data/test_data.py @@ -14,11 +14,12 @@ import unittest from spinn_utilities.config_holder import set_config -from spinn_utilities.exceptions import (DataNotYetAvialable) +from spinn_utilities.exceptions import (ConfigException, DataNotYetAvialable) from spinn_machine import virtual_machine from spinn_machine.config_setup import unittest_setup from spinn_machine.data import MachineDataView from spinn_machine.data.machine_data_writer import MachineDataWriter +from spinn_machine.exceptions import SpinnMachineException from spinn_machine.version import FIVE, THREE, SPIN2_48CHIP from spinn_machine.version.version_strings import VersionStrings @@ -185,3 +186,12 @@ def test_get_monitors(self): writer.add_monitor_core(True) self.assertEqual(2, MachineDataView.get_all_monitor_cores()) self.assertEqual(3, MachineDataView.get_ethernet_monitor_cores()) + + def test_no_version(self): + set_config("Machine", "machineName", "SpiNNaker1M") + try: + MachineDataView.get_machine_version() + raise ConfigException("Should not get here") + except SpinnMachineException as ex: + msg = str(ex) + self.assertIn("SpiNNaker1M", msg)