-
Notifications
You must be signed in to change notification settings - Fork 67
feat: add get and create methods and **kwarg support for create #4866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
df68d26
61d4c66
f274df3
4e5c6be
269c59e
c40e9ed
91882b2
9430310
c38d797
9d6dacc
73cafbe
d42a24a
779bb60
51664a4
c3c5aee
20ce7f9
ae11446
fedf799
fb48b06
a81582c
dae1864
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add get and create methods and **kwarg support for create | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -22,7 +22,9 @@ | |||||
|
|
||||||
| """Base classes for builtin setting classes.""" | ||||||
|
|
||||||
| from typing import Protocol, runtime_checkable | ||||||
| from typing import Any, Protocol, runtime_checkable | ||||||
|
|
||||||
| from typing_extensions import Self | ||||||
|
|
||||||
| from ansys.fluent.core.solver.flobject import ( | ||||||
|
Comment on lines
+27
to
30
|
||||||
| InactiveObjectError, | ||||||
|
|
@@ -82,19 +84,32 @@ def _get_settings_obj(settings_root, builtin_settings_obj): | |||||
| return obj | ||||||
|
|
||||||
|
|
||||||
| def _initialize_settings(instance, defaults: dict, settings_source=None, **kwargs): | ||||||
| active_session = _get_active_session() | ||||||
| instance.__dict__.update(defaults | kwargs) | ||||||
| if settings_source is not None: | ||||||
| instance.settings_source = settings_source | ||||||
| elif active_session: | ||||||
| instance.settings_source = active_session | ||||||
|
|
||||||
|
|
||||||
| class _SingletonSetting: | ||||||
| class _SettingsObjectMixin: | ||||||
| def __init__(self, defaults: dict, settings_source: SettingsBase | Solver | None = None, **kwargs: Any): | ||||||
| active_session = _get_active_session() | ||||||
| self.__dict__.update(defaults | kwargs) | ||||||
| if settings_source is not None: | ||||||
| self.settings_source = settings_source | ||||||
| elif active_session: | ||||||
| self.settings_source = active_session | ||||||
|
|
||||||
| @classmethod | ||||||
| def get(cls, settings_source: SettingsBase | Solver | None = None, /, *, name: str) -> Self: | ||||||
| """Get and return the singleton instance of this object in Fluent. | ||||||
|
||||||
| """Get and return the singleton instance of this object in Fluent. | |
| """Get and return an instance of this object in Fluent. |
Uh oh!
There was an error while loading. Please reload this page.