# Buggy code
def crop(self, tmin=None, tmax=None, include_tmax=True, verbose=None):
    """Crop a time interval from the epochs.

    Parameters
    ----------
    tmin : float | None
        Start time of selection in seconds.
    tmax : float | None
        End time of selection in seconds.
    %(include_tmax)s
    %(verbose_meth)s

    Returns
    -------
    epochs : instance of Epochs
        The cropped epochs object, modified in-place.

    Notes
    -----
    %(notes_tmax_included_by_default)s
    """
    # XXX this could be made to work on non-preloaded data...
    _check_preload(self, "Modifying data of epochs")

    if tmin is None:
        tmin = self.tmin
    elif tmin < self.tmin:
        warn("tmin is not in epochs time interval. tmin is set to epochs.tmin")
        tmin = self.tmin

    if tmax is None:
        tmax = self.tmax
    elif tmax > self.tmax:
        warn("tmax is not in epochs time interval. tmax is set to epochs.tmax")
        tmax = self.tmax

    tmask = _time_mask(
        self.times, tmin, tmax, sfreq=self.info["sfreq"], include_tmax=include_tmax
    )
    self._set_times(self.times[tmask])
    self._raw_times = self._raw_times[tmask]
    self._data = self._data[:, :, tmask]
    return self


# Traceback (ValueError)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/tmp/test.py in
25
26 epochs.save(epochs_fname, overwrite=True)
---> 27 epochs_read = mne.read_epochs(epochs_fname)

<decorator-gen-212> in read_epochs(fname, proj, preload, verbose)

~/Development/mne-python/mne/epochs.py in read_epochs(fname, proj, preload, verbose)
2704         The epochs.
2705     """
-> 2706     return EpochsFIF(fname, proj, preload, verbose)
2707
2708

<decorator-gen-213> in __init__(self, fname, proj, preload, verbose)

~/Development/mne-python/mne/epochs.py in __init__(self, fname, proj, preload, verbose)
2819         # again, ensure we're retaining the baseline period originally loaded
2820         # from disk without trying to re-apply baseline correction
-> 2821         super(EpochsFIF, self).__init__(
2822             info, data, events, event_id, tmin, tmax, baseline=None, raw=raw,
2823             proj=proj, preload_at_end=False, on_missing='ignore',

<decorator-gen-198> in __init__(self, info, data, events, event_id, tmin, tmax, baseline, raw, picks, reject, flat, decim, reject_tmin, reject_tmax, detrend, proj, on_missing, preload_at_end, selection, drop_log, filename, metadata, event_repeated, verbose)

~/Development/mne-python/mne/epochs.py in __init__(***failed resolving arguments***)
481         # check reject_tmin and reject_tmax
482         if (reject_tmin is not None) and (reject_tmin < tmin):
--> 483             raise ValueError("reject_tmin needs to be None or >= tmin")
484         if (reject_tmax is not None) and (reject_tmax > tmax):
485             raise ValueError("reject_tmax needs to be None or <= tmax")

ValueError: reject_tmin needs to be None or >= tmin

# Fixed code
def crop(self, tmin=None, tmax=None, include_tmax=True, verbose=None):
    """Crop a time interval from the epochs.

    Parameters
    ----------
    tmin : float | None
        Start time of selection in seconds.
    tmax : float | None
        End time of selection in seconds.
    %(include_tmax)s
    %(verbose_meth)s

    Returns
    -------
    epochs : instance of Epochs
        The cropped epochs object, modified in-place.

    Notes
    -----
    %(notes_tmax_included_by_default)s
    """
    # XXX this could be made to work on non-preloaded data...
    _check_preload(self, "Modifying data of epochs")

    if tmin is None:
        tmin = self.tmin
    elif tmin < self.tmin:
        warn("tmin is not in epochs time interval. tmin is set to epochs.tmin")
        tmin = self.tmin

    if tmax is None:
        tmax = self.tmax
    elif tmax > self.tmax:
        warn("tmax is not in epochs time interval. tmax is set to epochs.tmax")
        tmax = self.tmax

    tmask = _time_mask(
        self.times, tmin, tmax, sfreq=self.info["sfreq"], include_tmax=include_tmax
    )
    self._set_times(self.times[tmask])
    self._raw_times = self._raw_times[tmask]
    self._data = self._data[:, :, tmask]

    # Adjust rejection period
    if self.reject_tmin is not None and self.reject_tmin < self.tmin:
        logger.info(
            f"reject_tmin is not in epochs time interval. "
            f"Setting reject_tmin to epochs.tmin ({self.tmin} sec)"
        )
        self.reject_tmin = self.tmin
    if self.reject_tmax is not None and self.reject_tmax > self.tmax:
        logger.info(
            f"reject_tmax is not in epochs time interval. "
            f"Setting reject_tmax to epochs.tmax ({self.tmax} sec)"
        )
        self.reject_tmax = self.tmax
    return self