diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d6287f7a..95dd248a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,26 +1,20 @@ - repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: debug-statements - -- repo: https://github.com/PyCQA/isort - rev: "5.11.4" - hooks: - - id: isort - args: [] - additional_dependencies: [toml] - exclude: docs/tutorials + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: debug-statements -- repo: https://github.com/psf/black - rev: "22.12.0" - hooks: - - id: black + - repo: https://github.com/PyCQA/isort + rev: "5.11.4" + hooks: + - id: isort + args: [] + additional_dependencies: [toml] + exclude: docs/tutorials -- repo: https://github.com/dfm/black_nbconvert - rev: v0.4.0 - hooks: - - id: black_nbconvert + - repo: https://github.com/psf/black + rev: "22.12.0" + hooks: + - id: black-jupyter diff --git a/docs/tutorials/parallel.ipynb b/docs/tutorials/parallel.ipynb index cb2296ba..34a4945f 100644 --- a/docs/tutorials/parallel.ipynb +++ b/docs/tutorials/parallel.ipynb @@ -255,7 +255,8 @@ ], "source": [ "with open(\"script.py\", \"w\") as f:\n", - " f.write(\"\"\"\n", + " f.write(\n", + " \"\"\"\n", "import sys\n", "import time\n", "import emcee\n", @@ -284,7 +285,8 @@ " sampler.run_mcmc(initial, nsteps)\n", " end = time.time()\n", " print(end - start)\n", - "\"\"\")\n", + "\"\"\"\n", + " )\n", "\n", "mpi_time = !mpiexec -n {ncpu} python script.py\n", "mpi_time = float(mpi_time[0])\n", diff --git a/src/emcee/tests/integration/test_proposal.py b/src/emcee/tests/integration/test_proposal.py index 0427af7b..8138b516 100644 --- a/src/emcee/tests/integration/test_proposal.py +++ b/src/emcee/tests/integration/test_proposal.py @@ -98,5 +98,5 @@ def _test_uniform(proposal, nwalkers=32, nsteps=2000, seed=1234): # Check that the resulting chain "fails" the K-S test. samps = sampler.get_chain(flat=True) np.random.shuffle(samps) - ks, _ = stats.kstest(samps[::100], "uniform") + ks, _ = stats.kstest(samps[::100, 0], "uniform") assert ks > 0.1, "The K-S test failed"