arctichoke.dataset.example_dataset ================================== .. py:module:: arctichoke.dataset.example_dataset Functions --------- .. autoapisummary:: arctichoke.dataset.example_dataset.make_example_dataset Module Contents --------------- .. py:function:: make_example_dataset(save_as: str = None, n: int = 10, offset: (int, float) = 0, test_var_name: str = 'test_var', time_axis: (bool, int) = False, overwrite: bool = True) Create an example dataset for testing. Construct a dataset such that it is minimal in size yet contains all notable features of the datasets of HighResMIP data, and save it to a netCDF file. :param save_as: The absolute file path to which to save the example dataset. Default is `None`, which doesn't save the dataset to a file. :type save_as: `str`, `None`, optional :param n: The number of values in each dimension. Default is `10`. :type n: `int`, optional :param offset: A constant offset value to add to every value in the dataset. Default is `0`. :type offset: `int`, `float`, optional :param test_var_name: The name to give the test variable. Default is `test_var`. :type test_var_name: `str`, optional :param time_axis: Whether to include a time axis in the example dataset. If an integer is given, that will be used as the year for the datetimes. Default is `False`. :type time_axis: `bool`, `int`, optional :param overwrite: Whether to overwrite an existing file at the given filepath in `save_as`. Default is `True`. :type overwrite: `bool`, optional :returns: **example_dataset** -- A list, sorted alphabetically, of the names of the available models. :rtype: `xr.Dataset` .. rubric:: Examples >>> from arctichoke.dataset.example_dataset import make_example_dataset >>> dataset = make_example_dataset(n=3, time_axis=True) >>> dataset['test_var'].values array([[[0., 1., 2.], [3., 4., 5.], [6., 7., 8.]], [[0., 1., 2.], [3., 4., 5.], [6., 7., 8.]]])