sktime / pytorch-forecasting

Time series forecasting with PyTorch
https://pytorch-forecasting.readthedocs.io/
MIT License
3.98k stars 629 forks source link

[MNT] `pre-commit` failing on `main` #1695

Closed ewth closed 3 weeks ago

ewth commented 3 weeks ago

Describe the bug

pre-commit is failing on main, rendering it effectively unusable for other branches created from main.

To Reproduce

$ git checkout main
Already on 'main'
Your branch is up to date with 'origin/main'.
$ git pull
Already up to date.
$ git reset --hard
HEAD is now at 53a1c41 [MNT] Relax `numpy` bound to `numpy<3.0.0` (#1624)
$ pre-commit run --all-files

Expected behavior

All pre-commit tests pass.

Additional context

pre-commit output:

trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

examples/ar.py:88:56: E226 missing whitespace around arithmetic operator
print(f"Number of parameters in network: {deepar.size()/1e3:.1f}k")
                                                       ^
examples/nbeats.py:68:53: E226 missing whitespace around arithmetic operator
print(f"Number of parameters in network: {net.size()/1e3:.1f}k")
                                                    ^
examples/stallion.py:122:53: E226 missing whitespace around arithmetic operator
print(f"Number of parameters in network: {tft.size()/1e3:.1f}k")
                                                    ^
pytorch_forecasting/data/timeseries.py:106:28: E226 missing whitespace around arithmetic operator
                f"{na} ({na/tensor.size(0):.2%}) of {name} "
                           ^

isort....................................................................Passed
black....................................................................Passed
nbqa-black...............................................................Passed
nbqa-isort...............................................................Passed
nbqa-flake8..............................................................Failed
- hook id: nbqa-flake8
- exit code: 1

docs/source/tutorials/stallion.ipynb:cell_7:25:53: E226 missing whitespace around arithmetic operator
print(f"Number of parameters in network: {tft.size()/1e3:.1f}k")
                                                    ^
docs/source/tutorials/stallion.ipynb:cell_9:29:53: E226 missing whitespace around arithmetic operator
print(f"Number of parameters in network: {tft.size()/1e3:.1f}k")
                                                    ^

nbqa-check-ast...........................................................Passed

Versions N/A

ewth commented 3 weeks ago

As this is related to development and not a bug within pytorch-forecasting per-se, I'm not sure if [BUG] is the correct type. I issued a PR to fix it which I changed to [MNT]. Anyone more familiar with the standards used here please feel free to adjust as necessary -- apologies if I'm creating additional work for anyone!