.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "tutorial/developers.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_tutorial_developers.py: .. _developers: Using Ensaio in your project ---------------------------- One of the main use cases of Ensaio is to provide reproducible and easy-to-access data for the documentation of other Python projects. These are a few tips and tricks for using Ensaio in your own project. .. GENERATED FROM PYTHON SOURCE LINES 18-22 Importing a specific version ++++++++++++++++++++++++++++ The recommended way to import Ensaio is: .. GENERATED FROM PYTHON SOURCE LINES 22-27 .. code-block:: default import ensaio.v1 as ensaio fname = ensaio.fetch_southern_africa_gravity() .. GENERATED FROM PYTHON SOURCE LINES 28-40 .. note:: Replace ``v1`` with the version you want. Major releases of the data collection that break backwards compatibility (and would be likely to break your code) are encapsulated in their own modules. So using the :mod:`ensaio.v1` module will make sure your code works with any version of Ensaio. Of course, please try to update your code to use newer versions of the data collection whenever possible. .. GENERATED FROM PYTHON SOURCE LINES 42-65 Download from GitHub on CI ++++++++++++++++++++++++++ By default, the data source for Ensaio is an archive with a given DOI. You can also specify alternative data download URLs using the ``ENSAIO_V1_URL`` environment variable (each data version gets their own variable so adjust accordingly). We recommend using the environment variable to download from the GitHub release of the data when running on continuous integration (CI). This will minimize the load that is placed on public data servers like Zenodo. When using GitHub Actions, this may even make the downloads much faster since the data source is likely physically closer to the CI infrastructure. See the ``URL`` module-level variables for each version to find the exact URL you need (like :const:`ensaio.v1.URL`). .. important:: You may need to update the URL whenever you update Ensaio to access new data added in a minor data release. .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.001 seconds) .. _sphx_glr_download_tutorial_developers.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: developers.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: developers.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_