@classmethod
def from_filenames(cls, filenames, parallel=True, setup_function=None, **kwargs):
    'Create a time series from either a filename pattern or a list of\n        filenames.\n\n        This method provides an easy way to create a\n        :class:`~yt.data_objects.time_series.DatasetSeries`, given a set of\n        filenames or a pattern that matches them.  Additionally, it can set the\n        parallelism strategy.\n\n        Parameters\n        ----------\n        filenames : list or pattern\n            This can either be a list of filenames (such as ["DD0001/DD0001",\n            "DD0002/DD0002"]) or a pattern to match, such as\n            "DD*/DD*.index").  If it\'s the former, they will be loaded in\n            order.  The latter will be identified with the glob module and then\n            sorted.\n        parallel : True, False or int\n            This parameter governs the behavior when .piter() is called on the\n            resultant DatasetSeries object.  If this is set to False, the time\n            series will not iterate in parallel when .piter() is called.  If\n            this is set to either True or an integer, it will be iterated with\n            1 or that integer number of processors assigned to each parameter\n            file provided to the loop.\n        setup_function : callable, accepts a ds\n            This function will be called whenever a dataset is loaded.\n\n        Examples\n        --------\n\n        >>> def print_time(ds):\n        ...     print ds.current_time\n        ...\n        >>> ts = DatasetSeries.from_filenames(\n        ...     "GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0[0-6][0-9]0",\n        ...      setup_function = print_time)\n        ...\n        >>> for ds in ts:\n        ...     SlicePlot(ds, "x", "Density").save()\n\n        '
    if isinstance(filenames, string_types):
        filenames = get_filenames_from_glob_pattern(filenames)
    for fn in filenames:
        if (not isinstance(fn, string_types)):
            raise YTOutputNotIdentified('DataSeries accepts a list of strings, but received {0}'.format(fn))
    obj = cls(filenames[:], parallel=parallel, setup_function=setup_function, **kwargs)
    return obj
Create a time series from either a filename pattern or a list of
filenames.

This method provides an easy way to create a
:class:`~yt.data_objects.time_series.DatasetSeries`, given a set of
filenames or a pattern that matches them.  Additionally, it can set the
parallelism strategy.

Parameters
----------
filenames : list or pattern
    This can either be a list of filenames (such as ["DD0001/DD0001",
    "DD0002/DD0002"]) or a pattern to match, such as
    "DD*/DD*.index").  If it's the former, they will be loaded in
    order.  The latter will be identified with the glob module and then
    sorted.
parallel : True, False or int
    This parameter governs the behavior when .piter() is called on the
    resultant DatasetSeries object.  If this is set to False, the time
    series will not iterate in parallel when .piter() is called.  If
    this is set to either True or an integer, it will be iterated with
    1 or that integer number of processors assigned to each parameter
    file provided to the loop.
setup_function : callable, accepts a ds
    This function will be called whenever a dataset is loaded.

Examples
--------

>>> def print_time(ds):
...     print ds.current_time
...
>>> ts = DatasetSeries.from_filenames(
...     "GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0[0-6][0-9]0",
...      setup_function = print_time)
...
>>> for ds in ts:
...     SlicePlot(ds, "x", "Density").save()
@classmethod
def from_filenames(cls, filenames, parallel=True, setup_function=None, **kwargs):
    'Create a time series from either a filename pattern or a list of\n        filenames.\n\n        This method provides an easy way to create a\n        :class:`~yt.data_objects.time_series.DatasetSeries`, given a set of\n        filenames or a pattern that matches them.  Additionally, it can set the\n        parallelism strategy.\n\n        Parameters\n        ----------\n        filenames : list or pattern\n            This can either be a list of filenames (such as ["DD0001/DD0001",\n            "DD0002/DD0002"]) or a pattern to match, such as\n            "DD*/DD*.index").  If it\'s the former, they will be loaded in\n            order.  The latter will be identified with the glob module and then\n            sorted.\n        parallel : True, False or int\n            This parameter governs the behavior when .piter() is called on the\n            resultant DatasetSeries object.  If this is set to False, the time\n            series will not iterate in parallel when .piter() is called.  If\n            this is set to either True or an integer, it will be iterated with\n            1 or that integer number of processors assigned to each parameter\n            file provided to the loop.\n        setup_function : callable, accepts a ds\n            This function will be called whenever a dataset is loaded.\n\n        Examples\n        --------\n\n        >>> def print_time(ds):\n        ...     print ds.current_time\n        ...\n        >>> ts = DatasetSeries.from_filenames(\n        ...     "GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0[0-6][0-9]0",\n        ...      setup_function = print_time)\n        ...\n        >>> for ds in ts:\n        ...     SlicePlot(ds, "x", "Density").save()\n\n        '
    if isinstance(filenames, string_types):
        filenames = get_filenames_from_glob_pattern(filenames)
    for fn in filenames:
        if (not isinstance(fn, string_types)):
            raise YTOutputNotIdentified('DataSeries accepts a list of strings, but received {0}'.format(fn))
    obj = cls(filenames[:], parallel=parallel, setup_function=setup_function, **kwargs)
    return obj