[ENH] in suite tests, add test for docstring examples #4507
Annotations
10 errors and 10 warnings
|
Run pytest:
pytorch_forecasting/tests/test_all_estimators.py#L375
TestAllPtForecasters.test_class_has_doctest_example[xLSTMTime]
AssertionError: xLSTMTime docstring has no doctest example
assert '>>>' in '\nxLSTMTime is a long\u2011term time series forecasting architecture built on the\nextended LSTM (xLSTM) design, incorporating either the scalar-memory\nstabilized LSTM (sLSTM) or the matrix-memory mLSTM variant. This model\nenhances classical LSTM by adding exponential gating and richer memory\ndynamics, and combines series decomposition and normalization layers to\nproduce robust forecasts over extended horizons.\n\nIt is based on this paper: https://arxiv.org/pdf/2407.10240 and\nhttps://github.com/muslehal/xLSTMTime\n'
|
|
Run pytest:
pytorch_forecasting/tests/test_all_estimators.py#L375
TestAllPtForecasters.test_class_has_doctest_example[TimeXer]
AssertionError: TimeXer docstring has no doctest example
assert '>>>' in 'TimeXer model for time series forecasting with exogenous variables.'
|
|
Run pytest:
pytorch_forecasting/tests/test_all_estimators.py#L375
TestAllPtForecasters.test_class_has_doctest_example[TiDEModel]
AssertionError: TiDEModel docstring has no doctest example
assert '>>>' in 'TiDE model for long-term time-series forecasting.'
|
|
Run pytest:
pytorch_forecasting/tests/test_all_estimators.py#L375
TestAllPtForecasters.test_class_has_doctest_example[TemporalFusionTransformer]
AssertionError: TemporalFusionTransformer docstring has no doctest example
assert '>>>' in 'Temporal Fusion Transformer for forecasting timeseries.\n\nInitialize via :py:meth:`~from_dataset` method if possible.\n\nImplementation of\n`Temporal Fusion Transformers for Interpretable Multi-horizon Time Series\nForecasting <https://arxiv.org/pdf/1912.09363.pdf>`_.\n\nEnhancements compared to the original implementation:\n\n* static variables can be continuous\n* multiple categorical variables can be summarized with an EmbeddingBag\n* variable encoder and decoder length by sample\n* categorical embeddings are not transformed by variable selection network\n (because it is a redundant operation)\n* variable dimension in variable selection network are scaled up via linear interpolation to reduce\n number of parameters\n* non-linear variable processing in variable selection network can be\n shared among decoder and encoder (not shared by default)\n* capabilities added through base model such as monotone constraints\n\nTune its hyperparameters with\n:py:func:`~pytorch_forecasting.models.temporal_fusion_transformer.tuning.optimize_hyperparameters`.\n\nParameters\n----------\nhidden_size : int, default=16\n hidden size of network which is its main hyperparameter.\n Can range from 8 to 512.\nlstm_layers : int, default=1\n number of LSTM layers (2 is mostly optimal)\ndropout : float, default=0.1\n dropout rate\noutput_size : int or list of int, default=7\n number of outputs\n (e.g. number of quantiles for QuantileLoss and one target or list of output sizes).\nloss : MultiHorizonMetric, default=QuantileLoss()\n loss function taking prediction and targets\nattention_head_size : int, default=4\n number of attention heads (4 is a good default)\nmax_encoder_length : int, default=10\n length to encode,\n can be far longer than the decoder length but does not have to be\nstatic_categoricals: names of static categorical variables\nstatic_reals: names of static continuous variables\ntime_varying_categoricals_encoder: names of categorical variables for encoder\ntime_varying_categoricals_decoder: names of categorical variables for decoder\ntime_varying_reals_encoder: names of continuous variables for encoder\ntime_varying_reals_decoder: names of continuous variables for decoder\ncategorical_groups: dictionary where values\n are list of categorical variables that are forming together a new categorical\n variable which is the key in the dictionary\nx_reals: order of continuous variables in tensor passed to forward function\nx_categoricals: order of categorical variables in tensor passed to forward function\nhidden_continuous_size: default for hidden size for processing continuous variables (similar to categorical\n embedding size)\nhidden_continuous_sizes: dictionary mapping continuous input indices to sizes for variable selection\n (fallback to hidden_continuous_size if index is not in dictionary)\nembedding_sizes: dictionary mapping (string) indices to tuple of number of categorical classes and\n embedding size\nembedding_paddings: list of indices for embeddings which transform the zero\'s embedding to a zero vector\nembedding_labels: dictionary mapping (string) indices to list of categorical labels\nlearning_rate: learning rate\nlog_interval: log predictions every x batches, do not log if 0 or less, log interpretation if > 0. If < 1.0\n , will log multiple entries per batch. Defaults to -1.\nlog_val_interval: frequency with which to log validation set metrics, defaults to log_interval\nlog_gradient_flow: if to log gradient flow, this takes time and should be only done to diagnose training\n failures\nreduce_on_plateau_patience (int): patience after which learning rate is reduced by a factor of 10\nmonotone_constraints (Dict[str, int]): dictionary of monotonicity constraints for continuous decoder\n variables mapping\n position (e.g. ``"0"`` for first position) to constraint (``-1`` for negative and ``+1`` fo
|
|
Run pytest:
pytorch_forecasting/tests/test_all_estimators.py#L373
TestAllPtForecasters.test_class_has_doctest_example[RecurrentNetwork]
AssertionError: RecurrentNetwork has no docstring
assert None is not None
|
|
Run pytest:
pytorch_forecasting/tests/test_all_estimators.py#L373
TestAllPtForecasters.test_class_has_doctest_example[NHiTS]
AssertionError: NHiTS has no docstring
assert None is not None
|
|
Run pytest:
pytorch_forecasting/tests/test_all_estimators.py#L375
TestAllPtForecasters.test_class_has_doctest_example[NBeats]
AssertionError: NBeats docstring has no doctest example
assert '>>>' in '\nInitialize NBeats Model - use its :py:meth:`~from_dataset` method if possible.\n\nBased on the article\n`N-BEATS: Neural basis expansion analysis for interpretable time series\n forecasting <http://arxiv.org/abs/1905.10437>`_. The network has (if\nused as ensemble) outperformed all other methods including ensembles of\ntraditional statical methods in the M4 competition. The M4 competition is\narguably the most important benchmark for univariate time series forecasting.\n\nThe :py:class:`~pytorch_forecasting.models.nhits.NHiTS` network has recently\nshown to consistently outperform N-BEATS.\n\nParameters\n----------\nstack_types : list of str\n One of the following values \u201cgeneric\u201d, \u201cseasonality\u201d or \u201ctrend\u201d.\n A list of strings of length 1 or `num_stacks`. Default and recommended\n value for generic mode is ["generic"]. Recommended value for interpretable\n mode is ["trend","seasonality"].\nnum_blocks : list of int\n The number of blocks per stack. Length 1 or `num_stacks`. Default for\n generic mode is [1], interpretable mode is [3].\nnum_block_layers : list of int\n Number of fully connected layers with ReLU activation per block. Length 1\n or `num_stacks`. Default [4] for both modes.\nwidth : list of int\n Widths of fully connected layers with ReLU activation. List length 1 or\n `num_stacks`. Default [512] for generic; [256, 2048] for interpretable.\nsharing : list of bool\n Whether weights are shared across blocks in a stack. List length 1 or\n `num_stacks`. Default [False] for generic; [True] for interpretable.\nexpansion_coefficient_length : list of int\n If type is "G", length of expansion coefficient; if "T", degree of\n polynomial; if "S", minimum period (e.g., 2 for every timestep). List\n length 1 or `num_stacks`. Default [32] for generic; [3] for interpretable.\nprediction_length : int\n Length of the forecast horizon.\ncontext_length : int\n Number of time units conditioning the predictions (lookback period).\n Should be between 1-10x `prediction_length`.\ndropout : float\n Dropout probability applied in the network. Helps prevent overfitting.\n Default is 0.1.\nlearning_rate : float\n Learning rate used by the optimizer during training. Default is 1e-2.\nlog_interval : int\n Interval (in steps) at which training logs are recorded. If -1, logging\n is disabled. Default is -1.\nlog_gradient_flow : bool\n Whether to log gradient flow during training. Useful for diagnosing\n vanishing/exploding gradients. Default is False.\nlog_val_interval : int\n Interval (in steps) at which validation metrics are logged. If None,\n uses default logging behavior. Default is None.\nweight_decay : float\n Weight decay (L2 regularization) coefficient used by the optimizer to\n reduce overfitting. Default is 1e-3.\nloss\n Loss to optimize. Defaults to `MASE()`.\nreduce_on_plateau_patience : int\n Patience after which learning rate is reduced by factor of 10.\nbackcast_loss_ratio : float\n Weight of backcast loss relative to forecast loss. 1.0 gives equal weight;\n default 0.0 means no backcast loss.\nlogging_metrics : nn.ModuleList of MultiHorizonMetric\n List of metrics logged during training. Defaults to\n nn.ModuleList([SMAPE(), MAE(), RMSE(), MAPE(), MASE()]).\n**kwargs\n Additional arguments forwarded to :py:class:`~BaseModel`.\n'
|
|
Run pytest:
pytorch_forecasting/tests/test_all_estimators.py#L375
TestAllPtForecasters.test_class_has_doctest_example[NBeatsKAN]
AssertionError: NBeatsKAN docstring has no doctest example
assert '>>>' in '\nInitialize NBeatsKAN Model - use its :py:meth:`~from_dataset` method if possible.\n\nBased on the article\n`N-BEATS: Neural basis expansion analysis for interpretable time series\nforecasting <http://arxiv.org/abs/1905.10437>`_. The network has (if\nused as ensemble) outperformed all other methods including ensembles of\ntraditional statical methods in the M4 competition. The M4 competition is\narguably the most important benchmark for univariate time series forecasting.\n\nThe :py:class:`~pytorch_forecasting.models.nhits.NHiTS` network has recently\nshown to consistently outperform N-BEATS.\n\nParameters\n----------\nstack_types : list of str\n One of the following values: \u201cgeneric\u201d, \u201cseasonality" or\n \u201ctrend". A list of strings of length 1 or \'num_stacks\'. Default and\n recommended value for generic mode: [\u201cgeneric\u201d] Recommended value for\n interpretable mode: [\u201ctrend\u201d,\u201dseasonality\u201d].\nnum_blocks : list of int\n The number of blocks per stack. A list of ints of length 1 or\n \'num_stacks\'. Default and recommended value for generic mode: [1]\n Recommended value for interpretable mode: [3]\nnum_block_layers : list of int\n Number of fully connected layers with ReLu activation per block.\n A list of ints of length 1 or \'num_stacks\'. Default and recommended\n value for generic mode: [4] Recommended value for interpretable mode:\n [4].\nwidths : list of int\n Widths of the fully connected layers with ReLu activation in the\n blocks. A list of ints of length 1 or \'num_stacks\'. Default and\n recommended value for generic mode: [512]. Recommended value for\n interpretable mode: [256, 2048]\nsharing : list of bool\n Whether the weights are shared with the other blocks per stack.\n A list of ints of length 1 or \'num_stacks\'. Default and recommended\n value for generic mode: [False]. Recommended value for interpretable\n mode: [True].\nexpansion_coefficient_lengths : list of int\n If the type is \u201cG\u201d (generic), then the length of the expansion coefficient.\n If type is \u201cT\u201d (trend), then it corresponds to the degree of the\n polynomial.\n If the type is \u201cS\u201d (seasonal) then this is the minimum period allowed,\n e.g. 2 for changes every timestep. A list of ints of length 1 or\n \'num_stacks\'. Default value for generic mode: [32] Recommended value for\n interpretable mode: [3]\nprediction_length : int\n Length of the prediction. Also known as \'horizon\'.\ncontext_length : int\n Number of time units that condition the predictions.\n Also known as \'lookback period\'.\n Should be between 1-10 times the prediction length.\nbackcast_loss_ratio : float\n Weight of backcast in comparison to forecast when calculating the loss.\n A weight of 1.0 means that forecast and backcast loss is weighted the same\n (regardless of backcast and forecast lengths). Defaults to 0.0, i.e. no weight.\nloss : MultiHorizonMetric\n Loss to optimize. Defaults to MASE().\nlog_gradient_flow : bool\n If to log gradient flow, this takes time and should be only done to diagnose\n training failures.\nreduce_on_plateau_patience : int\n Patience after which learning rate is reduced by a factor of 10\nlogging_metrics : nn.ModuleList of MultiHorizonMetric\n List of metrics that are logged during training. Defaults to\n nn.ModuleList([SMAPE(), MAE(), RMSE(), MAPE(), MASE()])\nnum : int\n Parameter for KAN layer. the number of grid intervals = G.\n Default: 5.\nk : int\n Parameter for KAN layer. the order of piecewise polynomial. Default: 3.\nnoise_scale : float\n Parameter for KAN layer. the scale of noise injected at initialization.\n Default: 0.1.\nscale_base_mu : float\n Parameter for KAN layer. the scale of the residual function b(x) is initialized\n to be N(scale_base_mu, scale_base_sigma^2). Default: 0.0
|
|
Run pytest:
pytorch_forecasting/tests/test_all_estimators.py#L375
TestAllPtForecasters.test_class_has_doctest_example[DeepAR]
AssertionError: DeepAR docstring has no doctest example
assert '>>>' in 'DeepAR: Probabilistic forecasting with autoregressive recurrent networks.'
|
|
Run pytest:
pytorch_forecasting/tests/test_all_estimators.py#L375
TestAllPtForecasters.test_class_has_doctest_example[DecoderMLP]
AssertionError: DecoderMLP docstring has no doctest example
assert '>>>' in 'MLP on the decoder.\n\nMLP that predicts output only based on information available in the decoder.\n'
|
|
Run pytest:
../../../../../opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages/lightning/pytorch/utilities/_pytree.py#L21
`isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
|
|
Run pytest:
../../../../../opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages/lightning/pytorch/utilities/_pytree.py#L21
`isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
|
|
Run pytest:
../../../../../opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages/lightning/pytorch/utilities/_pytree.py#L21
`isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
|
|
Run pytest:
../../../../../opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages/lightning/pytorch/utilities/_pytree.py#L21
`isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
|
|
Run pytest:
../../../../../opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages/lightning/pytorch/utilities/_pytree.py#L21
`isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
|
|
Run pytest:
../../../../../opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages/lightning/pytorch/utilities/_pytree.py#L21
`isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
|
|
Run pytest:
../../../../../opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages/lightning/pytorch/utilities/_pytree.py#L21
`isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
|
|
Run pytest:
../../../../../opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages/lightning/pytorch/utilities/_pytree.py#L21
`isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
|
|
Run pytest:
../../../../../opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages/lightning/pytorch/utilities/_pytree.py#L21
`isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
|
|
Run pytest:
../../../../../opt/hostedtoolcache/Python/3.13.14/x64/lib/python3.13/site-packages/lightning/pytorch/utilities/_pytree.py#L21
`isinstance(treespec, LeafSpec)` is deprecated, use `isinstance(treespec, TreeSpec) and treespec.is_leaf()` instead.
|
background
wait
wait-all
cancel
parallel
Loading