From 379bff1562f5d777c4aa358d89f2e2ad3071c71b Mon Sep 17 00:00:00 2001 From: "kodiakhq[bot]" <49736102+kodiakhq[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2020 15:09:41 +0000 Subject: [PATCH] Tutorial 12: support both pint 0.9 and 10.1 (#3423) Fixes #3420, fixes #3422 --- doc/tutorials/12-constant_pH/12-constant_pH.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/tutorials/12-constant_pH/12-constant_pH.ipynb b/doc/tutorials/12-constant_pH/12-constant_pH.ipynb index 96667cb798f..19f76b21b94 100644 --- a/doc/tutorials/12-constant_pH/12-constant_pH.ipynb +++ b/doc/tutorials/12-constant_pH/12-constant_pH.ipynb @@ -170,7 +170,9 @@ "\n", "# dependent parameters\n", "Box_V = (N_acid/N_A/c_acid)\n", - "Box_L = np.cbrt(Box_V.to('m**3'))*ureg('m')\n", + "Box_L = np.cbrt(Box_V.to('m**3'))\n", + "if tuple(map(int, pint.__version__.split('.'))) < (0, 10):\n", + " Box_L *= ureg('m')\n", "# we shall often need the numerical value of box length in sigma\n", "Box_L_in_sigma = Box_L.to('sigma').magnitude\n", "# unfortunately, pint module cannot handle cube root of m**3, so we need to explicitly set the unit\n",