def test_datetime_attribute_timeseries_one_hot(self, config):
        """Verifying that proper one hot encoding is generated (not leap year)"""
        base_freq, attribute_freq, period = config
        # first quarter/year, month/year, week/year, day/year, day/week, hour/day, second/hour
        simple_start = pd.Timestamp("2001-01-01 00:00:00")
        idx = generate_index(start=simple_start, length=period, freq=base_freq)
        vals = np.eye(period)

        # simple start
        self.helper_routine(idx, attribute_freq, vals_exp=vals, one_hot=True)
        # with time-zone
        if attribute_freq == "hour":
            # shift to mimic conversion from UTC to CET
            vals = np.roll(vals, shift=-1, axis=0)
        self.helper_routine(idx, attribute_freq, vals_exp=vals, tz="CET", one_hot=True)

        # missing values
        cut_period = period // 3
        idx = generate_index(start=simple_start, length=cut_period, freq=base_freq)
        vals = np.eye(period)
        # removing missing rows
        vals = vals[:cut_period]
        # mask missing attribute values
        vals[:, cut_period:] = 0

        self.helper_routine(idx, attribute_freq, vals_exp=vals, one_hot=True)

        # shifted time index
        shifted_start = pd.Timestamp("2001-05-05 05:00:05")
        # 5th month/year, day/week, hour/day, second/hour
        shift = 5
        # 125th day of year
        if attribute_freq == "dayofyear":
            shift = 125
        # 18th week of year
        if attribute_freq == "weekofyear":
            shift = 18
        # 2nd quarter of the year
        elif attribute_freq == "quarter":
            shift = 2

        # account for 1-indexing of the attribute
        if attribute_freq in ONE_INDEXED_FREQS:
            shift -= 1

        idx = generate_index(start=shifted_start, length=period, freq=base_freq)
        vals = np.eye(period)
        # shift values
        vals = np.roll(vals, shift=-shift, axis=0)

        self.helper_routine(idx, attribute_freq, vals_exp=vals, one_hot=True)
Verifying that proper one hot encoding is generated (not leap year)
darts/tests/utils/test_timeseries_generation.py