Skip to content

Conversation

@mkundu1
Copy link
Contributor

@mkundu1 mkundu1 commented Nov 17, 2025

Context

Earlier it was possible to execute a read-only command or query.

Change Summary

A new exception-type is raised when user tries to execute a read-only command/query. Note that, attribute access of read-only command/query and its arguments should still work.

Rationale

We already throw a different exception-type from PyFluent when user tries to execute an inactive command/query. Raising of the new exception for read-only command/query has been at the same place.

Impact

This will fix the current incorrect behaviour, a new unittest has been added.

Copilot AI review requested due to automatic review settings November 17, 2025 15:51
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 introduces a new exception type ReadOnlyActionError to prevent execution of read-only commands and queries in PyFluent. Previously, the system allowed executing read-only commands/queries, which was incorrect behavior.

Key Changes:

  • Added ReadOnlyActionError exception class for read-only command/query execution attempts
  • Implemented checks in command and query __call__ methods to raise the exception when read-only
  • Added test coverage for the new exception behavior

Reviewed Changes

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

File Description
src/ansys/fluent/core/solver/flobject.py Added ReadOnlyActionError exception class and read-only checks in command/query execution methods
tests/test_settings_api.py Added test_read_only_command_execution test and imported new exception types
tests/conftest.py Added mixing_elbow_case_session fixture to support the new test

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

@github-actions github-actions bot added the new feature Request or proposal for a new feature label Nov 17, 2025
@mkundu1
Copy link
Contributor Author

mkundu1 commented Nov 17, 2025

Relevant Fluent ADO id - 1354052

Copilot AI review requested due to automatic review settings November 17, 2025 15:54
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 4 out of 4 changed files in this pull request and generated 1 comment.


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

@mkundu1 mkundu1 merged commit 32c5124 into main Nov 21, 2025
36 checks passed
@mkundu1 mkundu1 deleted the feat/read-only-command-exec branch November 21, 2025 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature Request or proposal for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants