prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  GLVolumeItem example rendered image changed
  <!-- In the following, please describe your issue in detail! -->
  <!-- If some of the sections do not apply, just remove them. -->
  
  ### Short description
  <!-- This should summarize the issue. -->
  c4a1cf11a166201f3da1b99705d7cb8acea0d602 from PR #1724 changed significantly the rendered output of the hydrogen electron probability density function in GLVolumeItem.py
  
  ### Code to reproduce
  <!-- Please provide a minimal working example that reproduces the issue in the code block below.
       Ideally, this should be a full example someone else could run without additional setup. -->
  examples/GLVolumeItem.py
  
  ### Expected behavior
  <!-- What should happen? -->
  
  ![old_good](https://user-images.githubusercontent.com/2657027/118205751-a9639500-b493-11eb-8666-bcfb0b625ebf.png)
  
  ### Real behavior
  <!-- What happens? -->
  ![new_bad](https://user-images.githubusercontent.com/2657027/118205766-b2546680-b493-11eb-88e2-8f61083eb5ce.png)
  
  ### Tested environment(s)
  
   * PyQtGraph version:  master<!-- output of pyqtgraph.__version__ -->
   * Qt Python binding: PySide6 6.1.0 <!-- output of pyqtgraph.Qt.VERSION_INFO -->
   * Python version: 3.8.10
   * NumPy version: 1.20.3 <!-- output of numpy.__version__ -->
   * Operating system: Windows 10
   * Installation method: pip install -e . <!-- e.g. pip, conda, system packages, ... -->
  
  ### Additional context
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `examples/GLVolumeItem.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 """
  3 Demonstrates GLVolumeItem for displaying volumetric data.
  4 
  5 """
  6 
  7 ## Add path to library (just for examples; you do not need this)
  8 import initExample
  9 
  10 import numpy as np
  11 import pyqtgraph as pg
  12 import pyqtgraph.opengl as gl
  13 from pyqtgraph import functions as fn
  14 
  15 app = pg.mkQApp("GLVolumeItem Example")
  16 w = gl.GLViewWidget()
  17 w.opts['distance'] = 200
  18 w.show()
  19 w.setWindowTitle('pyqtgraph example: GLVolumeItem')
  20 
  21 #b = gl.GLBoxItem()
  22 #w.addItem(b)
  23 g = gl.GLGridItem()
  24 g.scale(10, 10, 1)
  25 w.addItem(g)
  26 
  27 ## Hydrogen electron probability density
  28 def psi(i, j, k, offset=(50,50,100)):
  29     x = i-offset[0]
  30     y = j-offset[1]
  31     z = k-offset[2]
  32     th = np.arctan2(z, np.hypot(x, y))
  33     r = np.sqrt(x**2 + y**2 + z **2)
  34     a0 = 2
  35     ps = (1./81.) * 1./(6.*np.pi)**0.5 * (1./a0)**(3/2) * (r/a0)**2 * np.exp(-r/(3*a0)) * (3 * np.cos(th)**2 - 1)
  36     return ps
  37 
  38 
  39 data = np.fromfunction(psi, (100,100,200))
  40 positive = np.log(fn.clip_array(data, np.finfo(data.dtype).eps, data.max())**2)
  41 negative = np.log(fn.clip_array(-data, -np.finfo(data.dtype).eps, -data.min())**2)
  42 
  43 d2 = np.empty(data.shape + (4,), dtype=np.ubyte)
  44 d2[..., 0] = positive * (255./positive.max())
  45 d2[..., 1] = negative * (255./negative.max())
  46 d2[..., 2] = d2[...,1]
  47 d2[..., 3] = d2[..., 0]*0.3 + d2[..., 1]*0.3
  48 d2[..., 3] = (d2[..., 3].astype(float) / 255.) **2 * 255
  49 
  50 d2[:, 0, 0] = [255,0,0,100]
  51 d2[0, :, 0] = [0,255,0,100]
  52 d2[0, 0, :] = [0,0,255,100]
  53 
  54 v = gl.GLVolumeItem(d2)
  55 v.translate(-50,-50,-100)
  56 w.addItem(v)
  57 
  58 ax = gl.GLAxisItem()
  59 w.addItem(ax)
  60 
  61 if __name__ == '__main__':
  62     pg.exec()
  63
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/examples/GLVolumeItem.py b/examples/GLVolumeItem.py
  --- a/examples/GLVolumeItem.py
  +++ b/examples/GLVolumeItem.py
  @@ -18,8 +18,6 @@
   w.show()
   w.setWindowTitle('pyqtgraph example: GLVolumeItem')
   
  -#b = gl.GLBoxItem()
  -#w.addItem(b)
   g = gl.GLGridItem()
   g.scale(10, 10, 1)
   w.addItem(g)
  @@ -32,13 +30,20 @@
       th = np.arctan2(z, np.hypot(x, y))
       r = np.sqrt(x**2 + y**2 + z **2)
       a0 = 2
  -    ps = (1./81.) * 1./(6.*np.pi)**0.5 * (1./a0)**(3/2) * (r/a0)**2 * np.exp(-r/(3*a0)) * (3 * np.cos(th)**2 - 1)
  -    return ps
  +    return (
  +        (1.0 / 81.0)
  +        * 1.0 / (6.0 * np.pi) ** 0.5
  +        * (1.0 / a0) ** (3 / 2)
  +        * (r / a0) ** 2
  +        * np.exp(-r / (3 * a0))
  +        * (3 * np.cos(th) ** 2 - 1)
  +    )
   
   
   data = np.fromfunction(psi, (100,100,200))
  -positive = np.log(fn.clip_array(data, np.finfo(data.dtype).eps, data.max())**2)
  -negative = np.log(fn.clip_array(-data, -np.finfo(data.dtype).eps, -data.min())**2)
  +with np.errstate(divide = 'ignore'):
  +    positive = np.log(fn.clip_array(data, 0, data.max())**2)
  +    negative = np.log(fn.clip_array(-data, 0, -data.min())**2)
   
   d2 = np.empty(data.shape + (4,), dtype=np.ubyte)
   d2[..., 0] = positive * (255./positive.max())
  
verification_info: {"golden_diff": "diff --git a/examples/GLVolumeItem.py b/examples/GLVolumeItem.py\n--- a/examples/GLVolumeItem.py\n+++ b/examples/GLVolumeItem.py\n@@ -18,8 +18,6 @@\n w.show()\n w.setWindowTitle('pyqtgraph example: GLVolumeItem')\n \n-#b = gl.GLBoxItem()\n-#w.addItem(b)\n g = gl.GLGridItem()\n g.scale(10, 10, 1)\n w.addItem(g)\n@@ -32,13 +30,20 @@\n     th = np.arctan2(z, np.hypot(x, y))\n     r = np.sqrt(x**2 + y**2 + z **2)\n     a0 = 2\n-    ps = (1./81.) * 1./(6.*np.pi)**0.5 * (1./a0)**(3/2) * (r/a0)**2 * np.exp(-r/(3*a0)) * (3 * np.cos(th)**2 - 1)\n-    return ps\n+    return (\n+        (1.0 / 81.0)\n+        * 1.0 / (6.0 * np.pi) ** 0.5\n+        * (1.0 / a0) ** (3 / 2)\n+        * (r / a0) ** 2\n+        * np.exp(-r / (3 * a0))\n+        * (3 * np.cos(th) ** 2 - 1)\n+    )\n \n \n data = np.fromfunction(psi, (100,100,200))\n-positive = np.log(fn.clip_array(data, np.finfo(data.dtype).eps, data.max())**2)\n-negative = np.log(fn.clip_array(-data, -np.finfo(data.dtype).eps, -data.min())**2)\n+with np.errstate(divide = 'ignore'):\n+    positive = np.log(fn.clip_array(data, 0, data.max())**2)\n+    negative = np.log(fn.clip_array(-data, 0, -data.min())**2)\n \n d2 = np.empty(data.shape + (4,), dtype=np.ubyte)\n d2[..., 0] = positive * (255./positive.max())\n", "issue": "GLVolumeItem example rendered image changed\n<!-- In the following, please describe your issue in detail! -->\r\n<!-- If some of the sections do not apply, just remove them. -->\r\n\r\n### Short description\r\n<!-- This should summarize the issue. -->\r\nc4a1cf11a166201f3da1b99705d7cb8acea0d602 from PR #1724 changed significantly the rendered output of the hydrogen electron probability density function in GLVolumeItem.py\r\n\r\n### Code to reproduce\r\n<!-- Please provide a minimal working example that reproduces the issue in the code block below.\r\n     Ideally, this should be a full example someone else could run without additional setup. -->\r\nexamples/GLVolumeItem.py\r\n\r\n### Expected behavior\r\n<!-- What should happen? -->\r\n\r\n![old_good](https://user-images.githubusercontent.com/2657027/118205751-a9639500-b493-11eb-8666-bcfb0b625ebf.png)\r\n\r\n### Real behavior\r\n<!-- What happens? -->\r\n![new_bad](https://user-images.githubusercontent.com/2657027/118205766-b2546680-b493-11eb-88e2-8f61083eb5ce.png)\r\n\r\n### Tested environment(s)\r\n\r\n * PyQtGraph version:  master<!-- output of pyqtgraph.__version__ -->\r\n * Qt Python binding: PySide6 6.1.0 <!-- output of pyqtgraph.Qt.VERSION_INFO -->\r\n * Python version: 3.8.10\r\n * NumPy version: 1.20.3 <!-- output of numpy.__version__ -->\r\n * Operating system: Windows 10\r\n * Installation method: pip install -e . <!-- e.g. pip, conda, system packages, ... -->\r\n\r\n### Additional context\r\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nDemonstrates GLVolumeItem for displaying volumetric data.\n\n\"\"\"\n\n## Add path to library (just for examples; you do not need this)\nimport initExample\n\nimport numpy as np\nimport pyqtgraph as pg\nimport pyqtgraph.opengl as gl\nfrom pyqtgraph import functions as fn\n\napp = pg.mkQApp(\"GLVolumeItem Example\")\nw = gl.GLViewWidget()\nw.opts['distance'] = 200\nw.show()\nw.setWindowTitle('pyqtgraph example: GLVolumeItem')\n\n#b = gl.GLBoxItem()\n#w.addItem(b)\ng = gl.GLGridItem()\ng.scale(10, 10, 1)\nw.addItem(g)\n\n## Hydrogen electron probability density\ndef psi(i, j, k, offset=(50,50,100)):\n    x = i-offset[0]\n    y = j-offset[1]\n    z = k-offset[2]\n    th = np.arctan2(z, np.hypot(x, y))\n    r = np.sqrt(x**2 + y**2 + z **2)\n    a0 = 2\n    ps = (1./81.) * 1./(6.*np.pi)**0.5 * (1./a0)**(3/2) * (r/a0)**2 * np.exp(-r/(3*a0)) * (3 * np.cos(th)**2 - 1)\n    return ps\n\n\ndata = np.fromfunction(psi, (100,100,200))\npositive = np.log(fn.clip_array(data, np.finfo(data.dtype).eps, data.max())**2)\nnegative = np.log(fn.clip_array(-data, -np.finfo(data.dtype).eps, -data.min())**2)\n\nd2 = np.empty(data.shape + (4,), dtype=np.ubyte)\nd2[..., 0] = positive * (255./positive.max())\nd2[..., 1] = negative * (255./negative.max())\nd2[..., 2] = d2[...,1]\nd2[..., 3] = d2[..., 0]*0.3 + d2[..., 1]*0.3\nd2[..., 3] = (d2[..., 3].astype(float) / 255.) **2 * 255\n\nd2[:, 0, 0] = [255,0,0,100]\nd2[0, :, 0] = [0,255,0,100]\nd2[0, 0, :] = [0,0,255,100]\n\nv = gl.GLVolumeItem(d2)\nv.translate(-50,-50,-100)\nw.addItem(v)\n\nax = gl.GLAxisItem()\nw.addItem(ax)\n\nif __name__ == '__main__':\n    pg.exec()\n", "path": "examples/GLVolumeItem.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nDemonstrates GLVolumeItem for displaying volumetric data.\n\n\"\"\"\n\n## Add path to library (just for examples; you do not need this)\nimport initExample\n\nimport numpy as np\nimport pyqtgraph as pg\nimport pyqtgraph.opengl as gl\nfrom pyqtgraph import functions as fn\n\napp = pg.mkQApp(\"GLVolumeItem Example\")\nw = gl.GLViewWidget()\nw.opts['distance'] = 200\nw.show()\nw.setWindowTitle('pyqtgraph example: GLVolumeItem')\n\ng = gl.GLGridItem()\ng.scale(10, 10, 1)\nw.addItem(g)\n\n## Hydrogen electron probability density\ndef psi(i, j, k, offset=(50,50,100)):\n    x = i-offset[0]\n    y = j-offset[1]\n    z = k-offset[2]\n    th = np.arctan2(z, np.hypot(x, y))\n    r = np.sqrt(x**2 + y**2 + z **2)\n    a0 = 2\n    return (\n        (1.0 / 81.0)\n        * 1.0 / (6.0 * np.pi) ** 0.5\n        * (1.0 / a0) ** (3 / 2)\n        * (r / a0) ** 2\n        * np.exp(-r / (3 * a0))\n        * (3 * np.cos(th) ** 2 - 1)\n    )\n\n\ndata = np.fromfunction(psi, (100,100,200))\nwith np.errstate(divide = 'ignore'):\n    positive = np.log(fn.clip_array(data, 0, data.max())**2)\n    negative = np.log(fn.clip_array(-data, 0, -data.min())**2)\n\nd2 = np.empty(data.shape + (4,), dtype=np.ubyte)\nd2[..., 0] = positive * (255./positive.max())\nd2[..., 1] = negative * (255./negative.max())\nd2[..., 2] = d2[...,1]\nd2[..., 3] = d2[..., 0]*0.3 + d2[..., 1]*0.3\nd2[..., 3] = (d2[..., 3].astype(float) / 255.) **2 * 255\n\nd2[:, 0, 0] = [255,0,0,100]\nd2[0, :, 0] = [0,255,0,100]\nd2[0, 0, :] = [0,0,255,100]\n\nv = gl.GLVolumeItem(d2)\nv.translate(-50,-50,-100)\nw.addItem(v)\n\nax = gl.GLAxisItem()\nw.addItem(ax)\n\nif __name__ == '__main__':\n    pg.exec()\n", "path": "examples/GLVolumeItem.py"}]}