Skip to content

Conversation

@gerlero
Copy link
Owner

@gerlero gerlero commented Nov 26, 2025

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the file updating logic in FoamFile by consolidating methods, changing parameter types from unions with Literal to boolean flags, and making type annotations more strict. The main changes streamline the code structure while maintaining similar functionality.

Key changes:

  • Merged _perform_entry_operation and _process_data_entry into a single method with refactored logic flow
  • Replaced operation: Literal["put", "add"] with add: bool parameter using keyword-only syntax
  • Removed _normalize_and_validate_keywords method, inlining its logic into the main operation method
Comments suppressed due to low confidence (1)

src/foamlib/_files/files.py:38

  • [nitpick] The parameter type was changed from FieldLike to Field, making it more restrictive. However, the caller at line 521 passes data of type Data | StandaloneData | SubDict, which is broader than Field. While the try-except block handles invalid inputs at runtime, the type annotation is now inconsistent with how the function is called. Consider either reverting to FieldLike or updating the caller's type handling.
    field: FieldLike,

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@gerlero gerlero force-pushed the files branch 2 times, most recently from 1cd317e to a596285 Compare November 26, 2025 15:11
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