
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "auto_examples\text_only\hdf5_error.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        Click :ref:`here <sphx_glr_download_auto_examples_text_only_hdf5_error.py>`
        to download the full example code

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_auto_examples_text_only_hdf5_error.py:

HDF5 error message
==================

Trying to load an HDF5 file without an expno generates an error with a list of possible node names

.. GENERATED FROM PYTHON SOURCE LINES 6-15




.. rst-class:: sphx-glr-script-out

 .. code-block:: none

    this will print the error message:


    please select a node from the list and set to expno:
            COSY_1
            COSY_2
            COSY_3
            COSY_4






|

.. code-block:: default

    from pyspecdata import *
    try:
        d = find_file("210603_EtOH_cap_probe_COSY", exp_type="ODNP_NMR_comp/COSY")
    except ValueError as e:
        # NOTE: we use a try-except here so that the example doesn't show up as
        # "broken" -- typically, you would just use the command inside the "try"
        # command as-is
        print("this will print the error message:\n\n")
        print(e)


.. rst-class:: sphx-glr-timing

   **Total running time of the script:** ( 0 minutes  0.017 seconds)


.. _sphx_glr_download_auto_examples_text_only_hdf5_error.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example


    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: hdf5_error.py <hdf5_error.py>`

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: hdf5_error.ipynb <hdf5_error.ipynb>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
