Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNT] fix pre-commit failures on main #1696

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

ewth
Copy link
Contributor

@ewth ewth commented Oct 9, 2024

Cleaned up the offending items so pre-commit passes on main.

Fixes #1695

Description

This quick fix sorts out the files causing pre-commit to fail on main, so it can run again.

Checklist

  • Linked issues (if existing)
  • Amended changelog for large changes (and added myself there as contributor)
  • Added/modified tests
  • Used pre-commit hooks when committing to ensure that code is compliant with hooks. Install hooks with pre-commit install.
    To run hooks independent of commit, execute pre-commit run --all-files

Make sure to have fun coding!

Cleaned up the offending items so `pre-commit` passes on main.

See sktime#1695
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@ewth
Copy link
Contributor Author

ewth commented Oct 9, 2024

Before:

$ git checkout main
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
$ git rev-parse HEAD
53a1c4168dacb0de027d946895bcc9810e86a1da
$ pre-commit run --all-files
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

After:

$ git checkout fix/pre-commit-failing 
Switched to branch 'fix/pre-commit-failing'
Your branch is up to date with 'origin/fix/pre-commit-failing'.
$ git rev-parse HEAD
16a119e4d05fe16089c5db9d7cc7bb3ea5a81f75
$ pre-commit run --all-files
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
check python ast.........................................................Passed
flake8...................................................................Passed
isort....................................................................Passed
black....................................................................Passed
nbqa-black...............................................................Passed
nbqa-isort...............................................................Passed
nbqa-flake8..............................................................Passed
nbqa-check-ast...........................................................Passed

@ewth ewth changed the title [FIX] pre-commit failing on main [MNT] pre-commit failing on main Oct 9, 2024
@fkiraly fkiraly added the maintenance Continuous integration, unit testing & package distribution label Oct 10, 2024
@fkiraly fkiraly changed the title [MNT] pre-commit failing on main [MNT] fix pre-commit failures on main Oct 10, 2024
@fkiraly fkiraly merged commit 63fadd1 into sktime:main Oct 10, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Continuous integration, unit testing & package distribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MNT] pre-commit failing on main
2 participants