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

[pre-commit.ci] pre-commit autoupdate #216

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

pre-commit-ci[bot]
Copy link
Contributor

@pre-commit-ci pre-commit-ci bot commented Jul 29, 2024

updates:

Summary by CodeRabbit

  • New Features

    • Updated the code formatter to enhance formatting consistency, performance, and compliance with the latest Python syntax.
    • Upgraded the linter to improve linting capabilities and overall code quality.
  • Improvements

    • Enhanced the organization of import statements in the notebook for better readability and maintainability.
    • Reformatted code blocks in the notebook to improve clarity and ease of understanding.
    • Standardized parameter order in export function calls, improving readability and maintainability across scripts.

Copy link

coderabbitai bot commented Jul 29, 2024

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The updates involve upgrading the versions of the black code formatter from 24.4.2 to 24.8.0 and the ruff linter from v0.5.4 to v0.6.1 in the .pre-commit-config.yaml file. Additionally, modifications were made to an IPython notebook, focusing on reordering imports and enhancing the readability of a specific code block. Changes were also made to parameter orders in function calls across multiple Python files.

Changes

Files Change Summary
.pre-commit-config.yaml Updated black from 24.4.2 to 24.8.0; updated ruff from v0.5.4 to v0.6.1.
examples/ipynb/notebook_showcase_k3d.ipynb Reordered import statements and reformatted the creation of the empty_torus object for readability.
examples/export_meshio.py Rearranged parameters in calls to gus.io.meshio.export to place export path as the first argument.
examples/mixd_to_nutils.py Changed argument order in calls to gus.io.mixd.export and gus.io.nutils.export, placing filepath first.

Poem

🐇 In the code garden, tools refine,
Black and Ruff, oh how they shine!
With versions fresh, they prance and play,
Ensuring clean code, come what may.
Hooray for upgrades, let us cheer,
For better coding year by year! 🎉


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

clemens-fricke
clemens-fricke previously approved these changes Aug 1, 2024
Copy link
Collaborator

@clemens-fricke clemens-fricke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between b017aa2 and accd7fe.

Files selected for processing (1)
  • .pre-commit-config.yaml (1 hunks)
Additional comments not posted (2)
.pre-commit-config.yaml (2)

30-30: Verify compatibility with the updated black version.

The version of black has been updated from 24.4.2 to 24.8.0. Ensure that the new version is compatible with the existing codebase and does not introduce any formatting changes that might conflict with the current code style.


36-36: Verify compatibility with the updated ruff-pre-commit version.

The version of ruff-pre-commit has been updated from v0.5.4 to v0.5.6. Ensure that the new version is compatible with the existing codebase and does not introduce any linting errors that might conflict with the current code style.

@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from accd7fe to edfc5e6 Compare August 12, 2024 20:35
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between accd7fe and edfc5e6.

Files selected for processing (1)
  • .pre-commit-config.yaml (1 hunks)
Additional comments not posted (2)
.pre-commit-config.yaml (2)

30-30: Black version update is correct.

The version of black has been updated to 24.8.0, which matches the PR objectives.


36-36: Ruff version update is correct.

The version of ruff-pre-commit has been updated to v0.5.7, which matches the PR objectives.

@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from edfc5e6 to 1d34c5a Compare August 19, 2024 20:40
@j042 j042 requested a review from clemens-fricke August 22, 2024 11:09
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between edfc5e6 and 0bddbc0.

Files selected for processing (2)
  • .pre-commit-config.yaml (1 hunks)
  • examples/ipynb/notebook_showcase_k3d.ipynb (2 hunks)
Additional comments not posted (4)
.pre-commit-config.yaml (2)

30-30: Version update for black.

The black formatter has been updated to version 24.8.0. Ensure compatibility with your project's code style and other dependencies.


36-36: Version update for ruff-pre-commit.

The ruff-pre-commit package has been updated to version v0.6.1. Verify that this version aligns with your project's linting requirements.

examples/ipynb/notebook_showcase_k3d.ipynb (2)

20-21: Reordered import for gustaf.

The import statement for gustaf has been moved to improve readability by grouping related imports together. This is a good practice for maintaining clear and organized code.


160-162: Improved readability for empty_torus creation.

The empty_torus creation has been reformatted into a multi-line expression, enhancing readability and maintainability. Ensure that this change does not affect the intended functionality.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between 0bddbc0 and 7bf76e4.

Files selected for processing (2)
  • examples/export_meshio.py (1 hunks)
  • examples/mixd_to_nutils.py (1 hunks)
Additional context used
Learnings (1)
examples/export_meshio.py (1)
Learnt from: clemens-fricke
PR: tataratat/gustaf#214
File: examples/export_meshio.py:52-52
Timestamp: 2024-07-03T08:27:40.999Z
Learning: The `export` function in the `gus.io.meshio` module accepts arguments in the order `(export_path, mesh, submeshes=None, **kwargs)`.
Additional comments not posted (2)
examples/mixd_to_nutils.py (1)

11-12: LGTM! Verify function signature changes.

The changes in argument order for the export functions align with the updated function signatures.

Ensure that the function definitions in gus.io.mixd and gus.io.nutils support this new order.

Run the following script to verify the function signature changes:

Verification successful

Verified: Correct argument order in export function calls.

The export function calls in examples/mixd_to_nutils.py correctly use the argument order as defined in gustaf/io/mixd.py and gustaf/io/nutils.py. The first argument is fname, and the second is mesh.

  • gustaf/io/mixd.py: def export(fname, mesh)
  • gustaf/io/nutils.py: def export(fname, mesh)
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the function signatures for `export` in `gus.io.mixd` and `gus.io.nutils`.

# Test: Search for the function definitions. Expect: New argument order.
ast-grep --lang python --pattern $'def export(filepath, mesh):'

Length of output: 64


Script:

#!/bin/bash
# Description: Search for `export` function definitions in the entire codebase to verify their argument order.

# Search for `export` function definitions and include context lines for better understanding.
rg 'def export' -A 2 --glob '*.py'

Length of output: 815

examples/export_meshio.py (1)

47-57: LGTM! Verify function signature for gus.io.meshio.export.

The changes in argument order for the export function align with the expected parameter order.

Ensure that the function definition in gus.io.meshio supports this new order.

Run the following script to verify the function signature:

Verification successful

Function Signature Verified: Argument Order is Correct

The export function in gustaf/io/meshio.py matches the expected signature, confirming that the argument order in examples/export_meshio.py is correct.

  • gustaf/io/meshio.py: def export(fname, mesh, submeshes=None, **kwargs):
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the function signature for `export` in `gus.io.meshio`.

# Test: Search for the function definition. Expect: New argument order.
ast-grep --lang python --pattern $'def export(export_path, mesh, submeshes=None, **kwargs):'

Length of output: 93


Script:

#!/bin/bash
# Description: Search for any function named `export` in Python files across the codebase.

# Test: Search for the function definition. Expect: Locate the function and verify its signature.
ast-grep --lang python --pattern $'def export($$$):'

Length of output: 53


Script:

#!/bin/bash
# Description: Search for occurrences of `export` in Python files across the codebase.

# Test: Search for any reference to `export`. Expect: Find usage or definition clues.
rg 'export' --type py -A 3

Length of output: 4613

@clemens-fricke
Copy link
Collaborator

I noticed that we had again not merged the fix for the export path. I have added the fix again for the examples. I am not sure where it got lost again.

@j042
Copy link
Member

j042 commented Aug 22, 2024

Oh, I think it is still in #214 I will finalize all and merge soon

clemens-fricke
clemens-fricke previously approved these changes Aug 22, 2024
Copy link
Collaborator

@clemens-fricke clemens-fricke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good; changes are needed due to better linting in the ipynb files. Also, there is an old issue where the variable order was not correctly adapted after the export functions were changed.

@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from 66894a7 to 4ad3dbf Compare September 2, 2024 20:39
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from aa552aa to 45a39f4 Compare September 16, 2024 20:43
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from e1d5fb4 to 84b431d Compare September 23, 2024 20:45
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 9167a24 to f1156a3 Compare September 30, 2024 20:58
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 64e23e9 to 3aaa9e5 Compare October 7, 2024 22:01
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 72f8296 to 383d24c Compare October 21, 2024 21:02
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](pre-commit/pre-commit-hooks@v4.6.0...v5.0.0)
- [github.com/psf/black: 24.4.2 → 24.10.0](psf/black@24.4.2...24.10.0)
- [github.com/astral-sh/ruff-pre-commit: v0.5.4 → v0.7.1](astral-sh/ruff-pre-commit@v0.5.4...v0.7.1)
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 28ed317 to b24e786 Compare October 28, 2024 21:18
@clemens-fricke
Copy link
Collaborator

I will merge this as soon as the checks have run through. We pushed this from one ruff update to the next and had to regularly redo the function variable order change in the examples.

Copy link
Collaborator

@clemens-fricke clemens-fricke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@clemens-fricke clemens-fricke merged commit 6a7a797 into main Oct 30, 2024
22 checks passed
@clemens-fricke clemens-fricke deleted the pre-commit-ci-update-config branch October 30, 2024 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants