docstr: Helper to compare series differenced by `Diff`.
  
  Parameters
  ----------
      series1
          First `TimeSeries` object to compare.
      series2
          Second `TimeSeries` object to compare.
      equal_nan
          Whether to compare `NaN` values as equal (see `help(np.testing.assert_allclose)`); should set
          `equal_nan=(not dropna)` (i.e. should throw error if there are `NaN` values when user has requested
          for them to be dropped).
      to_compare
          boolean `np.ndarray` which specifies which subset of columns should be compared in `series1` and
          `series2`. Used when checking that components not specified by `component_mask` have NOT been
          differenced after `fit`ing (i.e. `to_compare = ~component_mask`). If `to_compare = None`, all
          columns in `series1` and `series2` are compared.
docstr_tok: ["Helper","to","compare","series","differenced","by","`","Diff","`",".","Parameters","--","--","--","--","--","series1","First","`","TimeSeries","`","object","to","compare",".","series2","Second","`","TimeSeries","`","object","to","compare",".","equal_nan","Whether","to","compare","`","NaN","`","values","as","equal","(","see","`","help","(","np.testing.assert_allclose",")","`",")",";","should","set","`","equal_nan=","(","not","dropna",")","`","(","i.e",".","should","throw","error","if","there","are","`","NaN","`","values","when","user","has","requested","for","them","to","be","dropped",")",".","to_compare","boolean","`","np.ndarray","`","which","specifies","which","subset","of","columns","should","be","compared","in","`","series1","`","and","`","series2","`",".","Used","when","checking","that","components","not","specified","by","`","component_mask","`","have","NOT","been","differenced","after","`","fit","`","ing","(","i.e",".","`","to_compare","=","~component_mask","`",")",".","If","`","to_compare","=","None","`",",","all","columns","in","`","series1","`","and","`","series2","`","are","compared","."]
code: def assert_series_equal(
      self,
      series1: TimeSeries,
      series2: TimeSeries,
      equal_nan: bool,
      to_compare: Optional[np.ndarray] = None,
  ):
      """
      Helper to compare series differenced by `Diff`.
  
      Parameters
      ----------
          series1
              First `TimeSeries` object to compare.
          series2
              Second `TimeSeries` object to compare.
          equal_nan
              Whether to compare `NaN` values as equal (see `help(np.testing.assert_allclose)`); should set
              `equal_nan=(not dropna)` (i.e. should throw error if there are `NaN` values when user has requested
              for them to be dropped).
          to_compare
              boolean `np.ndarray` which specifies which subset of columns should be compared in `series1` and
              `series2`. Used when checking that components not specified by `component_mask` have NOT been
              differenced after `fit`ing (i.e. `to_compare = ~component_mask`). If `to_compare = None`, all
              columns in `series1` and `series2` are compared.
      """
      if to_compare is not None:
          series1 = series1.drop_columns(series1.columns[~to_compare])
          series2 = series2.drop_columns(series2.columns[~to_compare])
      np.testing.assert_allclose(
          series1.all_values(),
          series2.all_values(),
          atol=1e-8,
          equal_nan=equal_nan,
      )
      assert series1.time_index.equals(series2.time_index)
  
imports: from copy import deepcopy
  from typing import Optional, Sequence
  import numpy
  import pandas
  import pytest
  from darts.dataprocessing.transformers import Diff
  from darts.timeseries import TimeSeries
  from darts.timeseries import concatenate
  from darts.utils.timeseries_generation import linear_timeseries, sine_timeseries
label_desc: Use image node_id 1 for calling the TestDiff obj's underlying member method code with example usage: obj.assert_series_equal(series1, series2, equal_nan, to_compare) without return types