ansys / ansys/pyfluent

Address Fluent-centric attribute labels

Open
#4,659 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
497
Forks
77
Avg merge
22h 37m
Merged PRs (30d)
45

Description

```
>>> pprint.pprint(solver_session.setup.models.get_attrs(['active?'], recursive=True))
{'attrs': {'active?': True},
'group_children': {'acoustics': {'attrs': {'active?': True},
'group_children': {'model': {'attrs': {'active?': True}}}},
'battery': {'attrs': {'active?': True},
'group_children': {'enabled': {'attrs': {'active?': True}}}},
'discrete-phase': {'attrs': {'active?': True},
...
```
I think it's OK to provide this functionality as it potentially avoids a lot of extra traffic, but those names ought to be translated, including the argument in the call. Background: we originally only supported the raw formats like get_attrs('active?') and added the specific wrapper methods like is_active() later. We didn't address the above though, but I think we should now.

```
>>> pprint.pprint(solver_session.setup.models.get_attrs(['is_active'], recursive=True))
{'attrs': {'is_active': True},
'group_children': {'acoustics': {'attrs': {'is_active': True},
'group_children': {'model': {'attrs': {'is_active': True}}}},
'battery': {'attrs': {'is_active': True},
'group_children': {'enabled': {'attrs': {'is_active': True}}}},
'discrete-phase': {'attrs': {'is_active': True},
...
```

Contributor guide

Open the contributing guide

Research direction

Start at solver_session.setup.models.get_attrs, focusing on recursive attribute lookup and the names passed to it. Compare calls using raw names such as 'active?' with wrapper names such as 'is_active'; done means the argument and returned attribute labels are translated consistently throughout the recursive result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.