prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  DOC: private methods used in cookbook recipe
  ### Bug report
  
  **Bug summary**
  
  in #2567, `doc/source/cookbook/render_two_fields_tf.py` was added to the cookbook
  On the two following lines, the private method `_get_field_info` is used
  https://github.com/yt-project/yt/blob/ef08989d8222e7172751d17009959102db05dd20/doc/source/cookbook/render_two_fields_tf.py#L15
  https://github.com/yt-project/yt/blob/ef08989d8222e7172751d17009959102db05dd20/doc/source/cookbook/render_two_fields_tf.py#L30
  
  This should be refactored to avoid showing private elements
  @zingale, do you know how we could do this ?
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `doc/source/cookbook/render_two_fields_tf.py`
  Content:
  ```
  1 import numpy as np
  2 
  3 import yt
  4 from yt.visualization.volume_rendering.api import Scene, create_volume_source
  5 
  6 ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
  7 
  8 # create a scene and add volume sources to it
  9 
  10 sc = Scene()
  11 
  12 # Add density
  13 
  14 field = "density"
  15 ds._get_field_info(field).take_log = True
  16 
  17 vol = create_volume_source(ds, field=field)
  18 vol.use_ghost_zones = True
  19 
  20 tf = yt.ColorTransferFunction([-28, -25])
  21 tf.clear()
  22 tf.add_layers(4, 0.02, alpha=np.logspace(-3, -1, 4), colormap="winter")
  23 
  24 vol.set_transfer_function(tf)
  25 sc.add_source(vol)
  26 
  27 # Add temperature
  28 
  29 field = "temperature"
  30 ds._get_field_info(field).take_log = True
  31 
  32 vol2 = create_volume_source(ds, field=field)
  33 vol2.use_ghost_zones = True
  34 
  35 tf = yt.ColorTransferFunction([4.5, 7.5])
  36 tf.clear()
  37 tf.add_layers(4, 0.02, alpha=np.logspace(-0.2, 0, 4), colormap="autumn")
  38 
  39 vol2.set_transfer_function(tf)
  40 sc.add_source(vol2)
  41 
  42 # setup the camera
  43 
  44 cam = sc.add_camera(ds, lens_type="perspective")
  45 cam.resolution = (1600, 900)
  46 cam.zoom(20.0)
  47 
  48 # Render the image.
  49 
  50 sc.render()
  51 
  52 sc.save_annotated(
  53     "render_two_fields_tf.png",
  54     sigma_clip=6.0,
  55     tf_rect=[0.88, 0.15, 0.03, 0.8],
  56     render=False,
  57 )
  58
  ```
  --- 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/doc/source/cookbook/render_two_fields_tf.py b/doc/source/cookbook/render_two_fields_tf.py
  --- a/doc/source/cookbook/render_two_fields_tf.py
  +++ b/doc/source/cookbook/render_two_fields_tf.py
  @@ -12,7 +12,6 @@
   # Add density
   
   field = "density"
  -ds._get_field_info(field).take_log = True
   
   vol = create_volume_source(ds, field=field)
   vol.use_ghost_zones = True
  @@ -27,7 +26,6 @@
   # Add temperature
   
   field = "temperature"
  -ds._get_field_info(field).take_log = True
   
   vol2 = create_volume_source(ds, field=field)
   vol2.use_ghost_zones = True
  
verification_info: {"golden_diff": "diff --git a/doc/source/cookbook/render_two_fields_tf.py b/doc/source/cookbook/render_two_fields_tf.py\n--- a/doc/source/cookbook/render_two_fields_tf.py\n+++ b/doc/source/cookbook/render_two_fields_tf.py\n@@ -12,7 +12,6 @@\n # Add density\n \n field = \"density\"\n-ds._get_field_info(field).take_log = True\n \n vol = create_volume_source(ds, field=field)\n vol.use_ghost_zones = True\n@@ -27,7 +26,6 @@\n # Add temperature\n \n field = \"temperature\"\n-ds._get_field_info(field).take_log = True\n \n vol2 = create_volume_source(ds, field=field)\n vol2.use_ghost_zones = True\n", "issue": "DOC: private methods used in cookbook recipe\n### Bug report\r\n\r\n**Bug summary**\r\n\r\nin #2567, `doc/source/cookbook/render_two_fields_tf.py` was added to the cookbook\r\nOn the two following lines, the private method `_get_field_info` is used\r\nhttps://github.com/yt-project/yt/blob/ef08989d8222e7172751d17009959102db05dd20/doc/source/cookbook/render_two_fields_tf.py#L15\r\nhttps://github.com/yt-project/yt/blob/ef08989d8222e7172751d17009959102db05dd20/doc/source/cookbook/render_two_fields_tf.py#L30\r\n\r\nThis should be refactored to avoid showing private elements\r\n@zingale, do you know how we could do this ?\n", "before_files": [{"content": "import numpy as np\n\nimport yt\nfrom yt.visualization.volume_rendering.api import Scene, create_volume_source\n\nds = yt.load(\"IsolatedGalaxy/galaxy0030/galaxy0030\")\n\n# create a scene and add volume sources to it\n\nsc = Scene()\n\n# Add density\n\nfield = \"density\"\nds._get_field_info(field).take_log = True\n\nvol = create_volume_source(ds, field=field)\nvol.use_ghost_zones = True\n\ntf = yt.ColorTransferFunction([-28, -25])\ntf.clear()\ntf.add_layers(4, 0.02, alpha=np.logspace(-3, -1, 4), colormap=\"winter\")\n\nvol.set_transfer_function(tf)\nsc.add_source(vol)\n\n# Add temperature\n\nfield = \"temperature\"\nds._get_field_info(field).take_log = True\n\nvol2 = create_volume_source(ds, field=field)\nvol2.use_ghost_zones = True\n\ntf = yt.ColorTransferFunction([4.5, 7.5])\ntf.clear()\ntf.add_layers(4, 0.02, alpha=np.logspace(-0.2, 0, 4), colormap=\"autumn\")\n\nvol2.set_transfer_function(tf)\nsc.add_source(vol2)\n\n# setup the camera\n\ncam = sc.add_camera(ds, lens_type=\"perspective\")\ncam.resolution = (1600, 900)\ncam.zoom(20.0)\n\n# Render the image.\n\nsc.render()\n\nsc.save_annotated(\n    \"render_two_fields_tf.png\",\n    sigma_clip=6.0,\n    tf_rect=[0.88, 0.15, 0.03, 0.8],\n    render=False,\n)\n", "path": "doc/source/cookbook/render_two_fields_tf.py"}], "after_files": [{"content": "import numpy as np\n\nimport yt\nfrom yt.visualization.volume_rendering.api import Scene, create_volume_source\n\nds = yt.load(\"IsolatedGalaxy/galaxy0030/galaxy0030\")\n\n# create a scene and add volume sources to it\n\nsc = Scene()\n\n# Add density\n\nfield = \"density\"\n\nvol = create_volume_source(ds, field=field)\nvol.use_ghost_zones = True\n\ntf = yt.ColorTransferFunction([-28, -25])\ntf.clear()\ntf.add_layers(4, 0.02, alpha=np.logspace(-3, -1, 4), colormap=\"winter\")\n\nvol.set_transfer_function(tf)\nsc.add_source(vol)\n\n# Add temperature\n\nfield = \"temperature\"\n\nvol2 = create_volume_source(ds, field=field)\nvol2.use_ghost_zones = True\n\ntf = yt.ColorTransferFunction([4.5, 7.5])\ntf.clear()\ntf.add_layers(4, 0.02, alpha=np.logspace(-0.2, 0, 4), colormap=\"autumn\")\n\nvol2.set_transfer_function(tf)\nsc.add_source(vol2)\n\n# setup the camera\n\ncam = sc.add_camera(ds, lens_type=\"perspective\")\ncam.resolution = (1600, 900)\ncam.zoom(20.0)\n\n# Render the image.\n\nsc.render()\n\nsc.save_annotated(\n    \"render_two_fields_tf.png\",\n    sigma_clip=6.0,\n    tf_rect=[0.88, 0.15, 0.03, 0.8],\n    render=False,\n)\n", "path": "doc/source/cookbook/render_two_fields_tf.py"}]}