Skip to main content
`Ctrl`+`K`

# `rsciio.tests.registry_utils`

`rsciio.tests.registry_utils.download_all`([...]) | Download all test data if they are not already locally available in `rsciio.tests.data` folder.
`rsciio.tests.registry_utils.make_registry`(...) | Make a registry of files and hashes for the given directory.
`rsciio.tests.registry_utils.update_registry`() | Update the `rsciio.tests.registry.txt` file, which is required after adding or updating test data files.

rsciio.tests.registry_utils.download_all(pooch_object=None, ignore_hash=None, show_progressbar=True)

  Download all test data if they are not already locally available in `rsciio.tests.data` folder.

  When the environment variable RSCIIO_TEST_DATA_SOURCE is set, the test data will be copied from the specified directory instead of downloading. This is useful for CI when the test data is cached as an artifact in a previous step.

  Parameters:
    pooch_object `pooch.Pooch` or `python:None`, default=None

      The registry to be used. If None, a RosettaSciIO registry will be used.

    ignore_hash bool or `python:None`, default=None

      Don’t compare the hash of the downloaded file with the corresponding hash in the registry. On windows, the hash comparison will fail for non-binary file, because of difference in line ending. If None, the comparison will only be used on unix system.

    show_progressbar bool, default=True

      Whether to show the progressbar or not.

rsciio.tests.registry_utils.make_registry(directory, output, recursive=True, exclude_pattern=None)

  Make a registry of files and hashes for the given directory.

  This is helpful if you have many files in your test dataset as it keeps you from needing to manually update the registry.

  Parameters:
    directory `python:str`

      Directory of the test data to put in the registry. All file names in the registry will be relative to this directory.

    output `python:str`

      Name of the output registry file.

    recursive bool

      If True, will recursively look for files in subdirectories of directory.

    exclude_pattern `python:list` or `python:None`

      List of pattern to exclude.

  Notes

  Adapted from fatiando/pooch BSD-3-Clause

rsciio.tests.registry_utils.update_registry()

  Update the `rsciio.tests.registry.txt` file, which is required after adding or updating test data files.

  Unix system only. This is not supported on windows, because the hash comparison will fail for non-binary file, because of difference in line ending.