Skip to content

Commit

Permalink
[MNT] Update pre commit hooks and run all (#1630)
Browse files Browse the repository at this point in the history
1. updates all the `pre-commit` hooks to their latest versions using `pre-commit autoupdate`
2. runs all hooks on all files using `pre-commit run --all-files`
  • Loading branch information
yarnabrina authored Aug 30, 2024
1 parent 4df80af commit 752d099
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-ast
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.1.1
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.9.0
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
rev: 1.8.7
hooks:
- id: nbqa-black
- id: nbqa-isort
Expand Down
6 changes: 3 additions & 3 deletions pytorch_forecasting/data/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -1567,9 +1567,9 @@ def __getitem__(self, idx: int) -> Tuple[Dict[str, torch.Tensor], torch.Tensor]:

# switch some variables to nan if encode length is 0
if encoder_length == 0 and len(self.dropout_categoricals) > 0:
data_cat[
:, [self.flat_categoricals.index(c) for c in self.dropout_categoricals]
] = 0 # zero is encoded nan
data_cat[:, [self.flat_categoricals.index(c) for c in self.dropout_categoricals]] = (
0 # zero is encoded nan
)

assert decoder_length > 0, "Decoder length should be greater than 0"
assert encoder_length >= 0, "Encoder length should be at least 0"
Expand Down

0 comments on commit 752d099

Please sign in to comment.