Repository: pints-team/pints (language: python)

Issue:
NUTS coroutines don't work on Python 3.11
```
 Traceback (most recent call last):
Testing notebooks
  File "/home/runner/work/pints/pints/run-tests.py", line 584, in <module>
Skipping ignored notebook: examples/interfaces/statsmodels-arima.ipynb
    run_notebook_tests()
  File "/home/runner/work/pints/pints/run-tests.py", line 376, in run_notebook_tests
    ok &= test_notebook(notebook)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/pints/pints/run-tests.py", line 438, in test_notebook
    import pints
  File "/home/runner/work/pints/pints/pints/__init__.py", line 224, in <module>
    from ._mcmc._nuts import NoUTurnMCMC
  File "/home/runner/work/pints/pints/pints/_mcmc/_nuts.py", line 210, in <module>
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'?
```

See notebooks: https://github.com/pints-team/pints/actions/runs/3407521360/jobs/5667241465


Discussion / hints:
https://docs.python.org/3.10/library/asyncio-task.html#generator-based-coroutines
How about we rewrite and make NUTS work only on 3.8+?

Still a note in there for 3.3: https://github.com/pints-team/pints/blob/master/pints/_mcmc/_nuts.py#L506

@martinjrobins do you have time to look at this?

Fix patch:
diff --git a/.github/workflows/upload-to-pypi.yml b/.github/workflows/upload-to-pypi.yml
index 7d28e2964..eb8f53263 100644
--- a/.github/workflows/upload-to-pypi.yml
+++ b/.github/workflows/upload-to-pypi.yml
@@ -17,7 +17,7 @@ jobs:
       - name: Set up Python
         uses: actions/setup-python@v4
         with:
-          python-version: '3.10'
+          python-version: '3.11'
 
       - name: install dependencies
         run: |


Test patch:
diff --git a/.github/workflows/copyright-test.yml b/.github/workflows/copyright-test.yml
index 2d7e7abda..60ccf2e5d 100644
--- a/.github/workflows/copyright-test.yml
+++ b/.github/workflows/copyright-test.yml
@@ -25,7 +25,7 @@ jobs:
       - name: Set up Python
         uses: actions/setup-python@v4
         with:
-            python-version: '3.10'
+            python-version: '3.11'
 
       - name: install pints
         run: |
diff --git a/.github/workflows/coverage-test.yml b/.github/workflows/coverage-test.yml
index d6f18b448..822c08c21 100644
--- a/.github/workflows/coverage-test.yml
+++ b/.github/workflows/coverage-test.yml
@@ -25,7 +25,7 @@ jobs:
       - name: Set up Python
         uses: actions/setup-python@v4
         with:
-          python-version: '3.10'
+          python-version: '3.11'
 
       - name: install pints
         run: |
diff --git a/.github/workflows/docs-test.yml b/.github/workflows/docs-test.yml
index e8bde581d..b642785a3 100644
--- a/.github/workflows/docs-test.yml
+++ b/.github/workflows/docs-test.yml
@@ -25,7 +25,7 @@ jobs:
       - name: Set up Python
         uses: actions/setup-python@v4
         with:
-          python-version: '3.10'
+          python-version: '3.11'
 
       - name: install pints
         run: |
diff --git a/.github/workflows/notebook-interfaces-test.yml b/.github/workflows/notebook-interfaces-test.yml
index 528cc44fa..658a3058b 100644
--- a/.github/workflows/notebook-interfaces-test.yml
+++ b/.github/workflows/notebook-interfaces-test.yml
@@ -17,7 +17,7 @@ jobs:
       - name: Set up Python
         uses: actions/setup-python@v4
         with:
-          python-version: '3.10'
+          python-version: '3.11'
 
       # We use e.g. install pints[stan] to install dependencies for interfaces
       # that have some code in pints/interfaces. Dependencies that are not used
diff --git a/.github/workflows/notebook-test.yml b/.github/workflows/notebook-test.yml
index 7bbddafe4..6aec46cdc 100644
--- a/.github/workflows/notebook-test.yml
+++ b/.github/workflows/notebook-test.yml
@@ -17,7 +17,7 @@ jobs:
       - name: Set up Python
         uses: actions/setup-python@v4
         with:
-          python-version: '3.10'
+          python-version: '3.11'
 
       - name: install pints
         run: |
diff --git a/.github/workflows/unit-test-os-coverage.yml b/.github/workflows/unit-test-os-coverage.yml
index df6d5dc9e..e9c16b1a3 100644
--- a/.github/workflows/unit-test-os-coverage.yml
+++ b/.github/workflows/unit-test-os-coverage.yml
@@ -22,6 +22,7 @@ jobs:
     strategy:
       matrix:
         os: [ubuntu-18.04, macos-latest, windows-latest]
+        # Note: Ubuntu 20 is checked by other tests
 
     steps:
       - uses: actions/checkout@v3
@@ -29,7 +30,7 @@ jobs:
       - name: Set up Python
         uses: actions/setup-python@v4
         with:
-          python-version: '3.10'
+          python-version: '3.11'
 
       - name: install pints
         run: |
diff --git a/.github/workflows/unit-test-python-coverage.yml b/.github/workflows/unit-test-python-coverage.yml
index 0e9ed8a96..aa74f9d99 100644
--- a/.github/workflows/unit-test-python-coverage.yml
+++ b/.github/workflows/unit-test-python-coverage.yml
@@ -21,7 +21,8 @@ jobs:
 
     strategy:
       matrix:
-        python-version: ['3.7', '3.8', '3.9', '3.10']  # Latest version is tested by coverage test and os tests
+        python-version: ['3.7', '3.8', '3.9', '3.10']
+        # Note: Latest version is tested by coverage test and os tests
 
     steps:
       - uses: actions/checkout@v3