From 6f20edfbc167bf32e687f25d102a416fadaea152 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 6 Jun 2024 07:51:22 +0100 Subject: [PATCH 01/37] use global check_prereleases --- .github/workflows/python_actions.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/python_actions.yml b/.github/workflows/python_actions.yml index 465e3a6..2b6017b 100644 --- a/.github/workflows/python_actions.yml +++ b/.github/workflows/python_actions.yml @@ -32,7 +32,6 @@ jobs: flake8-packages: mcmc mcmc_examples pylint-packages: mcmc mcmc_examples mypy-packages: mcmc - check_prereleases: false cfg_file: spiNNakerGraphFrontEnd rat_config_file: rat.xml # mix of licenses acceptable to rat rcfile: global_relaxed From b9f6442120a27bbe299b615ce1cef42b57514f87 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 6 Jun 2024 10:55:00 +0100 Subject: [PATCH 02/37] apachee copy right and strickter pylint checks --- .github/workflows/python_actions.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/python_actions.yml b/.github/workflows/python_actions.yml index 2b6017b..3c238ab 100644 --- a/.github/workflows/python_actions.yml +++ b/.github/workflows/python_actions.yml @@ -33,9 +33,6 @@ jobs: pylint-packages: mcmc mcmc_examples mypy-packages: mcmc cfg_file: spiNNakerGraphFrontEnd - rat_config_file: rat.xml # mix of licenses acceptable to rat - rcfile: global_relaxed - pylint_exitcheck: 6 # Action fails on ERROR or WARNING run_sphinx: false run_cff-validator: false From 7c8a3e0662d2b29f652585d0250f17d4b5ac73ef Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 6 Jun 2024 11:09:12 +0100 Subject: [PATCH 03/37] remove no longer used pylint rc file --- .pylintrc | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 .pylintrc diff --git a/.pylintrc b/.pylintrc deleted file mode 100644 index e7f90aa..0000000 --- a/.pylintrc +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2017 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 . From 846c280fd850fa596bc4f2d763928018a3bc3a77 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 6 Jun 2024 11:27:36 +0100 Subject: [PATCH 04/37] Apache copyright --- .github/workflows/c_actions.yml | 19 ++++++++-------- .github/workflows/python_actions.yml | 19 ++++++++-------- c_models/Makefile | 19 ++++++++-------- c_models/mcmc_cholesky/Makefile | 22 ++++++++----------- c_models/mcmc_cholesky/src/mcmc_cholesky.c | 18 +++++++-------- c_models/mcmc_cholesky/src/mcmc_cholesky.h | 18 +++++++-------- c_models/mcmc_coordinator/Makefile | 22 ++++++++----------- .../mcmc_coordinator/src/mcmc_coordinator.c | 18 +++++++-------- c_models/mcmc_models/Makefile | 19 ++++++++-------- c_models/mcmc_models/examples/arma/Makefile | 19 ++++++++-------- c_models/mcmc_models/examples/arma/src/arma.c | 18 +++++++-------- c_models/mcmc_models/examples/arma/src/arma.h | 18 +++++++-------- .../mcmc_models/examples/lighthouse/Makefile | 19 ++++++++-------- .../examples/lighthouse/src/lighthouse.c | 18 +++++++-------- .../examples/lighthouse/src/lighthouse.h | 18 +++++++-------- c_models/mcmc_models/mcmc_common.mk | 19 ++++++++-------- c_models/mcmc_models/src/mcmc.c | 19 ++++++++-------- c_models/mcmc_models/src/mcmc_model.h | 18 +++++++-------- c_models/mcmc_root_finder/Makefile | 22 ++++++++----------- .../mcmc_root_finder/src/mcmc_root_finder.c | 18 +++++++-------- .../mcmc_root_finder/src/mcmc_root_finder.h | 18 +++++++-------- .../src/mcmc_spinn_real_type.h | 18 +++++++-------- mcmc/__init__.py | 19 ++++++++-------- mcmc/_version.py | 19 ++++++++-------- mcmc/mcmc_cholesky_vertex.py | 19 ++++++++-------- mcmc/mcmc_coordinator_vertex.py | 19 ++++++++-------- mcmc/mcmc_framework.py | 19 ++++++++-------- mcmc/mcmc_model.py | 19 ++++++++-------- mcmc/mcmc_parameter.py | 19 ++++++++-------- mcmc/mcmc_root_finder_vertex.py | 19 ++++++++-------- mcmc/mcmc_state_variable.py | 20 ++++++++--------- mcmc/mcmc_vertex.py | 19 ++++++++-------- mcmc/model_binaries/__init__.py | 19 ++++++++-------- mcmc_examples/__init__.py | 19 ++++++++-------- mcmc_examples/arma/__init__.py | 19 ++++++++-------- mcmc_examples/arma/arma.py | 19 ++++++++-------- mcmc_examples/arma/arma_fixed_point_model.py | 19 ++++++++-------- mcmc_examples/arma/arma_float_model.py | 19 ++++++++-------- mcmc_examples/arma/arma_model.py | 19 ++++++++-------- mcmc_examples/lighthouse/__init__.py | 19 ++++++++-------- mcmc_examples/lighthouse/lighthouse.py | 19 ++++++++-------- .../lighthouse_fixed_point_model.py | 19 ++++++++-------- .../lighthouse/lighthouse_float_model.py | 19 ++++++++-------- mcmc_examples/lighthouse/lighthouse_model.py | 19 ++++++++-------- mcmc_integration_tests/__init__.py | 19 ++++++++-------- mcmc_integration_tests/script_builder.py | 19 ++++++++-------- pyproject.toml | 19 ++++++++-------- setup.cfg | 19 ++++++++-------- setup.py | 19 ++++++++-------- unittests/test_cfg_checker.py | 19 ++++++++-------- unittests/test_import_all.py | 19 ++++++++-------- 51 files changed, 459 insertions(+), 509 deletions(-) diff --git a/.github/workflows/c_actions.yml b/.github/workflows/c_actions.yml index 8f9a882..1088335 100644 --- a/.github/workflows/c_actions.yml +++ b/.github/workflows/c_actions.yml @@ -1,17 +1,16 @@ # Copyright (c) 2020 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # This workflow will install Python dependencies, run tests, lint and rat with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions diff --git a/.github/workflows/python_actions.yml b/.github/workflows/python_actions.yml index 3c238ab..a625f89 100644 --- a/.github/workflows/python_actions.yml +++ b/.github/workflows/python_actions.yml @@ -1,17 +1,16 @@ # Copyright (c) 2020 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # This workflow will install Python dependencies, run tests, lint and rat with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions diff --git a/c_models/Makefile b/c_models/Makefile index 4540633..ef30739 100644 --- a/c_models/Makefile +++ b/c_models/Makefile @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. DIRS = mcmc_models mcmc_coordinator mcmc_root_finder mcmc_cholesky diff --git a/c_models/mcmc_cholesky/Makefile b/c_models/mcmc_cholesky/Makefile index 09b5f03..3d493e7 100644 --- a/c_models/mcmc_cholesky/Makefile +++ b/c_models/mcmc_cholesky/Makefile @@ -1,20 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# An example Makefile suitable for use in SpiNNaker applications using the -# spinnaker_tools libraries and makefiles. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # The name of the application to be built (binary will be this with a `.aplx` # extension) diff --git a/c_models/mcmc_cholesky/src/mcmc_cholesky.c b/c_models/mcmc_cholesky/src/mcmc_cholesky.c index 554493c..0582bd4 100644 --- a/c_models/mcmc_cholesky/src/mcmc_cholesky.c +++ b/c_models/mcmc_cholesky/src/mcmc_cholesky.c @@ -1,17 +1,17 @@ /* * Copyright (c) 2016 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * along with this program. If not, see . */ #include "mcmc_cholesky.h" diff --git a/c_models/mcmc_cholesky/src/mcmc_cholesky.h b/c_models/mcmc_cholesky/src/mcmc_cholesky.h index fac69ef..a7e92c4 100644 --- a/c_models/mcmc_cholesky/src/mcmc_cholesky.h +++ b/c_models/mcmc_cholesky/src/mcmc_cholesky.h @@ -1,17 +1,17 @@ /* * Copyright (c) 2016 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * along with this program. If not, see . */ #include diff --git a/c_models/mcmc_coordinator/Makefile b/c_models/mcmc_coordinator/Makefile index 321589b..4411d37 100644 --- a/c_models/mcmc_coordinator/Makefile +++ b/c_models/mcmc_coordinator/Makefile @@ -1,20 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# An example Makefile suitable for use in SpiNNaker applications using the -# spinnaker_tools libraries and makefiles. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # The name of the application to be built (binary will be this with a `.aplx` # extension) diff --git a/c_models/mcmc_coordinator/src/mcmc_coordinator.c b/c_models/mcmc_coordinator/src/mcmc_coordinator.c index 5b159ba..91df0fa 100644 --- a/c_models/mcmc_coordinator/src/mcmc_coordinator.c +++ b/c_models/mcmc_coordinator/src/mcmc_coordinator.c @@ -1,17 +1,17 @@ /* * Copyright (c) 2016 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * along with this program. If not, see . */ #include diff --git a/c_models/mcmc_models/Makefile b/c_models/mcmc_models/Makefile index c4db781..246503e 100644 --- a/c_models/mcmc_models/Makefile +++ b/c_models/mcmc_models/Makefile @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. DIRS = lighthouse arma diff --git a/c_models/mcmc_models/examples/arma/Makefile b/c_models/mcmc_models/examples/arma/Makefile index a0997ed..2aad9e5 100644 --- a/c_models/mcmc_models/examples/arma/Makefile +++ b/c_models/mcmc_models/examples/arma/Makefile @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # The name of the application to be built (binary will be this with a `.aplx` # extension) diff --git a/c_models/mcmc_models/examples/arma/src/arma.c b/c_models/mcmc_models/examples/arma/src/arma.c index ce8a86a..8d2b4de 100644 --- a/c_models/mcmc_models/examples/arma/src/arma.c +++ b/c_models/mcmc_models/examples/arma/src/arma.c @@ -1,17 +1,17 @@ /* * Copyright (c) 2016 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * along with this program. If not, see . */ #include diff --git a/c_models/mcmc_models/examples/arma/src/arma.h b/c_models/mcmc_models/examples/arma/src/arma.h index 35d5885..7895539 100644 --- a/c_models/mcmc_models/examples/arma/src/arma.h +++ b/c_models/mcmc_models/examples/arma/src/arma.h @@ -1,17 +1,17 @@ /* * Copyright (c) 2016 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * along with this program. If not, see . */ #include diff --git a/c_models/mcmc_models/examples/lighthouse/Makefile b/c_models/mcmc_models/examples/lighthouse/Makefile index 137d6c7..3a36228 100644 --- a/c_models/mcmc_models/examples/lighthouse/Makefile +++ b/c_models/mcmc_models/examples/lighthouse/Makefile @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # The name of the application to be built (binary will be this with a `.aplx` # extension) diff --git a/c_models/mcmc_models/examples/lighthouse/src/lighthouse.c b/c_models/mcmc_models/examples/lighthouse/src/lighthouse.c index 5bcb1bf..bf2be32 100644 --- a/c_models/mcmc_models/examples/lighthouse/src/lighthouse.c +++ b/c_models/mcmc_models/examples/lighthouse/src/lighthouse.c @@ -1,17 +1,17 @@ /* * Copyright (c) 2016 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * along with this program. If not, see . */ #include diff --git a/c_models/mcmc_models/examples/lighthouse/src/lighthouse.h b/c_models/mcmc_models/examples/lighthouse/src/lighthouse.h index 5b4a84b..78d1496 100644 --- a/c_models/mcmc_models/examples/lighthouse/src/lighthouse.h +++ b/c_models/mcmc_models/examples/lighthouse/src/lighthouse.h @@ -1,17 +1,17 @@ /* * Copyright (c) 2016 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * along with this program. If not, see . */ struct mcmc_params { diff --git a/c_models/mcmc_models/mcmc_common.mk b/c_models/mcmc_models/mcmc_common.mk index e6d122f..b3edabf 100644 --- a/c_models/mcmc_models/mcmc_common.mk +++ b/c_models/mcmc_models/mcmc_common.mk @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. LIBRARIES += -lm diff --git a/c_models/mcmc_models/src/mcmc.c b/c_models/mcmc_models/src/mcmc.c index 0e177fe..ccb209a 100644 --- a/c_models/mcmc_models/src/mcmc.c +++ b/c_models/mcmc_models/src/mcmc.c @@ -1,19 +1,18 @@ /* * Copyright (c) 2016 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * along with this program. If not, see . - */ /* simple_MCMC.c diff --git a/c_models/mcmc_models/src/mcmc_model.h b/c_models/mcmc_models/src/mcmc_model.h index 6ad28fa..0f82bce 100644 --- a/c_models/mcmc_models/src/mcmc_model.h +++ b/c_models/mcmc_models/src/mcmc_model.h @@ -1,17 +1,17 @@ /* * Copyright (c) 2016 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * along with this program. If not, see . */ #include diff --git a/c_models/mcmc_root_finder/Makefile b/c_models/mcmc_root_finder/Makefile index ae5d817..bab04a6 100644 --- a/c_models/mcmc_root_finder/Makefile +++ b/c_models/mcmc_root_finder/Makefile @@ -1,20 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# An example Makefile suitable for use in SpiNNaker applications using the -# spinnaker_tools libraries and makefiles. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # The name of the application to be built (binary will be this with a `.aplx` # extension) diff --git a/c_models/mcmc_root_finder/src/mcmc_root_finder.c b/c_models/mcmc_root_finder/src/mcmc_root_finder.c index 07bb71c..1f3cfe1 100644 --- a/c_models/mcmc_root_finder/src/mcmc_root_finder.c +++ b/c_models/mcmc_root_finder/src/mcmc_root_finder.c @@ -1,17 +1,17 @@ /* * Copyright (c) 2016 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * along with this program. If not, see . */ // compile with gcc -std=c99 -O3 -fcx-limited-range root_finder.c -l m -o rf diff --git a/c_models/mcmc_root_finder/src/mcmc_root_finder.h b/c_models/mcmc_root_finder/src/mcmc_root_finder.h index 6fd912a..91442d4 100644 --- a/c_models/mcmc_root_finder/src/mcmc_root_finder.h +++ b/c_models/mcmc_root_finder/src/mcmc_root_finder.h @@ -1,17 +1,17 @@ /* * Copyright (c) 2016 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * along with this program. If not, see . */ // compile with gcc -std=c99 -O3 -fcx-limited-range root_finder.c -l m -o rf diff --git a/c_models/mcmc_root_finder/src/mcmc_spinn_real_type.h b/c_models/mcmc_root_finder/src/mcmc_spinn_real_type.h index 39a08b5..20a2008 100644 --- a/c_models/mcmc_root_finder/src/mcmc_spinn_real_type.h +++ b/c_models/mcmc_root_finder/src/mcmc_spinn_real_type.h @@ -1,17 +1,17 @@ /* * Copyright (c) 2016 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * 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. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU General Public License + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * along with this program. If not, see . */ #include diff --git a/mcmc/__init__.py b/mcmc/__init__.py index 3f5593d..e65c9b9 100644 --- a/mcmc/__init__.py +++ b/mcmc/__init__.py @@ -1,14 +1,13 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/mcmc/_version.py b/mcmc/_version.py index f1b1647..8a73c68 100644 --- a/mcmc/_version.py +++ b/mcmc/_version.py @@ -1,17 +1,16 @@ # Copyright (c) 2018 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. __version__ = "1!7.1.1" __version_month__ = "TBD" diff --git a/mcmc/mcmc_cholesky_vertex.py b/mcmc/mcmc_cholesky_vertex.py index f20d2a3..6e6c24a 100644 --- a/mcmc/mcmc_cholesky_vertex.py +++ b/mcmc/mcmc_cholesky_vertex.py @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from enum import Enum diff --git a/mcmc/mcmc_coordinator_vertex.py b/mcmc/mcmc_coordinator_vertex.py index 6e42ba0..559ca5d 100644 --- a/mcmc/mcmc_coordinator_vertex.py +++ b/mcmc/mcmc_coordinator_vertex.py @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from typing import List diff --git a/mcmc/mcmc_framework.py b/mcmc/mcmc_framework.py index 9655744..eb0f288 100644 --- a/mcmc/mcmc_framework.py +++ b/mcmc/mcmc_framework.py @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. import spinnaker_graph_front_end as g diff --git a/mcmc/mcmc_model.py b/mcmc/mcmc_model.py index c6d6b3c..f4b379e 100644 --- a/mcmc/mcmc_model.py +++ b/mcmc/mcmc_model.py @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from typing import List from spinn_utilities.abstract_base import AbstractBase diff --git a/mcmc/mcmc_parameter.py b/mcmc/mcmc_parameter.py index db35c53..e9b56a9 100644 --- a/mcmc/mcmc_parameter.py +++ b/mcmc/mcmc_parameter.py @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. class MCMCParameter(object): """ A Parameter of the MCMC simulation diff --git a/mcmc/mcmc_root_finder_vertex.py b/mcmc/mcmc_root_finder_vertex.py index 97d490b..6661c13 100644 --- a/mcmc/mcmc_root_finder_vertex.py +++ b/mcmc/mcmc_root_finder_vertex.py @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from pacman.model.graphs.machine import MachineVertex from pacman.model.resources import ConstantSDRAM diff --git a/mcmc/mcmc_state_variable.py b/mcmc/mcmc_state_variable.py index 908dd5b..fa1d877 100644 --- a/mcmc/mcmc_state_variable.py +++ b/mcmc/mcmc_state_variable.py @@ -1,18 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. class MCMCStateVariable(object): """ A State variable of the MCMC simulation """ diff --git a/mcmc/mcmc_vertex.py b/mcmc/mcmc_vertex.py index 5a4f3ec..99d7464 100644 --- a/mcmc/mcmc_vertex.py +++ b/mcmc/mcmc_vertex.py @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from pacman.model.graphs.machine import MachineVertex from pacman.model.resources import ConstantSDRAM diff --git a/mcmc/model_binaries/__init__.py b/mcmc/model_binaries/__init__.py index 3f5593d..e65c9b9 100644 --- a/mcmc/model_binaries/__init__.py +++ b/mcmc/model_binaries/__init__.py @@ -1,14 +1,13 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/mcmc_examples/__init__.py b/mcmc_examples/__init__.py index 3f5593d..e65c9b9 100644 --- a/mcmc_examples/__init__.py +++ b/mcmc_examples/__init__.py @@ -1,14 +1,13 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/mcmc_examples/arma/__init__.py b/mcmc_examples/arma/__init__.py index 3f5593d..e65c9b9 100644 --- a/mcmc_examples/arma/__init__.py +++ b/mcmc_examples/arma/__init__.py @@ -1,14 +1,13 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/mcmc_examples/arma/arma.py b/mcmc_examples/arma/arma.py index d688694..4318d41 100644 --- a/mcmc_examples/arma/arma.py +++ b/mcmc_examples/arma/arma.py @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. import sys import os diff --git a/mcmc_examples/arma/arma_fixed_point_model.py b/mcmc_examples/arma/arma_fixed_point_model.py index 59d06a4..fe4156f 100644 --- a/mcmc_examples/arma/arma_fixed_point_model.py +++ b/mcmc_examples/arma/arma_fixed_point_model.py @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from typing import List from spinn_utilities.overrides import overrides diff --git a/mcmc_examples/arma/arma_float_model.py b/mcmc_examples/arma/arma_float_model.py index 2fd623b..2246763 100644 --- a/mcmc_examples/arma/arma_float_model.py +++ b/mcmc_examples/arma/arma_float_model.py @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from typing import List from spinn_utilities.overrides import overrides diff --git a/mcmc_examples/arma/arma_model.py b/mcmc_examples/arma/arma_model.py index 3b7e6f8..4861e9c 100644 --- a/mcmc_examples/arma/arma_model.py +++ b/mcmc_examples/arma/arma_model.py @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from typing import List from spinn_utilities.overrides import overrides diff --git a/mcmc_examples/lighthouse/__init__.py b/mcmc_examples/lighthouse/__init__.py index 3f5593d..e65c9b9 100644 --- a/mcmc_examples/lighthouse/__init__.py +++ b/mcmc_examples/lighthouse/__init__.py @@ -1,14 +1,13 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/mcmc_examples/lighthouse/lighthouse.py b/mcmc_examples/lighthouse/lighthouse.py index 6b67ca0..bbf3b67 100644 --- a/mcmc_examples/lighthouse/lighthouse.py +++ b/mcmc_examples/lighthouse/lighthouse.py @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. import sys import os diff --git a/mcmc_examples/lighthouse/lighthouse_fixed_point_model.py b/mcmc_examples/lighthouse/lighthouse_fixed_point_model.py index 1deb7fb..71d0675 100644 --- a/mcmc_examples/lighthouse/lighthouse_fixed_point_model.py +++ b/mcmc_examples/lighthouse/lighthouse_fixed_point_model.py @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from typing import List from spinn_utilities.overrides import overrides diff --git a/mcmc_examples/lighthouse/lighthouse_float_model.py b/mcmc_examples/lighthouse/lighthouse_float_model.py index 6fd681a..7dfdd2b 100644 --- a/mcmc_examples/lighthouse/lighthouse_float_model.py +++ b/mcmc_examples/lighthouse/lighthouse_float_model.py @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from typing import List from spinn_utilities.overrides import overrides diff --git a/mcmc_examples/lighthouse/lighthouse_model.py b/mcmc_examples/lighthouse/lighthouse_model.py index 78466fd..5580324 100644 --- a/mcmc_examples/lighthouse/lighthouse_model.py +++ b/mcmc_examples/lighthouse/lighthouse_model.py @@ -1,17 +1,16 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from typing import List from spinn_utilities.overrides import overrides diff --git a/mcmc_integration_tests/__init__.py b/mcmc_integration_tests/__init__.py index 3f5593d..e65c9b9 100644 --- a/mcmc_integration_tests/__init__.py +++ b/mcmc_integration_tests/__init__.py @@ -1,14 +1,13 @@ # Copyright (c) 2016 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/mcmc_integration_tests/script_builder.py b/mcmc_integration_tests/script_builder.py index 505776d..963d77d 100644 --- a/mcmc_integration_tests/script_builder.py +++ b/mcmc_integration_tests/script_builder.py @@ -1,17 +1,16 @@ # Copyright (c) 2017 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from spinnaker_testbase import RootScriptBuilder diff --git a/pyproject.toml b/pyproject.toml index 940d488..b2bf2c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,17 +1,16 @@ # Copyright (c) 2023 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. [build-system] requires = ["setuptools"] diff --git a/setup.cfg b/setup.cfg index 5af9981..9183e84 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,17 +1,16 @@ # Copyright (c) 2023 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. [metadata] name = MarkovChainMonteCarlo diff --git a/setup.py b/setup.py index 168138c..ec58924 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,16 @@ # Copyright (c) 2018 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from setuptools import setup import shutil diff --git a/unittests/test_cfg_checker.py b/unittests/test_cfg_checker.py index cdc5e7d..dce9d05 100644 --- a/unittests/test_cfg_checker.py +++ b/unittests/test_cfg_checker.py @@ -1,17 +1,16 @@ # Copyright (c) 2017 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. import os import unittest diff --git a/unittests/test_import_all.py b/unittests/test_import_all.py index 2c6b896..3b3bd00 100644 --- a/unittests/test_import_all.py +++ b/unittests/test_import_all.py @@ -1,17 +1,16 @@ # Copyright (c) 2017 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. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# 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. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. import os import unittest From 0cfb8d44b09015689ecfdec86998b6c52acbef13 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 6 Jun 2024 11:59:01 +0100 Subject: [PATCH 05/37] # pylint: disable=wrong-spelling-in-comment --- mcmc/mcmc_cholesky_vertex.py | 1 + mcmc_examples/arma/arma.py | 1 + mcmc_examples/arma/arma_fixed_point_model.py | 1 + mcmc_examples/lighthouse/lighthouse_fixed_point_model.py | 9 +++++++++ 4 files changed, 12 insertions(+) diff --git a/mcmc/mcmc_cholesky_vertex.py b/mcmc/mcmc_cholesky_vertex.py index 6e6c24a..c08495d 100644 --- a/mcmc/mcmc_cholesky_vertex.py +++ b/mcmc/mcmc_cholesky_vertex.py @@ -28,6 +28,7 @@ .abstract_generates_data_specification \ import AbstractGeneratesDataSpecification from spinn_front_end_common.interface.ds import DataSpecificationGenerator +# pylint: disable=wrong-spelling-in-comment class MCMCCholeskyRegions(Enum): diff --git a/mcmc_examples/arma/arma.py b/mcmc_examples/arma/arma.py index 4318d41..36e14c5 100644 --- a/mcmc_examples/arma/arma.py +++ b/mcmc_examples/arma/arma.py @@ -21,6 +21,7 @@ from mcmc_examples.arma.arma_float_model import ARMAFloatModel # from mcmc_examples.lighthouse.lighthouse_fixed_point_model \ # import ARMAFixedPointModel +# pylint: disable=wrong-spelling-in-comment # Data to use for 1000 data points (read from file) data_10000 = numpy.loadtxt("data_10000.csv", delimiter=",") diff --git a/mcmc_examples/arma/arma_fixed_point_model.py b/mcmc_examples/arma/arma_fixed_point_model.py index fe4156f..ccbce4f 100644 --- a/mcmc_examples/arma/arma_fixed_point_model.py +++ b/mcmc_examples/arma/arma_fixed_point_model.py @@ -20,6 +20,7 @@ from mcmc.mcmc_model import MCMCModel from mcmc.mcmc_parameter import MCMCParameter from mcmc.mcmc_state_variable import MCMCStateVariable +# pylint: disable=wrong-spelling-in-comment class ARMAFixedPointModel(MCMCModel): diff --git a/mcmc_examples/lighthouse/lighthouse_fixed_point_model.py b/mcmc_examples/lighthouse/lighthouse_fixed_point_model.py index 71d0675..e49abd8 100644 --- a/mcmc_examples/lighthouse/lighthouse_fixed_point_model.py +++ b/mcmc_examples/lighthouse/lighthouse_fixed_point_model.py @@ -20,6 +20,7 @@ from mcmc.mcmc_model import MCMCModel from mcmc.mcmc_parameter import MCMCParameter from mcmc.mcmc_state_variable import MCMCStateVariable +# pylint: disable=wrong-spelling-in-comment class LightHouseFixedPointModel(MCMCModel): @@ -39,6 +40,8 @@ def __init__( scaling of t transition distribution for MH jumps in beta direction :param beta_min: The minimum value of beta :param beta_max: The maximum value of beta + :param root_finder: The root_finder value to be used + :param cholesky: The cholesky value to be used """ self._alpha_jump_scale = alpha_jump_scale @@ -74,8 +77,14 @@ def get_state_variables(self) -> List[MCMCStateVariable]: @property def root_finder(self): + """ + The root_finder value passed into the init + """ return self._root_finder @property def cholesky(self): + """ + The cholesky value as passed into the init + """ return self._cholesky From b707a7fe294a1a303dbe9903d1720b49cec1169e Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 6 Jun 2024 15:00:17 +0100 Subject: [PATCH 06/37] pylint-disable: R, wrong-spelling-in-docstring, invalid-name --- .github/workflows/python_actions.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/python_actions.yml b/.github/workflows/python_actions.yml index a625f89..7794b77 100644 --- a/.github/workflows/python_actions.yml +++ b/.github/workflows/python_actions.yml @@ -30,6 +30,9 @@ jobs: coverage-package: mcmc flake8-packages: mcmc mcmc_examples pylint-packages: mcmc mcmc_examples + # invalid-name because scripts have values pylint considers constants + # wrong-spelling-in-docstring due to param names ect + pylint-disable: R, wrong-spelling-in-docstring, invalid-name mypy-packages: mcmc cfg_file: spiNNakerGraphFrontEnd run_sphinx: false From e14d338bbffbecdd746cf8d5d5e6f495c2c389b6 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 6 Jun 2024 15:00:28 +0100 Subject: [PATCH 07/37] remove disable --- mcmc/mcmc_cholesky_vertex.py | 1 - mcmc_examples/arma/arma.py | 1 - mcmc_examples/arma/arma_fixed_point_model.py | 1 - mcmc_examples/lighthouse/lighthouse_fixed_point_model.py | 1 - 4 files changed, 4 deletions(-) diff --git a/mcmc/mcmc_cholesky_vertex.py b/mcmc/mcmc_cholesky_vertex.py index c08495d..6e6c24a 100644 --- a/mcmc/mcmc_cholesky_vertex.py +++ b/mcmc/mcmc_cholesky_vertex.py @@ -28,7 +28,6 @@ .abstract_generates_data_specification \ import AbstractGeneratesDataSpecification from spinn_front_end_common.interface.ds import DataSpecificationGenerator -# pylint: disable=wrong-spelling-in-comment class MCMCCholeskyRegions(Enum): diff --git a/mcmc_examples/arma/arma.py b/mcmc_examples/arma/arma.py index 36e14c5..4318d41 100644 --- a/mcmc_examples/arma/arma.py +++ b/mcmc_examples/arma/arma.py @@ -21,7 +21,6 @@ from mcmc_examples.arma.arma_float_model import ARMAFloatModel # from mcmc_examples.lighthouse.lighthouse_fixed_point_model \ # import ARMAFixedPointModel -# pylint: disable=wrong-spelling-in-comment # Data to use for 1000 data points (read from file) data_10000 = numpy.loadtxt("data_10000.csv", delimiter=",") diff --git a/mcmc_examples/arma/arma_fixed_point_model.py b/mcmc_examples/arma/arma_fixed_point_model.py index ccbce4f..fe4156f 100644 --- a/mcmc_examples/arma/arma_fixed_point_model.py +++ b/mcmc_examples/arma/arma_fixed_point_model.py @@ -20,7 +20,6 @@ from mcmc.mcmc_model import MCMCModel from mcmc.mcmc_parameter import MCMCParameter from mcmc.mcmc_state_variable import MCMCStateVariable -# pylint: disable=wrong-spelling-in-comment class ARMAFixedPointModel(MCMCModel): diff --git a/mcmc_examples/lighthouse/lighthouse_fixed_point_model.py b/mcmc_examples/lighthouse/lighthouse_fixed_point_model.py index e49abd8..37971a7 100644 --- a/mcmc_examples/lighthouse/lighthouse_fixed_point_model.py +++ b/mcmc_examples/lighthouse/lighthouse_fixed_point_model.py @@ -20,7 +20,6 @@ from mcmc.mcmc_model import MCMCModel from mcmc.mcmc_parameter import MCMCParameter from mcmc.mcmc_state_variable import MCMCStateVariable -# pylint: disable=wrong-spelling-in-comment class LightHouseFixedPointModel(MCMCModel): From bb674fc38a3a2ad8addc34e637cd05e5698dc732 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 6 Jun 2024 15:27:04 +0100 Subject: [PATCH 08/37] f string --- mcmc/mcmc_framework.py | 8 ++++---- mcmc/mcmc_vertex.py | 14 +++++++------- mcmc_examples/arma/arma.py | 8 ++++---- mcmc_examples/lighthouse/lighthouse.py | 9 +++++---- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/mcmc/mcmc_framework.py b/mcmc/mcmc_framework.py index eb0f288..b5138de 100644 --- a/mcmc/mcmc_framework.py +++ b/mcmc/mcmc_framework.py @@ -119,8 +119,8 @@ def run_mcmc( eth_y = chip.nearest_ethernet_y coordinator = coordinators.get((eth_x, eth_y)) if coordinator is None: - print("Warning - couldn't find {}, {} for chip {}, {}".format( - eth_x, eth_y, chip.x, chip.y)) + print(f"Warning - couldn't find {eth_x}, {eth_y} " + f"for chip {chip.x}, {chip.y}") coordinator = coordinators[0, 0] print("Using coordinator ", coordinator) @@ -226,8 +226,8 @@ def run_mcmc( error = txrx.get_core_state_count(app_id, CPUState.RUN_TIME_EXCEPTION) watchdog = txrx.get_core_state_count(app_id, CPUState.WATCHDOG) if error > 0 or watchdog > 0: - error_msg = "Some cores have failed ({} RTE, {} WDOG)".format( - error, watchdog) + error_msg = (f"Some cores have failed ({error} RTE, " + f"{watchdog} WDOG)") raise SpinnmanException(error_msg) running = txrx.get_core_state_count(app_id, CPUState.RUNNING) print('running: ', running) diff --git a/mcmc/mcmc_vertex.py b/mcmc/mcmc_vertex.py index 99d7464..1ef6e66 100644 --- a/mcmc/mcmc_vertex.py +++ b/mcmc/mcmc_vertex.py @@ -102,13 +102,13 @@ def _get_model_parameters_array(self): numpy_values = list() for i, param in enumerate(parameters): if (param.data_type is numpy.float64): - numpy_format.append(('f{}'.format(i), param.data_type)) + numpy_format.append((f"f{{{i}}}", param.data_type)) numpy_values.append(param.value) elif (param.data_type is numpy.float32): - numpy_format.append(('f{}'.format(i), param.data_type)) + numpy_format.append((f"f{{{i}}}", param.data_type)) numpy_values.append(param.value) elif (param.data_type is DataType.S1615): - numpy_format.append(('f{}'.format(i), numpy.uint32)) + numpy_format.append((f"f{{{i}}}", numpy.uint32)) numpy_values.append( int(param.value * float(DataType.S1615.scale))) else: @@ -124,16 +124,16 @@ def _get_model_state_array(self): numpy_values = list() for i, param in enumerate(state): if (param.data_type is numpy.float64): - numpy_format.append(('f{}'.format(i), param.data_type)) + numpy_format.append((f"f{{{i}}}", param.data_type)) numpy_values.append(param.initial_value) elif (param.data_type is numpy.float32): - numpy_format.append(('f{}'.format(i), param.data_type)) + numpy_format.append((f"f{{{i}}}", param.data_type)) numpy_values.append(param.initial_value) elif (param.data_type is numpy.uint32): - numpy_format.append(('f{}'.format(i), param.data_type)) + numpy_format.append((f"f{{{i}}}", param.data_type)) numpy_values.append(param.initial_value) elif (param.data_type is DataType.S1615): - numpy_format.append(('f{}'.format(i), numpy.uint32)) + numpy_format.append((f"f{{{i}}}", numpy.uint32)) numpy_values.append( int(param.initial_value * float(DataType.S1615.scale))) else: diff --git a/mcmc_examples/arma/arma.py b/mcmc_examples/arma/arma.py index 4318d41..fb324dc 100644 --- a/mcmc_examples/arma/arma.py +++ b/mcmc_examples/arma/arma.py @@ -104,11 +104,11 @@ # print('samples: ', samples) # Save the results -dirpath = "results_{}_nboards{}_nsamples{}".format( - strftime("%Y-%m-%d_%H:%M:%S", gmtime()), n_boards, n_samples) +dirpath = (f'results_{strftime("%Y-%m-%d_%H:%M:%S", gmtime())}' + f'_nboards{n_boards}_nsamples{n_samples}') os.mkdir(dirpath) for coord, sample in samples.items(): - fname = "{}/results_board_x{}_y{}_nboards{}_nsamples{}".format( - dirpath, coord[0], coord[1], n_boards, n_samples) + fname = (f"{dirpath}/results_board_x{coord[0]}_y{coord[1]}" + f"_nboards{n_boards}_nsamples{n_samples}") numpy.save(fname+".npy", sample) numpy.savetxt(fname+".csv", sample, fmt="%f", delimiter=",") diff --git a/mcmc_examples/lighthouse/lighthouse.py b/mcmc_examples/lighthouse/lighthouse.py index bbf3b67..57846bb 100644 --- a/mcmc_examples/lighthouse/lighthouse.py +++ b/mcmc_examples/lighthouse/lighthouse.py @@ -300,12 +300,13 @@ def run_job(_thread_id, _model=model, _data_points=None, print('samples: ', samples) - dirpath = "results_{}_nboards{}_nsamples{}".format( - strftime("%Y-%m-%d_%H:%M:%S", gmtime()), n_boards, _n_samples) + dirpath = (f'results_{strftime("%Y-%m-%d_%H:%M:%S", gmtime())}' + f'_nboards{n_boards}_nsamples{_n_samples}') os.mkdir(dirpath) for coord, sample in samples.items(): - fname = "{}/results_th{}_board_x{}_y{}_nboards{}_nsamples{}".format( - dirpath, _thread_id[0], coord[0], coord[1], n_boards, _n_samples) + fname = (f"{dirpath}/results_th{_thread_id[0]}" + f"_board_x{coord[0]}_y{coord[1]}_nboards{n_boards}" + f"_nsamples{_n_samples}") numpy.save(fname+".npy", sample) numpy.savetxt(fname+".csv", sample, fmt="%f", delimiter=",") From 6d7c16a92db0d301704c66a2053c004586083bed Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 10 Jun 2024 15:28:59 +0100 Subject: [PATCH 09/37] pylint fixes --- mcmc_examples/arma/arma.py | 4 ++-- mcmc_examples/arma/arma_float_model.py | 18 ++++++++++++------ mcmc_examples/arma/arma_model.py | 18 +++++++----------- mcmc_examples/lighthouse/lighthouse.py | 6 +++--- .../lighthouse/lighthouse_float_model.py | 13 ++++++++++--- 5 files changed, 34 insertions(+), 25 deletions(-) diff --git a/mcmc_examples/arma/arma.py b/mcmc_examples/arma/arma.py index fb324dc..430dd13 100644 --- a/mcmc_examples/arma/arma.py +++ b/mcmc_examples/arma/arma.py @@ -66,7 +66,7 @@ nq = 9 # set up parameters array with p polynomial -# and scaling of t transition distribution for MH jumps in p direction +# and scaling of t transition distribution for jumps in p direction parameters = [] jump_scale = [] for i in range(0, np): @@ -74,7 +74,7 @@ jump_scale.append(0.0001) # add q polynomial to parameters array -# scaling of t transition distribution for MH jumps in q direction +# scaling of t transition distribution for jumps in q direction for i in range(0, nq): parameters.append(0.01) jump_scale.append(0.0001) diff --git a/mcmc_examples/arma/arma_float_model.py b/mcmc_examples/arma/arma_float_model.py index 2246763..2791314 100644 --- a/mcmc_examples/arma/arma_float_model.py +++ b/mcmc_examples/arma/arma_float_model.py @@ -33,6 +33,8 @@ def __init__( array of coefficients of polynomials, plus mu and sigma :param jump_scale:\ array of jump scale values for parameters + :param bool root_finder: + :param bool cholesky: """ self._parameters = parameters self._jump_scale = jump_scale @@ -47,9 +49,8 @@ def get_binary_name(self) -> str: def get_parameters(self) -> List[MCMCParameter]: # Best here to convert the arrays into individual values return_params = [] - for i in range(len(self._jump_scale)): - return_params.append( - MCMCParameter(self._jump_scale[i], numpy.float32)) + for jump_scale in self._jump_scale: + return_params.append(MCMCParameter(jump_scale, numpy.float32)) return return_params @@ -57,17 +58,22 @@ def get_parameters(self) -> List[MCMCParameter]: def get_state_variables(self) -> List[MCMCStateVariable]: # Best here to convert the arrays into individual values return_state_vars = [] - for i in range(len(self._parameters)): + for i, parameter in enumerate(self._parameters): return_state_vars.append( - MCMCStateVariable("param_"+str(i), - self._parameters[i], numpy.float32)) + MCMCStateVariable("param_"+str(i), parameter, numpy.float32)) return return_state_vars @property def root_finder(self): + """ + the root_finder value passed into the init + """ return self._root_finder @property def cholesky(self): + """ + The cholesky passed into the init + """ return self._cholesky diff --git a/mcmc_examples/arma/arma_model.py b/mcmc_examples/arma/arma_model.py index 4861e9c..a8c59a4 100644 --- a/mcmc_examples/arma/arma_model.py +++ b/mcmc_examples/arma/arma_model.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import numpy from typing import List from spinn_utilities.overrides import overrides @@ -19,8 +20,6 @@ from mcmc.mcmc_parameter import MCMCParameter from mcmc.mcmc_state_variable import MCMCStateVariable -import numpy - class ARMAModel(MCMCModel): """ MCMC Model for the ARMA problem, using double (float64) @@ -49,12 +48,10 @@ def get_binary_name(self) -> str: def get_parameters(self) -> List[MCMCParameter]: # It's probably best here to convert the arrays into individual values? return_params = [] - for i in range(len(self._p_jump_scale)): - return_params.append( - MCMCParameter(self._p_jump_scale[i], numpy.float64)) - for i in range(len(self._q_jump_scale)): - return_params.append( - MCMCParameter(self._q_jump_scale[i], numpy.float64)) + for p_jump_scale in self._p_jump_scale: + return_params.append(MCMCParameter(p_jump_scale, numpy.float64)) + for q_jump_scale in self._q_jump_scale: + return_params.append(MCMCParameter(q_jump_scale, numpy.float64)) return return_params @@ -62,9 +59,8 @@ def get_parameters(self) -> List[MCMCParameter]: def get_state_variables(self) -> List[MCMCStateVariable]: # It's probably best here to convert the arrays into individual values? return_state_vars = [] - for i in range(len(self._parameters)): + for i, parameter in enumerate(self._parameters): return_state_vars.append( - MCMCStateVariable("param_"+str(i), - self._parameters[i], numpy.float64)) + MCMCStateVariable("param_"+str(i), parameter, numpy.float64)) return return_state_vars diff --git a/mcmc_examples/lighthouse/lighthouse.py b/mcmc_examples/lighthouse/lighthouse.py index 57846bb..5e818e8 100644 --- a/mcmc_examples/lighthouse/lighthouse.py +++ b/mcmc_examples/lighthouse/lighthouse.py @@ -14,8 +14,8 @@ import sys import os -import pathos.multiprocessing from time import gmtime, strftime +import pathos.multiprocessing import numpy from mcmc import mcmc_framework # from mcmc_examples.lighthouse.lighthouse_model import LightHouseModel @@ -260,10 +260,10 @@ print("Running MCMC lighthouse on ", n_boards, " boards, and collecting ", n_samples, " samples") -# scaling of t transition distribution for MH jumps in alpha direction +# scaling of t transition distribution for jumps in alpha direction alpha_jump_scale = 0.8 -# scaling of t transition distribution for MH jumps in beta direction +# scaling of t transition distribution for jumps in beta direction beta_jump_scale = 0.25 # specification of prior knowledge about lighthouse position diff --git a/mcmc_examples/lighthouse/lighthouse_float_model.py b/mcmc_examples/lighthouse/lighthouse_float_model.py index 7dfdd2b..7c6a3f2 100644 --- a/mcmc_examples/lighthouse/lighthouse_float_model.py +++ b/mcmc_examples/lighthouse/lighthouse_float_model.py @@ -15,13 +15,12 @@ from typing import List from spinn_utilities.overrides import overrides +import numpy + from mcmc.mcmc_model import MCMCModel from mcmc.mcmc_parameter import MCMCParameter from mcmc.mcmc_state_variable import MCMCStateVariable -import numpy - - class LightHouseFloatModel(MCMCModel): """ MCMC Model for the lighthouse problem, using float(32) """ @@ -39,6 +38,8 @@ def __init__( scaling of t transition distribution for MH jumps in beta direction :param beta_min: The minimum value of beta :param beta_max: The maximum value of beta + :param bool root_finder: + :param bool cholesky: """ self._alpha_jump_scale = alpha_jump_scale @@ -74,8 +75,14 @@ def get_state_variables(self) -> List[MCMCStateVariable]: @property def root_finder(self): + """ + The root_finder value passed into the init + """ return self._root_finder @property def cholesky(self): + """ + The cholesky value as passed into the init + """ return self._cholesky From ac9c5c5cec2a3fbe49292c3bd04b552bccfea5bd Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 10 Jun 2024 15:31:36 +0100 Subject: [PATCH 10/37] flake8 fixes --- mcmc_examples/lighthouse/lighthouse_float_model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mcmc_examples/lighthouse/lighthouse_float_model.py b/mcmc_examples/lighthouse/lighthouse_float_model.py index 7c6a3f2..c98ac09 100644 --- a/mcmc_examples/lighthouse/lighthouse_float_model.py +++ b/mcmc_examples/lighthouse/lighthouse_float_model.py @@ -21,6 +21,7 @@ from mcmc.mcmc_parameter import MCMCParameter from mcmc.mcmc_state_variable import MCMCStateVariable + class LightHouseFloatModel(MCMCModel): """ MCMC Model for the lighthouse problem, using float(32) """ From 1921ccb72e082f7183b0182ced6ae2958e928c9e Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 11 Jun 2024 06:50:23 +0100 Subject: [PATCH 11/37] PyLint fixes --- mcmc/mcmc_model.py | 3 +++ mcmc/mcmc_parameter.py | 6 ++++++ mcmc/mcmc_root_finder_vertex.py | 14 +++++++------- mcmc/mcmc_state_variable.py | 9 +++++++++ 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/mcmc/mcmc_model.py b/mcmc/mcmc_model.py index f4b379e..91c56be 100644 --- a/mcmc/mcmc_model.py +++ b/mcmc/mcmc_model.py @@ -20,6 +20,9 @@ class MCMCModel(object, metaclass=AbstractBase): + """ + Base class frr Markov chain Monte Carlo models + """ @abstractmethod def get_parameters(self) -> List[MCMCParameter]: diff --git a/mcmc/mcmc_parameter.py b/mcmc/mcmc_parameter.py index e9b56a9..8a95203 100644 --- a/mcmc/mcmc_parameter.py +++ b/mcmc/mcmc_parameter.py @@ -27,8 +27,14 @@ def __init__(self, value, data_type): @property def value(self): + """ + The value of the parameter + """ return self._value @property def data_type(self): + """ + The numpy data type of the parameter + """ return self._data_type diff --git a/mcmc/mcmc_root_finder_vertex.py b/mcmc/mcmc_root_finder_vertex.py index 6661c13..50813f6 100644 --- a/mcmc/mcmc_root_finder_vertex.py +++ b/mcmc/mcmc_root_finder_vertex.py @@ -12,14 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -from pacman.model.graphs.machine import MachineVertex -from pacman.model.resources import ConstantSDRAM -from spinn_utilities.overrides import overrides -from pacman.model.placements import Placement +from enum import Enum + +from spinn_utilities.overrides import overrides from spinnman.model.enums import ExecutableType +from pacman.model.graphs.machine import MachineVertex +from pacman.model.placements import Placement +from pacman.model.resources import ConstantSDRAM + from spinn_front_end_common.abstract_models.abstract_has_associated_binary \ import AbstractHasAssociatedBinary from spinn_front_end_common.abstract_models\ @@ -27,9 +30,6 @@ import AbstractGeneratesDataSpecification from spinn_front_end_common.interface.ds import DataSpecificationGenerator -from enum import Enum - - class MCMCRootFinderRegions(Enum): """ Regions in the MCMCRootFinder Data """ diff --git a/mcmc/mcmc_state_variable.py b/mcmc/mcmc_state_variable.py index fa1d877..334b59e 100644 --- a/mcmc/mcmc_state_variable.py +++ b/mcmc/mcmc_state_variable.py @@ -28,12 +28,21 @@ def __init__(self, name, initial_value, data_type): @property def name(self): + """ + The name of the variable + """ return self._name @property def initial_value(self): + """ + + """ return self._initial_value @property def data_type(self): + """ + The numpy data type of the variable. + """ return self._data_type From 7a1a6d7b14a7a4a1446868d16b8d66e6e3d3ccc7 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 11 Jun 2024 07:00:13 +0100 Subject: [PATCH 12/37] flake8 --- mcmc/mcmc_root_finder_vertex.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mcmc/mcmc_root_finder_vertex.py b/mcmc/mcmc_root_finder_vertex.py index 50813f6..0752f22 100644 --- a/mcmc/mcmc_root_finder_vertex.py +++ b/mcmc/mcmc_root_finder_vertex.py @@ -30,6 +30,7 @@ import AbstractGeneratesDataSpecification from spinn_front_end_common.interface.ds import DataSpecificationGenerator + class MCMCRootFinderRegions(Enum): """ Regions in the MCMCRootFinder Data """ From 953964a73b1bf4fd0cd40127986be79fdf99f06c Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 11 Jun 2024 08:10:04 +0100 Subject: [PATCH 13/37] pylint fixes --- mcmc/mcmc_coordinator_vertex.py | 52 ++++++++++++++++++++ mcmc/mcmc_framework.py | 36 +++++++------- mcmc/mcmc_state_variable.py | 2 +- mcmc/mcmc_vertex.py | 39 +++++++++++++++ mcmc_examples/arma/arma_model.py | 2 +- mcmc_examples/lighthouse/lighthouse_model.py | 9 +++- 6 files changed, 118 insertions(+), 22 deletions(-) diff --git a/mcmc/mcmc_coordinator_vertex.py b/mcmc/mcmc_coordinator_vertex.py index 559ca5d..1915d24 100644 --- a/mcmc/mcmc_coordinator_vertex.py +++ b/mcmc/mcmc_coordinator_vertex.py @@ -118,29 +118,50 @@ def __init__( self._data_receiver = dict() def register_processor(self, mcmc_vertex): + """ + Records the vertex to its list of vertices + """ self._mcmc_vertices.append(mcmc_vertex) @property def n_samples(self): + """ + n_samples as passed into the init. + """ return self._n_samples @property def burn_in(self): + """ + burn_in as passed inot the init + """ return self._burn_in @property def thinning(self): + """ + thinning as passed into the init + """ return self._thinning @property def degrees_of_freedom(self): + """ + degrees_of_freedom as passed into the init + """ return self._degrees_of_freedom @property def n_data_points(self): + """ + The length of the data passed inot the init + """ return len(self._data) def _is_receiver_placement(self, placement): + """ + Checks if this is the first placement seen with this X, Y + """ x = placement.x y = placement.y if (x, y) not in self._data_receiver: @@ -149,11 +170,20 @@ def _is_receiver_placement(self, placement): return self._data_receiver[(x, y)] == placement.p def get_data_window_size(self, placement): + """ + Gets the window size passed into the init if this is the first \ + placement seen with this X, Y otherwise 0 + """ if self._is_receiver_placement(placement): return self._window_size return 0 def get_sequence_mask(self, placement, routing_info): + """ + Gets the mask for the data_partition_name vertex + + Only if this is the first placement seen with this X, Y otherwise 0 + """ if self._is_receiver_placement(placement): mask = routing_info.get_routing_info_from_pre_vertex( self, self._data_partition_name).mask @@ -161,6 +191,11 @@ def get_sequence_mask(self, placement, routing_info): return 0 def get_acknowledge_key(self, placement, routing_info): + """ + Gets the key for the acknowledge_partition_name vertex + + Only if this is the first placement seen with this X, Y otherwise 0 + """ if self._is_receiver_placement(placement): key = routing_info.get_first_key_from_pre_vertex( placement.vertex, self._acknowledge_partition_name) @@ -169,24 +204,41 @@ def get_acknowledge_key(self, placement, routing_info): @property def data_tag(self): + """ + Gets the data_tag value passed into the init + """ return self._data_tag @property def acknowledge_timer(self): + """ + Gets the receive_timer passed inot the init + """ return self._receive_timer @property def seed(self): + """ + Get a consistent random seed + + Uses the one passed into the init or creates one on the first call + """ if self._seed is None: return [random.randint(0, 0xFFFFFFFF) for _ in range(5)] return self._seed @property def data_partition_name(self): + """ + The data_partition_name passed into the init. + """ return self._data_partition_name @property def acknowledge_partition_name(self): + """ + acknowledge_partition_name passed inot the init. + """ return self._acknowledge_partition_name @property diff --git a/mcmc/mcmc_framework.py b/mcmc/mcmc_framework.py index b5138de..50142cb 100644 --- a/mcmc/mcmc_framework.py +++ b/mcmc/mcmc_framework.py @@ -12,23 +12,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -import spinnaker_graph_front_end as g +import logging +import time from spinnman.exceptions import SpinnmanException -from .mcmc_vertex import MCMCVertex -from .mcmc_coordinator_vertex import MCMCCoordinatorVertex -from .mcmc_root_finder_vertex import MCMCRootFinderVertex -from .mcmc_cholesky_vertex import MCMCCholeskyVertex -from . import model_binaries +from spinnman.model.enums.cpu_state import CPUState from pacman.model.graphs.machine import MachineEdge -from spinnman.model.enums.cpu_state import CPUState - from spinn_front_end_common.data import FecDataView -import logging -import time +import spinnaker_graph_front_end as g + +from .mcmc_vertex import MCMCVertex +from .mcmc_coordinator_vertex import MCMCCoordinatorVertex +from .mcmc_root_finder_vertex import MCMCRootFinderVertex +from .mcmc_cholesky_vertex import MCMCCholeskyVertex +from . import model_binaries # timing start_time = time.time() @@ -246,13 +246,13 @@ def run_mcmc( finish_time = time.time() # Note: this timing appears to be incorrect now; needs looking at - print("Overhead time is %s seconds" % (start_computing_time - start_time)) - print("Computing time is %s seconds" - % (finish_computing_time - start_computing_time)) - print("run_until_complete takes %s seconds" - % (mid_computing_time - start_computing_time)) - print("Data collecting time is %s seconds" - % (finish_time - finish_computing_time)) - print("Overall running time is %s seconds" % (finish_time - start_time)) + print(f"Overhead time is {start_computing_time - start_time} seconds" ) + print(f"Computing time is {finish_computing_time - start_computing_time}" + f" seconds") + print(f"run_until_complete takes " + f"{mid_computing_time - start_computing_time} seconds") + print(f"Data collecting time is " + f"{finish_time - finish_computing_time} seconds") + print(f"Overall running time is {finish_time - start_time} seconds") return samples diff --git a/mcmc/mcmc_state_variable.py b/mcmc/mcmc_state_variable.py index 334b59e..bda243f 100644 --- a/mcmc/mcmc_state_variable.py +++ b/mcmc/mcmc_state_variable.py @@ -36,7 +36,7 @@ def name(self): @property def initial_value(self): """ - + The initial value as passed inot the init """ return self._initial_value diff --git a/mcmc/mcmc_vertex.py b/mcmc/mcmc_vertex.py index 1ef6e66..90fc593 100644 --- a/mcmc/mcmc_vertex.py +++ b/mcmc/mcmc_vertex.py @@ -97,6 +97,9 @@ def __init__(self, coordinator, model, self._cholesky_data_receiver = dict() def _get_model_parameters_array(self): + """ + Convert the models parameters into a numpy array + """ parameters = self._model.get_parameters() numpy_format = list() numpy_values = list() @@ -119,6 +122,9 @@ def _get_model_parameters_array(self): [tuple(numpy_values)], dtype=numpy_format).view("uint32") def _get_model_state_array(self): + """ + Convert the models state variables into a numpy array + """ state = self._model.get_state_variables() numpy_format = list() numpy_values = list() @@ -144,6 +150,11 @@ def _get_model_state_array(self): [tuple(numpy_values)], dtype=numpy_format).view("uint32") def get_result_key(self, placement): + """ + Get the key for the given placement if it is the first on this X Y + + param Placement placement: the placement to get the result key for + """ if self._is_receiver_placement(placement): routing_info = FecDataView.get_routing_infos() key = routing_info.get_first_key_from_pre_vertex( @@ -152,6 +163,9 @@ def get_result_key(self, placement): return 0 def _is_receiver_placement(self, placement): + """ + Checks if this is the first placement seen with this X, Y + """ x = placement.x y = placement.y if (x, y) not in self._data_receiver: @@ -160,6 +174,11 @@ def _is_receiver_placement(self, placement): return self._data_receiver[(x, y)] == placement.p def get_cholesky_result_key(self, placement): + """ + Get the key for the given placement if it is the first on this X Y + + param Placement placement: the placement to get the result key for + """ if self._is_cholesky_receiver_placement(placement): routing_info = FecDataView.get_routing_infos() key = routing_info.get_first_key_from_pre_vertex( @@ -168,6 +187,9 @@ def get_cholesky_result_key(self, placement): return 0 def _is_cholesky_receiver_placement(self, placement): + """ + Checks if this is the first placement seen with this X, Y + """ x = placement.x y = placement.y if (x, y) not in self._cholesky_data_receiver: @@ -177,22 +199,37 @@ def _is_cholesky_receiver_placement(self, placement): @property def coordinator(self): + """ + Returns the coordinator vertex passed intoi the init + """ return self._coordinator @property def parameter_partition_name(self): + """ + The parameter_partition_name passed into the init + """ return self._parameter_partition_name @property def result_partition_name(self): + """ + The result_partition_name passed into the init + """ return self._result_partition_name @property def cholesky_partition_name(self): + """ + The cholesky_partition_name passed into the init + """ return self._cholesky_partition_name @property def cholesky_result_partition_name(self): + """ + The cholesky_result_partition_name passed into the init + """ return self._cholesky_result_partition_name @property @@ -343,9 +380,11 @@ def read_samples(self, buffer_manager, placement): else: return numpy.array(data, dtype="uint8").view(numpy_format) + @overrides(AbstractReceiveBuffersToHost.get_recorded_region_ids) def get_recorded_region_ids(self): return [0] + @overrides(AbstractReceiveBuffersToHost.get_recording_region_base_address) def get_recording_region_base_address(self, placement): return helpful_functions.locate_memory_region_for_placement( placement, MCMCRegions.RECORDING.value) diff --git a/mcmc_examples/arma/arma_model.py b/mcmc_examples/arma/arma_model.py index a8c59a4..99d50b6 100644 --- a/mcmc_examples/arma/arma_model.py +++ b/mcmc_examples/arma/arma_model.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy from typing import List +import numpy from spinn_utilities.overrides import overrides from mcmc.mcmc_model import MCMCModel diff --git a/mcmc_examples/lighthouse/lighthouse_model.py b/mcmc_examples/lighthouse/lighthouse_model.py index 5580324..d210420 100644 --- a/mcmc_examples/lighthouse/lighthouse_model.py +++ b/mcmc_examples/lighthouse/lighthouse_model.py @@ -13,14 +13,13 @@ # limitations under the License. from typing import List +import numpy from spinn_utilities.overrides import overrides from mcmc.mcmc_model import MCMCModel from mcmc.mcmc_parameter import MCMCParameter from mcmc.mcmc_state_variable import MCMCStateVariable -import numpy - class LightHouseModel(MCMCModel): """ MCMC Model for the lighthouse problem @@ -74,8 +73,14 @@ def get_state_variables(self) -> List[MCMCStateVariable]: @property def root_finder(self): + """ + The root_finder passed inot the init. + """ return self._root_finder @property def cholesky(self): + """ + The cholesky passed into the init. + """ return self._cholesky From ea6c6a0b22cff3ef88356c0dca8030dfd282bfd6 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 11 Jun 2024 09:06:28 +0100 Subject: [PATCH 14/37] flake8 --- mcmc/mcmc_framework.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcmc/mcmc_framework.py b/mcmc/mcmc_framework.py index 50142cb..c283ebd 100644 --- a/mcmc/mcmc_framework.py +++ b/mcmc/mcmc_framework.py @@ -246,7 +246,7 @@ def run_mcmc( finish_time = time.time() # Note: this timing appears to be incorrect now; needs looking at - print(f"Overhead time is {start_computing_time - start_time} seconds" ) + print(f"Overhead time is {start_computing_time - start_time} seconds") print(f"Computing time is {finish_computing_time - start_computing_time}" f" seconds") print(f"run_until_complete takes " From d07d8685715c0469725298d1647a05c71b81ec88 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 11 Jun 2024 16:39:41 +0100 Subject: [PATCH 15/37] pylint fixes --- mcmc/mcmc_coordinator_vertex.py | 11 +++++------ mcmc/mcmc_vertex.py | 10 +++++----- mcmc_examples/lighthouse/lighthouse.py | 3 +++ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/mcmc/mcmc_coordinator_vertex.py b/mcmc/mcmc_coordinator_vertex.py index 1915d24..7948552 100644 --- a/mcmc/mcmc_coordinator_vertex.py +++ b/mcmc/mcmc_coordinator_vertex.py @@ -13,14 +13,17 @@ # limitations under the License. from typing import List +import random +import numpy -from pacman.model.graphs.machine import MachineVertex -from pacman.model.resources import ConstantSDRAM from spinn_utilities.overrides import overrides +from spinn_utilities.progress_bar import ProgressBar from spinnman.model.enums import ExecutableType +from pacman.model.graphs.machine import MachineVertex from pacman.model.placements import Placement +from pacman.model.resources import ConstantSDRAM from spinn_front_end_common.abstract_models.abstract_has_associated_binary \ import AbstractHasAssociatedBinary @@ -30,10 +33,6 @@ from spinn_front_end_common.data import FecDataView from spinn_front_end_common.interface.ds import ( DataSpecificationGenerator, DataType) -from spinn_utilities.progress_bar import ProgressBar - -import numpy -import random class MCMCCoordinatorVertex( diff --git a/mcmc/mcmc_vertex.py b/mcmc/mcmc_vertex.py index 90fc593..6eca989 100644 --- a/mcmc/mcmc_vertex.py +++ b/mcmc/mcmc_vertex.py @@ -12,13 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -from pacman.model.graphs.machine import MachineVertex -from pacman.model.resources import ConstantSDRAM +from enum import Enum +import numpy + from spinn_utilities.overrides import overrides from spinnman.model.enums import ExecutableType +from pacman.model.graphs.machine import MachineVertex from pacman.model.placements import Placement +from pacman.model.resources import ConstantSDRAM from spinn_front_end_common.abstract_models.abstract_has_associated_binary \ import AbstractHasAssociatedBinary @@ -34,9 +37,6 @@ from spinn_front_end_common.interface.buffer_management \ import recording_utilities -from enum import Enum -import numpy - class MCMCRegions(Enum): """ Regions in the MCMC Data diff --git a/mcmc_examples/lighthouse/lighthouse.py b/mcmc_examples/lighthouse/lighthouse.py index 5e818e8..4e048a2 100644 --- a/mcmc_examples/lighthouse/lighthouse.py +++ b/mcmc_examples/lighthouse/lighthouse.py @@ -292,6 +292,9 @@ def run_job(_thread_id, _model=model, _data_points=None, _n_samples=n_samples, _seed=seed): + """ + Main method to run once or in multiple threads + """ if _data_points is None: _data_points = list(data_points) samples = mcmc_framework.run_mcmc( From f3f1fed6388348f56e4bd02abe033740088aa6b6 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 11 Jun 2024 16:43:51 +0100 Subject: [PATCH 16/37] move imports --- mcmc_examples/arma/arma_float_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcmc_examples/arma/arma_float_model.py b/mcmc_examples/arma/arma_float_model.py index 2791314..d270f13 100644 --- a/mcmc_examples/arma/arma_float_model.py +++ b/mcmc_examples/arma/arma_float_model.py @@ -13,14 +13,14 @@ # limitations under the License. from typing import List +import numpy + from spinn_utilities.overrides import overrides from mcmc.mcmc_model import MCMCModel from mcmc.mcmc_parameter import MCMCParameter from mcmc.mcmc_state_variable import MCMCStateVariable -import numpy - class ARMAFloatModel(MCMCModel): """ MCMC Model for the ARMA problem, using single-point (float) From 6076d85b8db64877f6d6f4166ad7a0d4431ed8dc Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 11 Jun 2024 16:50:01 +0100 Subject: [PATCH 17/37] typing --- mcmc/mcmc_vertex.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mcmc/mcmc_vertex.py b/mcmc/mcmc_vertex.py index 6eca989..6b17024 100644 --- a/mcmc/mcmc_vertex.py +++ b/mcmc/mcmc_vertex.py @@ -13,6 +13,7 @@ # limitations under the License. from enum import Enum +from typing import Sequence import numpy from spinn_utilities.overrides import overrides @@ -381,7 +382,7 @@ def read_samples(self, buffer_manager, placement): return numpy.array(data, dtype="uint8").view(numpy_format) @overrides(AbstractReceiveBuffersToHost.get_recorded_region_ids) - def get_recorded_region_ids(self): + def get_recorded_region_ids(self) -> Sequence[int]: return [0] @overrides(AbstractReceiveBuffersToHost.get_recording_region_base_address) From 2e7c676e4a9b2f2ca164c29a8a7e0e85a0c62c87 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 11 Jun 2024 16:52:19 +0100 Subject: [PATCH 18/37] typing --- mcmc/mcmc_vertex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcmc/mcmc_vertex.py b/mcmc/mcmc_vertex.py index 6b17024..0829cbf 100644 --- a/mcmc/mcmc_vertex.py +++ b/mcmc/mcmc_vertex.py @@ -386,6 +386,6 @@ def get_recorded_region_ids(self) -> Sequence[int]: return [0] @overrides(AbstractReceiveBuffersToHost.get_recording_region_base_address) - def get_recording_region_base_address(self, placement): + def get_recording_region_base_address(self, placement: Placement): return helpful_functions.locate_memory_region_for_placement( placement, MCMCRegions.RECORDING.value) From fdd95a5b6637552e88907a9b5c9973fd2b893ade Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 11 Jun 2024 17:00:02 +0100 Subject: [PATCH 19/37] typing --- mcmc/mcmc_vertex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcmc/mcmc_vertex.py b/mcmc/mcmc_vertex.py index 0829cbf..774df3b 100644 --- a/mcmc/mcmc_vertex.py +++ b/mcmc/mcmc_vertex.py @@ -386,6 +386,6 @@ def get_recorded_region_ids(self) -> Sequence[int]: return [0] @overrides(AbstractReceiveBuffersToHost.get_recording_region_base_address) - def get_recording_region_base_address(self, placement: Placement): + def get_recording_region_base_address(self, placement: Placement) -> int: return helpful_functions.locate_memory_region_for_placement( placement, MCMCRegions.RECORDING.value) From a362ea0ed52a6247b9d8d9f036c89282ca8339d9 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 13 Jun 2024 13:31:22 +0100 Subject: [PATCH 20/37] mypy examples --- .github/workflows/python_actions.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/python_actions.yml b/.github/workflows/python_actions.yml index 7794b77..9e54b55 100644 --- a/.github/workflows/python_actions.yml +++ b/.github/workflows/python_actions.yml @@ -33,10 +33,7 @@ jobs: # invalid-name because scripts have values pylint considers constants # wrong-spelling-in-docstring due to param names ect pylint-disable: R, wrong-spelling-in-docstring, invalid-name - mypy-packages: mcmc + mypy-packages: mcmc mcmc_examples cfg_file: spiNNakerGraphFrontEnd run_sphinx: false run_cff-validator: false - - # pylint mcmc mcmc_examples - # mypy mypy mcmc \ No newline at end of file From 5be1595d3d11d00228c6d28c841a5158605d68b2 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 13 Jun 2024 14:43:16 +0100 Subject: [PATCH 21/37] # type: ignore --- mcmc_examples/lighthouse/lighthouse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcmc_examples/lighthouse/lighthouse.py b/mcmc_examples/lighthouse/lighthouse.py index 4e048a2..c144a1a 100644 --- a/mcmc_examples/lighthouse/lighthouse.py +++ b/mcmc_examples/lighthouse/lighthouse.py @@ -15,7 +15,7 @@ import sys import os from time import gmtime, strftime -import pathos.multiprocessing +import pathos.multiprocessing # type: ignore import numpy from mcmc import mcmc_framework # from mcmc_examples.lighthouse.lighthouse_model import LightHouseModel From 788f7dddae3f493f5efe1fdd6c16e5b98a503f7b Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 2 Jul 2024 11:37:07 +0100 Subject: [PATCH 22/37] flake8 --- mcmc_examples/lighthouse/lighthouse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcmc_examples/lighthouse/lighthouse.py b/mcmc_examples/lighthouse/lighthouse.py index c144a1a..02ca4bf 100644 --- a/mcmc_examples/lighthouse/lighthouse.py +++ b/mcmc_examples/lighthouse/lighthouse.py @@ -15,7 +15,7 @@ import sys import os from time import gmtime, strftime -import pathos.multiprocessing # type: ignore +import pathos.multiprocessing # type: ignore import numpy from mcmc import mcmc_framework # from mcmc_examples.lighthouse.lighthouse_model import LightHouseModel From 28d065cedab0d3687e1e6d7f376cf8263b620282 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 4 Jul 2024 07:31:49 +0100 Subject: [PATCH 23/37] default python version for c actions --- .github/workflows/c_actions.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/c_actions.yml b/.github/workflows/c_actions.yml index 1088335..22e91b9 100644 --- a/.github/workflows/c_actions.yml +++ b/.github/workflows/c_actions.yml @@ -26,7 +26,6 @@ jobs: - name: Prepare uses: SpiNNakerManchester/SupportScripts/actions/prepare@main with: - python-version: "3.12" checkout_dependencies: spinnaker_tools spinn_common SpiNNFrontEndCommon install_dependencies: SpiNNUtils install_module: false From 71775908086bb3791225b2779de386b7401fc5f6 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 4 Jul 2024 09:34:09 +0100 Subject: [PATCH 24/37] actually run the code --- .github/workflows/c_actions.yml | 86 ++++++++++++++++++++++++++++++--- 1 file changed, 79 insertions(+), 7 deletions(-) diff --git a/.github/workflows/c_actions.yml b/.github/workflows/c_actions.yml index 22e91b9..fe8f9c8 100644 --- a/.github/workflows/c_actions.yml +++ b/.github/workflows/c_actions.yml @@ -38,10 +38,10 @@ jobs: with: base-dir: c_models - - name: Set SPINN_DIRS + - name: "Prepare: Set Environment variables" run: | - echo "Set SPINN_DIRS to $PWD/spinnaker_tools" echo "SPINN_DIRS=$PWD/spinnaker_tools" >> $GITHUB_ENV + echo "C_LOGS_DICT=$PWD/logs.sqlite3" >> $GITHUB_ENV - name: Build SpiNNaker C dependencies run: | @@ -49,15 +49,87 @@ jobs: make -C spinn_common install make -C SpiNNFrontEndCommon/c_common install + - name: Build FEC C code + run: make + working-directory: SpiNNFrontEndCommon/c_common + env: + CFLAGS: -fdiagnostics-color=always + - name: Build C code run: make working-directory: c_models env: CFLAGS: -fdiagnostics-color=always - # To be added: Documentation building -# - name: Build documentation using doxygen -# run: make doxysetup doxygen -# working-directory: c_models + - name: Upload Fec binaries + uses: actions/upload-artifact@v4 + with: + name: fec_binaries + path: SpiNNFrontEndCommon/spinn_front_end_common/common_model_binaries/*.aplx + retention-days: 5 + + - name: Upload mcmc binaries + uses: actions/upload-artifact@v4 + with: + name: mcmc_binary + path: mcmc/model_binaries/*.aplx + retention-days: 5 + + - name: Upload log.sqlite3s + uses: actions/upload-artifact@v4 + with: + name: logs.sqlite3 + path: logs.sqlite3 + retention-days: 5 + + test: + needs: build + runs-on: ${{ matrix.runner }} + timeout-minutes: 20 + strategy: + matrix: + runner: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - name: Prepare + uses: SpiNNakerManchester/SupportScripts/actions/prepare@main + with: + install_dependencies: > + SpiNNUtils SpiNNMachine SpiNNMan PACMAN spalloc + SpiNNFrontEndCommon TestBase SpiNNakerGraphFrontEnd + install_module: true + install_check_tools: false + ubuntu_packages: graphviz + cfg_file: spiNNakerGraphFrontEnd + + - name: Download Fec binaries + uses: actions/download-artifact@v4 + with: + name: fec_binaries + # Need to go into spynnaker as FEC will have been moved by install + path: external_binaries + + - name: Download test_extra_monitor_binary Binaries + uses: actions/download-artifact@v4 + with: + name: mcmc_binary + path: external_binaries + + - name: Download logs.sqlite3 + uses: actions/download-artifact@v4 + with: + name: logs.sqlite3 + path: external_binaries + + - name: Append cfg + # Doing this in the prepare action ended with a different path + run: | + echo '[Mapping]' >> ~/.spiNNakerGraphFrontEnd.cfg + echo "external_binaries=$PWD/external_binaries" >> ~/.spiNNakerGraphFrontEnd.cfg + cat ~/.spiNNakerGraphFrontEnd.cfg - # Note: This workflow does not run the C code; that'd be an integration test \ No newline at end of file + - name: Test with pytest and proxy + env: + SPALLOC_USER: ${{ secrets.SPALLOC_USER }} + SPALLOC_PASSWORD: ${{ secrets.SPALLOC_PASSWORD }} + run: pytest mcmc_integration_tests/test_scripts.py From 6a434708d46a811ada254aef38276c566e5f8f75 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 4 Jul 2024 10:16:41 +0100 Subject: [PATCH 25/37] fix if running as a test --- mcmc_examples/arma/arma.py | 11 ++++++++++- mcmc_examples/lighthouse/lighthouse.py | 12 +++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/mcmc_examples/arma/arma.py b/mcmc_examples/arma/arma.py index 430dd13..71da062 100644 --- a/mcmc_examples/arma/arma.py +++ b/mcmc_examples/arma/arma.py @@ -12,16 +12,22 @@ # See the License for the specific language governing permissions and # limitations under the License. +import logging import sys import os from time import gmtime, strftime import numpy + +from spinn_utilities.log import FormatAdapter + from mcmc import mcmc_framework # from mcmc_examples.arma.arma_model import ARMAModel from mcmc_examples.arma.arma_float_model import ARMAFloatModel # from mcmc_examples.lighthouse.lighthouse_fixed_point_model \ # import ARMAFixedPointModel +logger = FormatAdapter(logging.getLogger(__name__)) + # Data to use for 1000 data points (read from file) data_10000 = numpy.loadtxt("data_10000.csv", delimiter=",") @@ -44,8 +50,11 @@ # get n_samples and n_boards from command line arguments if specified if (len(sys.argv) == 2): - if sys.argv[1] != 'test_scripts.py': + try: n_samples = int(sys.argv[1]) + except ValueError: + # this happens if called as a unittest so can be ignored safely + logger.exception("Unexpected argument {sys.argv[1]}") elif (len(sys.argv) == 3): n_samples = int(sys.argv[1]) n_boards = int(sys.argv[2]) diff --git a/mcmc_examples/lighthouse/lighthouse.py b/mcmc_examples/lighthouse/lighthouse.py index 02ca4bf..8f68903 100644 --- a/mcmc_examples/lighthouse/lighthouse.py +++ b/mcmc_examples/lighthouse/lighthouse.py @@ -12,11 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. +import logging import sys import os from time import gmtime, strftime + import pathos.multiprocessing # type: ignore import numpy + +from spinn_utilities.log import FormatAdapter + from mcmc import mcmc_framework # from mcmc_examples.lighthouse.lighthouse_model import LightHouseModel from mcmc_examples.lighthouse.lighthouse_float_model \ @@ -24,6 +29,8 @@ # from mcmc_examples.lighthouse.lighthouse_fixed_point_model \ # import LightHouseFixedPointModel +logger = FormatAdapter(logging.getLogger(__name__)) + # Data to use for 50 data points data_50 = [ 2.37706, 4.51142, 0.406605, 0.909418, 0.642899, @@ -247,8 +254,11 @@ # get n_samples and n_boards from command line arguments if specified if (len(sys.argv) == 2): - if sys.argv[1] != 'test_scripts.py': + try: n_samples = int(sys.argv[1]) + except ValueError: + # this happens if called as a unittest so can be ignored safely + logger.exception("Unexpected argument {sys.argv[1]}") elif (len(sys.argv) == 3): n_samples = int(sys.argv[1]) n_boards = int(sys.argv[2]) From 0e75bfef349d8ee06c737d74d3ed730e32efa67a Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 4 Jul 2024 12:57:29 +0100 Subject: [PATCH 26/37] run longer --- .github/workflows/c_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c_actions.yml b/.github/workflows/c_actions.yml index fe8f9c8..e37d987 100644 --- a/.github/workflows/c_actions.yml +++ b/.github/workflows/c_actions.yml @@ -85,7 +85,7 @@ jobs: test: needs: build runs-on: ${{ matrix.runner }} - timeout-minutes: 20 + timeout-minutes: 60 strategy: matrix: runner: [ubuntu-latest, windows-latest, macos-latest] From 6ab5c014ccd610ba005547b0b9a89320a7ec80bf Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 4 Jul 2024 14:17:46 +0100 Subject: [PATCH 27/37] remove cfg files. Use the users ones --- mcmc_examples/arma/spiNNakerGraphFrontEnd.cfg | 6 ------ mcmc_examples/lighthouse/spiNNakerGraphFrontEnd.cfg | 6 ------ 2 files changed, 12 deletions(-) delete mode 100644 mcmc_examples/arma/spiNNakerGraphFrontEnd.cfg delete mode 100644 mcmc_examples/lighthouse/spiNNakerGraphFrontEnd.cfg diff --git a/mcmc_examples/arma/spiNNakerGraphFrontEnd.cfg b/mcmc_examples/arma/spiNNakerGraphFrontEnd.cfg deleted file mode 100644 index 5c702f0..0000000 --- a/mcmc_examples/arma/spiNNakerGraphFrontEnd.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[Reports] -writeRouterReports = False -extract_iobuf = True - -[Java] -use_java = True diff --git a/mcmc_examples/lighthouse/spiNNakerGraphFrontEnd.cfg b/mcmc_examples/lighthouse/spiNNakerGraphFrontEnd.cfg deleted file mode 100644 index c47366e..0000000 --- a/mcmc_examples/lighthouse/spiNNakerGraphFrontEnd.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[Reports] -writeRouterReports = False -extract_iobuf = True - -#[Java] -#use_java = True From 073e21509b4b1fc693fd911c2d913e492102357f Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 4 Jul 2024 15:47:49 +0100 Subject: [PATCH 28/37] remove timeout --- .github/workflows/c_actions.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/c_actions.yml b/.github/workflows/c_actions.yml index e37d987..d5e8ffa 100644 --- a/.github/workflows/c_actions.yml +++ b/.github/workflows/c_actions.yml @@ -85,7 +85,6 @@ jobs: test: needs: build runs-on: ${{ matrix.runner }} - timeout-minutes: 60 strategy: matrix: runner: [ubuntu-latest, windows-latest, macos-latest] From ae8bcb74a636c0cb5a7dc19289706b8c70843319 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 8 Jul 2024 06:58:09 +0100 Subject: [PATCH 29/37] Path that works in windows --- mcmc_examples/lighthouse/lighthouse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcmc_examples/lighthouse/lighthouse.py b/mcmc_examples/lighthouse/lighthouse.py index 8f68903..237df08 100644 --- a/mcmc_examples/lighthouse/lighthouse.py +++ b/mcmc_examples/lighthouse/lighthouse.py @@ -313,7 +313,7 @@ def run_job(_thread_id, _model=model, _data_points=None, print('samples: ', samples) - dirpath = (f'results_{strftime("%Y-%m-%d_%H:%M:%S", gmtime())}' + dirpath = (f'results_{strftime("%Y-%m-%d_%H_%M_%S", gmtime())}' f'_nboards{n_boards}_nsamples{_n_samples}') os.mkdir(dirpath) for coord, sample in samples.items(): From a9dfef6865cfd902aa1c5667072f007b72e7db7f Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 8 Jul 2024 07:27:44 +0100 Subject: [PATCH 30/37] use Java --- .github/workflows/c_actions.yml | 52 ++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/.github/workflows/c_actions.yml b/.github/workflows/c_actions.yml index d5e8ffa..c702f75 100644 --- a/.github/workflows/c_actions.yml +++ b/.github/workflows/c_actions.yml @@ -82,8 +82,41 @@ jobs: path: logs.sqlite3 retention-days: 5 + java_compile: + runs-on: ubuntu-latest + timeout-minutes: 100 + steps: + - name: Prepare + uses: SpiNNakerManchester/SupportScripts/actions/prepare@main + with: + checkout_dependencies: JavaSpiNNaker + install_module: false + install_check_tools: false + - name: Set up JRE ${{ matrix.java }} + uses: actions/setup-java@v4.2.1 + with: + distribution: 'zulu' + java-version: 11 + cache: 'maven' + - name: "Set up node cache" + uses: actions/cache@v4 + with: + path: '~/.m2/repository/com/github/eirslett/node' + key: ${{ runner.os }}-node-${{ hashFiles('SpiNNaker-allocserv/pom.xml') }} + restore-keys: ${{ runner.os }}-node- + + - name: Compile + run: mvn clean install --file ./JavaSpiNNaker/pom.xml --settings ./JavaSpiNNaker/.github/settings.xml -B -DskipTests=true -Dmaven.javadoc.skip=true -P "!jsp-precompile" + + - name: Upload Jar + uses: actions/upload-artifact@v4 + with: + name: spinnaker-exe.jar + path: ./JavaSpiNNaker/SpiNNaker-front-end/target/spinnaker-exe.jar + retention-days: 5 + test: - needs: build + needs: [build, java_compile] runs-on: ${{ matrix.runner }} strategy: matrix: @@ -101,6 +134,13 @@ jobs: ubuntu_packages: graphviz cfg_file: spiNNakerGraphFrontEnd + - name: Set up JRE ${{ matrix.java }} + uses: actions/setup-java@v4.2.1 + with: + distribution: 'zulu' + java-version: ${{ matrix.java }} + java-package: jre + - name: Download Fec binaries uses: actions/download-artifact@v4 with: @@ -120,11 +160,21 @@ jobs: name: logs.sqlite3 path: external_binaries + - name: Download jar + uses: actions/download-artifact@v4 + with: + name: spinnaker-exe.jar + # Need to go into spynnaker as FEC will have been moved by install + path: external_binaries + - name: Append cfg # Doing this in the prepare action ended with a different path run: | echo '[Mapping]' >> ~/.spiNNakerGraphFrontEnd.cfg echo "external_binaries=$PWD/external_binaries" >> ~/.spiNNakerGraphFrontEnd.cfg + echo '[Java]' >> ~/.spiNNakerGraphFrontEnd.cfg + echo 'use_java = True' >> ~/.spiNNakerGraphFrontEnd.cfg + echo "java_jar_path=$PWD/external_binaries" >> ~/.spiNNakerGraphFrontEnd.cfg cat ~/.spiNNakerGraphFrontEnd.cfg - name: Test with pytest and proxy From a5343f36a009ee07e77249224c99638128012948 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 8 Jul 2024 07:59:23 +0100 Subject: [PATCH 31/37] java-version: 11 --- .github/workflows/c_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c_actions.yml b/.github/workflows/c_actions.yml index c702f75..8c88c0f 100644 --- a/.github/workflows/c_actions.yml +++ b/.github/workflows/c_actions.yml @@ -138,7 +138,7 @@ jobs: uses: actions/setup-java@v4.2.1 with: distribution: 'zulu' - java-version: ${{ matrix.java }} + java-version: 11 java-package: jre - name: Download Fec binaries From 0b9be166a714337c94bd9e632c61017e27665588 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 8 Jul 2024 09:11:44 +0100 Subject: [PATCH 32/37] fix java_jar_path --- .github/workflows/c_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c_actions.yml b/.github/workflows/c_actions.yml index 8c88c0f..ea5eeb4 100644 --- a/.github/workflows/c_actions.yml +++ b/.github/workflows/c_actions.yml @@ -174,7 +174,7 @@ jobs: echo "external_binaries=$PWD/external_binaries" >> ~/.spiNNakerGraphFrontEnd.cfg echo '[Java]' >> ~/.spiNNakerGraphFrontEnd.cfg echo 'use_java = True' >> ~/.spiNNakerGraphFrontEnd.cfg - echo "java_jar_path=$PWD/external_binaries" >> ~/.spiNNakerGraphFrontEnd.cfg + echo "java_jar_path=$PWD/external_binaries/spinnaker-exe.jar >> ~/.spiNNakerGraphFrontEnd.cfg cat ~/.spiNNakerGraphFrontEnd.cfg - name: Test with pytest and proxy From 323889417dc0121a0accf481a683f812ac22ef30 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 8 Jul 2024 09:16:49 +0100 Subject: [PATCH 33/37] fix java_jar_path again --- .github/workflows/c_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c_actions.yml b/.github/workflows/c_actions.yml index ea5eeb4..5642e59 100644 --- a/.github/workflows/c_actions.yml +++ b/.github/workflows/c_actions.yml @@ -174,7 +174,7 @@ jobs: echo "external_binaries=$PWD/external_binaries" >> ~/.spiNNakerGraphFrontEnd.cfg echo '[Java]' >> ~/.spiNNakerGraphFrontEnd.cfg echo 'use_java = True' >> ~/.spiNNakerGraphFrontEnd.cfg - echo "java_jar_path=$PWD/external_binaries/spinnaker-exe.jar >> ~/.spiNNakerGraphFrontEnd.cfg + echo "java_jar_path=$PWD/external_binaries/spinnaker-exe.jar" >> ~/.spiNNakerGraphFrontEnd.cfg cat ~/.spiNNakerGraphFrontEnd.cfg - name: Test with pytest and proxy From f23d1fa7ef95844a1926e6cd2de233933ae9ee0c Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 8 Jul 2024 10:25:06 +0100 Subject: [PATCH 34/37] fix path for windows --- mcmc_examples/arma/arma.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcmc_examples/arma/arma.py b/mcmc_examples/arma/arma.py index 71da062..629c43d 100644 --- a/mcmc_examples/arma/arma.py +++ b/mcmc_examples/arma/arma.py @@ -113,7 +113,7 @@ # print('samples: ', samples) # Save the results -dirpath = (f'results_{strftime("%Y-%m-%d_%H:%M:%S", gmtime())}' +dirpath = (f'results_{strftime("%Y-%m-%d_%H_%M_%S", gmtime())}' f'_nboards{n_boards}_nsamples{n_samples}') os.mkdir(dirpath) for coord, sample in samples.items(): From 65cc587c8495d1c04473e79ba9e5251f4990bc6a Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 8 Jul 2024 10:27:24 +0100 Subject: [PATCH 35/37] enable_advanced_monitor_support = False --- .github/workflows/c_actions.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/c_actions.yml b/.github/workflows/c_actions.yml index 5642e59..8b08976 100644 --- a/.github/workflows/c_actions.yml +++ b/.github/workflows/c_actions.yml @@ -170,6 +170,8 @@ jobs: - name: Append cfg # Doing this in the prepare action ended with a different path run: | + echo '[Machine]' >> ~/.spiNNakerGraphFrontEnd.cfg + echo 'enable_advanced_monitor_support = False' >> ~/.spiNNakerGraphFrontEnd.cfg echo '[Mapping]' >> ~/.spiNNakerGraphFrontEnd.cfg echo "external_binaries=$PWD/external_binaries" >> ~/.spiNNakerGraphFrontEnd.cfg echo '[Java]' >> ~/.spiNNakerGraphFrontEnd.cfg From d893113d6fd09387332597b830ccc85c248c6806 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 8 Jul 2024 10:38:20 +0100 Subject: [PATCH 36/37] do not repeat [Machine] --- .github/workflows/c_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c_actions.yml b/.github/workflows/c_actions.yml index 8b08976..7d4de3a 100644 --- a/.github/workflows/c_actions.yml +++ b/.github/workflows/c_actions.yml @@ -169,8 +169,8 @@ jobs: - name: Append cfg # Doing this in the prepare action ended with a different path + # assumes cfg so far already has and ends with Machine section run: | - echo '[Machine]' >> ~/.spiNNakerGraphFrontEnd.cfg echo 'enable_advanced_monitor_support = False' >> ~/.spiNNakerGraphFrontEnd.cfg echo '[Mapping]' >> ~/.spiNNakerGraphFrontEnd.cfg echo "external_binaries=$PWD/external_binaries" >> ~/.spiNNakerGraphFrontEnd.cfg From fe8e8c96a324626d57c9f5ada05af2be09f719df Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 8 Jul 2024 11:23:43 +0100 Subject: [PATCH 37/37] use_java = False --- .github/workflows/c_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c_actions.yml b/.github/workflows/c_actions.yml index 7d4de3a..5ab169c 100644 --- a/.github/workflows/c_actions.yml +++ b/.github/workflows/c_actions.yml @@ -175,7 +175,7 @@ jobs: echo '[Mapping]' >> ~/.spiNNakerGraphFrontEnd.cfg echo "external_binaries=$PWD/external_binaries" >> ~/.spiNNakerGraphFrontEnd.cfg echo '[Java]' >> ~/.spiNNakerGraphFrontEnd.cfg - echo 'use_java = True' >> ~/.spiNNakerGraphFrontEnd.cfg + echo 'use_java = False' >> ~/.spiNNakerGraphFrontEnd.cfg echo "java_jar_path=$PWD/external_binaries/spinnaker-exe.jar" >> ~/.spiNNakerGraphFrontEnd.cfg cat ~/.spiNNakerGraphFrontEnd.cfg