prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Remove load_data and save_data functions before 0.4
  `load_data` and `save_data` are currently deprecated (after 0.3.1 release). They need to be removed after 0.4 (assuming next release is going to be 0.3.2).
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `arviz/data/__init__.py`
  Content:
  ```
  1 """Code for loading and manipulating data structures."""
  2 from .inference_data import InferenceData, concat
  3 from .io_netcdf import from_netcdf, to_netcdf, load_data, save_data
  4 from .datasets import load_arviz_data, list_datasets, clear_data_home
  5 from .base import numpy_to_data_array, dict_to_dataset
  6 from .converters import convert_to_dataset, convert_to_inference_data
  7 from .io_cmdstan import from_cmdstan
  8 from .io_dict import from_dict
  9 from .io_pymc3 import from_pymc3
  10 from .io_pystan import from_pystan
  11 from .io_emcee import from_emcee
  12 from .io_pyro import from_pyro
  13 from .io_tfp import from_tfp
  14 
  15 __all__ = [
  16     "InferenceData",
  17     "concat",
  18     "load_arviz_data",
  19     "list_datasets",
  20     "clear_data_home",
  21     "numpy_to_data_array",
  22     "dict_to_dataset",
  23     "convert_to_dataset",
  24     "convert_to_inference_data",
  25     "from_pymc3",
  26     "from_pystan",
  27     "from_emcee",
  28     "from_cmdstan",
  29     "from_dict",
  30     "from_pyro",
  31     "from_tfp",
  32     "from_netcdf",
  33     "to_netcdf",
  34     "load_data",
  35     "save_data",
  36 ]
  37
  ```
  
  Path: `arviz/data/io_netcdf.py`
  Content:
  ```
  1 """Input and output support for data."""
  2 import warnings
  3 from .inference_data import InferenceData
  4 from .converters import convert_to_inference_data
  5 
  6 
  7 def from_netcdf(filename):
  8     """Load netcdf file back into an arviz.InferenceData.
  9 
  10     Parameters
  11     ----------
  12     filename : str
  13         name or path of the file to load trace
  14     """
  15     return InferenceData.from_netcdf(filename)
  16 
  17 
  18 def to_netcdf(data, filename, *, group="posterior", coords=None, dims=None):
  19     """Save dataset as a netcdf file.
  20 
  21     WARNING: Only idempotent in case `data` is InferenceData
  22 
  23     Parameters
  24     ----------
  25     data : InferenceData, or any object accepted by `convert_to_inference_data`
  26         Object to be saved
  27     filename : str
  28         name or path of the file to load trace
  29     group : str (optional)
  30         In case `data` is not InferenceData, this is the group it will be saved to
  31     coords : dict (optional)
  32         See `convert_to_inference_data`
  33     dims : dict (optional)
  34         See `convert_to_inference_data`
  35 
  36     Returns
  37     -------
  38     str
  39         filename saved to
  40     """
  41     inference_data = convert_to_inference_data(data, group=group, coords=coords, dims=dims)
  42     file_name = inference_data.to_netcdf(filename)
  43     return file_name
  44 
  45 
  46 def load_data(filename):
  47     """Load netcdf file back into an arviz.InferenceData.
  48 
  49     Parameters
  50     ----------
  51     filename : str
  52         name or path of the file to load trace
  53 
  54     Note
  55     ----
  56     This function is deprecated and will be removed in 0.4.
  57     Use `from_netcdf` instead.
  58     """
  59     warnings.warn(
  60         "The 'load_data' function is deprecated as of 0.3.2, use 'from_netcdf' instead",
  61         DeprecationWarning,
  62     )
  63     return from_netcdf(filename=filename)
  64 
  65 
  66 def save_data(data, filename, *, group="posterior", coords=None, dims=None):
  67     """Save dataset as a netcdf file.
  68 
  69     WARNING: Only idempotent in case `data` is InferenceData
  70 
  71     Parameters
  72     ----------
  73     data : InferenceData, or any object accepted by `convert_to_inference_data`
  74         Object to be saved
  75     filename : str
  76         name or path of the file to load trace
  77     group : str (optional)
  78         In case `data` is not InferenceData, this is the group it will be saved to
  79     coords : dict (optional)
  80         See `convert_to_inference_data`
  81     dims : dict (optional)
  82         See `convert_to_inference_data`
  83 
  84     Returns
  85     -------
  86     str
  87         filename saved to
  88 
  89     Note
  90     ----
  91     This function is deprecated and will be removed in 0.4.
  92     Use `to_netcdf` instead.
  93     """
  94     warnings.warn(
  95         "The 'save_data' function is deprecated as of 0.3.2, use 'to_netcdf' instead",
  96         DeprecationWarning,
  97     )
  98     return to_netcdf(data=data, filename=filename, group=group, coords=coords, dims=dims)
  99
  ```
  --- 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/arviz/data/__init__.py b/arviz/data/__init__.py
  --- a/arviz/data/__init__.py
  +++ b/arviz/data/__init__.py
  @@ -1,6 +1,6 @@
   """Code for loading and manipulating data structures."""
   from .inference_data import InferenceData, concat
  -from .io_netcdf import from_netcdf, to_netcdf, load_data, save_data
  +from .io_netcdf import from_netcdf, to_netcdf
   from .datasets import load_arviz_data, list_datasets, clear_data_home
   from .base import numpy_to_data_array, dict_to_dataset
   from .converters import convert_to_dataset, convert_to_inference_data
  @@ -31,6 +31,4 @@
       "from_tfp",
       "from_netcdf",
       "to_netcdf",
  -    "load_data",
  -    "save_data",
   ]
  diff --git a/arviz/data/io_netcdf.py b/arviz/data/io_netcdf.py
  --- a/arviz/data/io_netcdf.py
  +++ b/arviz/data/io_netcdf.py
  @@ -1,5 +1,5 @@
   """Input and output support for data."""
  -import warnings
  +
   from .inference_data import InferenceData
   from .converters import convert_to_inference_data
   
  @@ -41,58 +41,3 @@
       inference_data = convert_to_inference_data(data, group=group, coords=coords, dims=dims)
       file_name = inference_data.to_netcdf(filename)
       return file_name
  -
  -
  -def load_data(filename):
  -    """Load netcdf file back into an arviz.InferenceData.
  -
  -    Parameters
  -    ----------
  -    filename : str
  -        name or path of the file to load trace
  -
  -    Note
  -    ----
  -    This function is deprecated and will be removed in 0.4.
  -    Use `from_netcdf` instead.
  -    """
  -    warnings.warn(
  -        "The 'load_data' function is deprecated as of 0.3.2, use 'from_netcdf' instead",
  -        DeprecationWarning,
  -    )
  -    return from_netcdf(filename=filename)
  -
  -
  -def save_data(data, filename, *, group="posterior", coords=None, dims=None):
  -    """Save dataset as a netcdf file.
  -
  -    WARNING: Only idempotent in case `data` is InferenceData
  -
  -    Parameters
  -    ----------
  -    data : InferenceData, or any object accepted by `convert_to_inference_data`
  -        Object to be saved
  -    filename : str
  -        name or path of the file to load trace
  -    group : str (optional)
  -        In case `data` is not InferenceData, this is the group it will be saved to
  -    coords : dict (optional)
  -        See `convert_to_inference_data`
  -    dims : dict (optional)
  -        See `convert_to_inference_data`
  -
  -    Returns
  -    -------
  -    str
  -        filename saved to
  -
  -    Note
  -    ----
  -    This function is deprecated and will be removed in 0.4.
  -    Use `to_netcdf` instead.
  -    """
  -    warnings.warn(
  -        "The 'save_data' function is deprecated as of 0.3.2, use 'to_netcdf' instead",
  -        DeprecationWarning,
  -    )
  -    return to_netcdf(data=data, filename=filename, group=group, coords=coords, dims=dims)
  
verification_info: {"golden_diff": "diff --git a/arviz/data/__init__.py b/arviz/data/__init__.py\n--- a/arviz/data/__init__.py\n+++ b/arviz/data/__init__.py\n@@ -1,6 +1,6 @@\n \"\"\"Code for loading and manipulating data structures.\"\"\"\n from .inference_data import InferenceData, concat\n-from .io_netcdf import from_netcdf, to_netcdf, load_data, save_data\n+from .io_netcdf import from_netcdf, to_netcdf\n from .datasets import load_arviz_data, list_datasets, clear_data_home\n from .base import numpy_to_data_array, dict_to_dataset\n from .converters import convert_to_dataset, convert_to_inference_data\n@@ -31,6 +31,4 @@\n     \"from_tfp\",\n     \"from_netcdf\",\n     \"to_netcdf\",\n-    \"load_data\",\n-    \"save_data\",\n ]\ndiff --git a/arviz/data/io_netcdf.py b/arviz/data/io_netcdf.py\n--- a/arviz/data/io_netcdf.py\n+++ b/arviz/data/io_netcdf.py\n@@ -1,5 +1,5 @@\n \"\"\"Input and output support for data.\"\"\"\n-import warnings\n+\n from .inference_data import InferenceData\n from .converters import convert_to_inference_data\n \n@@ -41,58 +41,3 @@\n     inference_data = convert_to_inference_data(data, group=group, coords=coords, dims=dims)\n     file_name = inference_data.to_netcdf(filename)\n     return file_name\n-\n-\n-def load_data(filename):\n-    \"\"\"Load netcdf file back into an arviz.InferenceData.\n-\n-    Parameters\n-    ----------\n-    filename : str\n-        name or path of the file to load trace\n-\n-    Note\n-    ----\n-    This function is deprecated and will be removed in 0.4.\n-    Use `from_netcdf` instead.\n-    \"\"\"\n-    warnings.warn(\n-        \"The 'load_data' function is deprecated as of 0.3.2, use 'from_netcdf' instead\",\n-        DeprecationWarning,\n-    )\n-    return from_netcdf(filename=filename)\n-\n-\n-def save_data(data, filename, *, group=\"posterior\", coords=None, dims=None):\n-    \"\"\"Save dataset as a netcdf file.\n-\n-    WARNING: Only idempotent in case `data` is InferenceData\n-\n-    Parameters\n-    ----------\n-    data : InferenceData, or any object accepted by `convert_to_inference_data`\n-        Object to be saved\n-    filename : str\n-        name or path of the file to load trace\n-    group : str (optional)\n-        In case `data` is not InferenceData, this is the group it will be saved to\n-    coords : dict (optional)\n-        See `convert_to_inference_data`\n-    dims : dict (optional)\n-        See `convert_to_inference_data`\n-\n-    Returns\n-    -------\n-    str\n-        filename saved to\n-\n-    Note\n-    ----\n-    This function is deprecated and will be removed in 0.4.\n-    Use `to_netcdf` instead.\n-    \"\"\"\n-    warnings.warn(\n-        \"The 'save_data' function is deprecated as of 0.3.2, use 'to_netcdf' instead\",\n-        DeprecationWarning,\n-    )\n-    return to_netcdf(data=data, filename=filename, group=group, coords=coords, dims=dims)\n", "issue": "Remove load_data and save_data functions before 0.4\n`load_data` and `save_data` are currently deprecated (after 0.3.1 release). They need to be removed after 0.4 (assuming next release is going to be 0.3.2).\n", "before_files": [{"content": "\"\"\"Code for loading and manipulating data structures.\"\"\"\nfrom .inference_data import InferenceData, concat\nfrom .io_netcdf import from_netcdf, to_netcdf, load_data, save_data\nfrom .datasets import load_arviz_data, list_datasets, clear_data_home\nfrom .base import numpy_to_data_array, dict_to_dataset\nfrom .converters import convert_to_dataset, convert_to_inference_data\nfrom .io_cmdstan import from_cmdstan\nfrom .io_dict import from_dict\nfrom .io_pymc3 import from_pymc3\nfrom .io_pystan import from_pystan\nfrom .io_emcee import from_emcee\nfrom .io_pyro import from_pyro\nfrom .io_tfp import from_tfp\n\n__all__ = [\n    \"InferenceData\",\n    \"concat\",\n    \"load_arviz_data\",\n    \"list_datasets\",\n    \"clear_data_home\",\n    \"numpy_to_data_array\",\n    \"dict_to_dataset\",\n    \"convert_to_dataset\",\n    \"convert_to_inference_data\",\n    \"from_pymc3\",\n    \"from_pystan\",\n    \"from_emcee\",\n    \"from_cmdstan\",\n    \"from_dict\",\n    \"from_pyro\",\n    \"from_tfp\",\n    \"from_netcdf\",\n    \"to_netcdf\",\n    \"load_data\",\n    \"save_data\",\n]\n", "path": "arviz/data/__init__.py"}, {"content": "\"\"\"Input and output support for data.\"\"\"\nimport warnings\nfrom .inference_data import InferenceData\nfrom .converters import convert_to_inference_data\n\n\ndef from_netcdf(filename):\n    \"\"\"Load netcdf file back into an arviz.InferenceData.\n\n    Parameters\n    ----------\n    filename : str\n        name or path of the file to load trace\n    \"\"\"\n    return InferenceData.from_netcdf(filename)\n\n\ndef to_netcdf(data, filename, *, group=\"posterior\", coords=None, dims=None):\n    \"\"\"Save dataset as a netcdf file.\n\n    WARNING: Only idempotent in case `data` is InferenceData\n\n    Parameters\n    ----------\n    data : InferenceData, or any object accepted by `convert_to_inference_data`\n        Object to be saved\n    filename : str\n        name or path of the file to load trace\n    group : str (optional)\n        In case `data` is not InferenceData, this is the group it will be saved to\n    coords : dict (optional)\n        See `convert_to_inference_data`\n    dims : dict (optional)\n        See `convert_to_inference_data`\n\n    Returns\n    -------\n    str\n        filename saved to\n    \"\"\"\n    inference_data = convert_to_inference_data(data, group=group, coords=coords, dims=dims)\n    file_name = inference_data.to_netcdf(filename)\n    return file_name\n\n\ndef load_data(filename):\n    \"\"\"Load netcdf file back into an arviz.InferenceData.\n\n    Parameters\n    ----------\n    filename : str\n        name or path of the file to load trace\n\n    Note\n    ----\n    This function is deprecated and will be removed in 0.4.\n    Use `from_netcdf` instead.\n    \"\"\"\n    warnings.warn(\n        \"The 'load_data' function is deprecated as of 0.3.2, use 'from_netcdf' instead\",\n        DeprecationWarning,\n    )\n    return from_netcdf(filename=filename)\n\n\ndef save_data(data, filename, *, group=\"posterior\", coords=None, dims=None):\n    \"\"\"Save dataset as a netcdf file.\n\n    WARNING: Only idempotent in case `data` is InferenceData\n\n    Parameters\n    ----------\n    data : InferenceData, or any object accepted by `convert_to_inference_data`\n        Object to be saved\n    filename : str\n        name or path of the file to load trace\n    group : str (optional)\n        In case `data` is not InferenceData, this is the group it will be saved to\n    coords : dict (optional)\n        See `convert_to_inference_data`\n    dims : dict (optional)\n        See `convert_to_inference_data`\n\n    Returns\n    -------\n    str\n        filename saved to\n\n    Note\n    ----\n    This function is deprecated and will be removed in 0.4.\n    Use `to_netcdf` instead.\n    \"\"\"\n    warnings.warn(\n        \"The 'save_data' function is deprecated as of 0.3.2, use 'to_netcdf' instead\",\n        DeprecationWarning,\n    )\n    return to_netcdf(data=data, filename=filename, group=group, coords=coords, dims=dims)\n", "path": "arviz/data/io_netcdf.py"}], "after_files": [{"content": "\"\"\"Code for loading and manipulating data structures.\"\"\"\nfrom .inference_data import InferenceData, concat\nfrom .io_netcdf import from_netcdf, to_netcdf\nfrom .datasets import load_arviz_data, list_datasets, clear_data_home\nfrom .base import numpy_to_data_array, dict_to_dataset\nfrom .converters import convert_to_dataset, convert_to_inference_data\nfrom .io_cmdstan import from_cmdstan\nfrom .io_dict import from_dict\nfrom .io_pymc3 import from_pymc3\nfrom .io_pystan import from_pystan\nfrom .io_emcee import from_emcee\nfrom .io_pyro import from_pyro\nfrom .io_tfp import from_tfp\n\n__all__ = [\n    \"InferenceData\",\n    \"concat\",\n    \"load_arviz_data\",\n    \"list_datasets\",\n    \"clear_data_home\",\n    \"numpy_to_data_array\",\n    \"dict_to_dataset\",\n    \"convert_to_dataset\",\n    \"convert_to_inference_data\",\n    \"from_pymc3\",\n    \"from_pystan\",\n    \"from_emcee\",\n    \"from_cmdstan\",\n    \"from_dict\",\n    \"from_pyro\",\n    \"from_tfp\",\n    \"from_netcdf\",\n    \"to_netcdf\",\n]\n", "path": "arviz/data/__init__.py"}, {"content": "\"\"\"Input and output support for data.\"\"\"\n\nfrom .inference_data import InferenceData\nfrom .converters import convert_to_inference_data\n\n\ndef from_netcdf(filename):\n    \"\"\"Load netcdf file back into an arviz.InferenceData.\n\n    Parameters\n    ----------\n    filename : str\n        name or path of the file to load trace\n    \"\"\"\n    return InferenceData.from_netcdf(filename)\n\n\ndef to_netcdf(data, filename, *, group=\"posterior\", coords=None, dims=None):\n    \"\"\"Save dataset as a netcdf file.\n\n    WARNING: Only idempotent in case `data` is InferenceData\n\n    Parameters\n    ----------\n    data : InferenceData, or any object accepted by `convert_to_inference_data`\n        Object to be saved\n    filename : str\n        name or path of the file to load trace\n    group : str (optional)\n        In case `data` is not InferenceData, this is the group it will be saved to\n    coords : dict (optional)\n        See `convert_to_inference_data`\n    dims : dict (optional)\n        See `convert_to_inference_data`\n\n    Returns\n    -------\n    str\n        filename saved to\n    \"\"\"\n    inference_data = convert_to_inference_data(data, group=group, coords=coords, dims=dims)\n    file_name = inference_data.to_netcdf(filename)\n    return file_name\n", "path": "arviz/data/io_netcdf.py"}]}