Skip to content

Commit

Permalink
Handling updated kstest interface in scipy 1.10 (#454)
Browse files Browse the repository at this point in the history
* handling updated kstest interface in scipy 1.10

* updating precommit

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
dfm and pre-commit-ci[bot] authored Jan 27, 2023
1 parent c637d6c commit e1db6a2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 26 deletions.
40 changes: 17 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions docs/tutorials/parallel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/emcee/tests/integration/test_proposal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit e1db6a2

Please sign in to comment.