Commit 4f618cb
fix: Implement migration adapter check for textual settings parameters. (#4515)
This change updates the type-checking logic to correctly handle cases
where a migration adapter is present.
**Previous Behavior**
When setting a textual attribute through PyFluent, type checking was
performed before delegating to the underlying Settings API.
If the provided value did not strictly match the expected type, PyFluent
raised a TypeError, even in cases where a migration adapter existed to
handle type conversion.
For example:
```python
>>> solver.settings.setup.models.discrete_phase.general_settings.unsteady_tracking.create_particles_at = False
```
Here, the property accepts a string value, but a migration adapter is
available that correctly converts a boolean (False) into the appropriate
string value.
Previously, PyFluent would still raise a TypeError before this
conversion could occur.
**Current Behavior**
If a migration adapter exists for a setting, PyFluent now bypasses type
checking and directly forwards the input to the Settings API.
This allows the migration adapter to handle type conversions or other
logic as intended.
Please refer to the test to see the detailed usage.
The change aligns PyFluent behavior with the Fluent-side fix (ref. bug
1293534).
---------
Co-authored-by: pyansys-ci-bot <[email protected]>
Co-authored-by: Sean Pearson <[email protected]>1 parent ec2c873 commit 4f618cb
File tree
3 files changed
+41
-2
lines changed- doc/changelog.d
- src/ansys/fluent/core/solver
- tests
3 files changed
+41
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
689 | | - | |
| 689 | + | |
| 690 | + | |
690 | 691 | | |
691 | | - | |
| 692 | + | |
| 693 | + | |
692 | 694 | | |
693 | 695 | | |
694 | 696 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
793 | 793 | | |
794 | 794 | | |
795 | 795 | | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
0 commit comments