Skip to content

Commit

Permalink
Added user_creatable() accessor method to NamedObject (#1123)
Browse files Browse the repository at this point in the history
  • Loading branch information
prmukherj authored Dec 1, 2022
1 parent 86b48fa commit c9a9069
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
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 @@ -571,6 +571,10 @@ def items(self):
self._update_objects()
return self._objects.items()

def user_creatable(self) -> bool:
"""Whether the object is user-creatable."""
return self.get_attr("user-creatable?", bool)

def get_object_names(self):
"""Object names."""
obj_names = self.flproxy.get_object_names(self.path)
Expand Down
6 changes: 6 additions & 0 deletions tests/test_flobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,12 @@ def test_accessor_methods_on_settings_object(load_static_mixer_case):
modified = solver.file.read.file_type.is_read_only()
assert existing == modified

existing = solver.setup.boundary_conditions.velocity_inlet.get_attr(
"user-creatable?"
)
modified = solver.setup.boundary_conditions.velocity_inlet.user_creatable()
assert existing == modified

assert (
solver.setup.boundary_conditions.velocity_inlet[
"inlet1"
Expand Down

0 comments on commit c9a9069

Please sign in to comment.