ansys / ansys/pyfluent

Support for kwargs that pass through to the instance properties in `.create()` and the object oriented types

Open
#4,863 0 comments 0 reactions 1 assignee Claimed by @Gobot1234 View on GitHub
enhancement flobject
Dominant language
Python
Stars
497
Forks
77
Avg merge
22h 37m
Merged PRs (30d)
45

Description

### 📝 Description of the feature

Currently the api is very verbose when creating an attribute with few attributes

Consider the following snippet using the dict API for creating some attributes with a single attribute
```py
regolith_bc.radiation.internal_emissivity_band = {"solar": 0.87, "thermal-ir": 0.97}
```
Translating this to a more typed API style leads to this
```py
regolith_bc.radiation.internal_emissivity_band.create("solar").value = 0.87
regolith_bc.radiation.internal_emissivity_band.create("thermal-ir").value = 0.97
```
This doesn't seem ideal especially at this low number
```py
regolith_bc.radiation.internal_emissivity_band.create("solar", value=0.87)
```
This is especially useful doing just 2 properties so you can avoid an assignment

### 💡 Steps for implementing the feature

I'll have a poke around flobject for this

### 🔗 Useful links and references

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.