Skip to content

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

@Gobot1234

Description

@Gobot1234

📝 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

regolith_bc.radiation.internal_emissivity_band = {"solar": 0.87, "thermal-ir": 0.97}

Translating this to a more typed API style leads to this

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

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

Metadata

Metadata

Assignees

Labels

enhancementImprove any current implemented featureflobjectRelated to Flobject

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions