Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ permissions:
issues: write

env:
API_CODE_CACHE: 5
API_CODE_CACHE: 6
DOCUMENTATION_CNAME: "fluent.docs.pyansys.com"
PACKAGE_NAME: "ansys-fluent-core"
PACKAGE_NAMESPACE: "ansys.fluent.core"
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/4397.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add _has_migration_adapter bool to flobject classes
4 changes: 4 additions & 0 deletions src/ansys/fluent/core/codegen/settingsgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def _populate_data(cls, api_tree: dict, version: str) -> dict:
else:
data["child_object_type"] = None
data["allowed_values"] = getattr(cls, "_allowed_values", [])
data["has_migration_adapter"] = getattr(cls, "_has_migration_adapter", False)
return data


Expand Down Expand Up @@ -319,6 +320,9 @@ def _write_data(cls_name: str, python_name: str, data: dict, f: IO, f_stub: IO |
if data["allowed_values"]:
s.write(f" _allowed_values = {data['allowed_values']!r}\n")
s_stub.write(" _allowed_values: list[str]\n")
if data["has_migration_adapter"]:
s.write(" _has_migration_adapter = True\n")
s_stub.write(" _has_migration_adapter: bool\n")
s.write("\n")
s_stub.write("\n")
for name, (python_name, data, hash_, should_write_stub) in classes_to_write.items():
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/services/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def get_static_info(self) -> dict[str, Any]:
"""
request = SettingsModule.GetStaticInfoRequest()
request.root = "fluent"
request.optional_attrs.append("allowed-values")
request.optional_attrs.extend(["allowed-values", "has-migration-adapter?"])
response = self._service_impl.get_static_info(request)
# The RPC calls no longer raise an exception. Force an exception if
# type is empty
Expand Down
4 changes: 4 additions & 0 deletions src/ansys/fluent/core/solver/flobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -2282,6 +2282,10 @@ def _process_cls_names(info_dict, names, write_doc=False):
)
cls._allowed_values = allowed_values

has_migration_adapter = info.get("has-migration-adapter?", False)
if has_migration_adapter:
cls._has_migration_adapter = True

except Exception:
print(
f"Unable to construct class for '{name}' of "
Expand Down
Loading