Skip to content

Commit

Permalink
fix: Fix for test_remote_grpc_fts_container and nightly dev doc (#2787
Browse files Browse the repository at this point in the history
)

* fix: Nightly dev test fix

* nightly dev doc tui_241 fix

* nightly dev doc generated fix
  • Loading branch information
hpohekar authored May 7, 2024
1 parent 9b5cd1b commit b15d1d2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
4 changes: 2 additions & 2 deletions doc/datamodel_rstgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def generate_meshing_datamodels():
for meshing_datamodel in meshing_datamodels:
try:
datamodel = importlib.import_module(
f"ansys.fluent.core.{_get_file_or_folder(mode='meshing', is_datamodel=True)}.{meshing_datamodel}"
f"ansys.fluent.core.generated.{_get_file_or_folder(mode='meshing', is_datamodel=True)}.{meshing_datamodel}"
)
if datamodel:
meshing_datamodel_roots.append(datamodel.Root)
Expand All @@ -40,7 +40,7 @@ def generate_solver_datamodels():
for solver_datamodel in solver_datamodels:
try:
datamodel = importlib.import_module(
f"ansys.fluent.core.{_get_file_or_folder(mode='solver', is_datamodel=True)}.{solver_datamodel}"
f"ansys.fluent.core.generated.{_get_file_or_folder(mode='solver', is_datamodel=True)}.{solver_datamodel}"
)
if datamodel:
solver_datamodel_roots.append(datamodel.Root)
Expand Down
22 changes: 14 additions & 8 deletions doc/tui_rstgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@
from rstgen import _get_file_or_folder, generate

if __name__ == "__main__":
meshing_tui = importlib.import_module(
f"ansys.fluent.core.meshing.{_get_file_or_folder(mode='meshing', is_datamodel=False)}"
)
generate(main_menu=meshing_tui.main_menu, mode="meshing", is_datamodel=False)
solver_tui = importlib.import_module(
f"ansys.fluent.core.solver.{_get_file_or_folder(mode='solver', is_datamodel=False)}"
)
generate(main_menu=solver_tui.main_menu, mode="solver", is_datamodel=False)
try:
meshing_tui = importlib.import_module(
f"ansys.fluent.core.generated.meshing.{_get_file_or_folder(mode='meshing', is_datamodel=False)}"
)
generate(main_menu=meshing_tui.main_menu, mode="meshing", is_datamodel=False)
except ModuleNotFoundError:
pass
try:
solver_tui = importlib.import_module(
f"ansys.fluent.core.generated.solver.{_get_file_or_folder(mode='solver', is_datamodel=False)}"
)
generate(main_menu=solver_tui.main_menu, mode="solver", is_datamodel=False)
except ModuleNotFoundError:
pass
10 changes: 6 additions & 4 deletions tests/test_file_transfer_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ def test_remote_grpc_fts_container(monkeypatch, new_solver_session, new_mesh_ses
"mixing_elbow.msh.h5", "pyfluent/mixing_elbow"
)
solver.file.read_case(file_name=import_case_file_name)
solver.file.write_case(file_name="downloaded_solver_mixing_elbow.cas.h5")
if solver._file_transfer_service:
solver.file.write_case(file_name="downloaded_solver_mixing_elbow.cas.h5")
assert solver.file_exists_on_remote("downloaded_solver_mixing_elbow.cas.h5")
assert file_downloaded_to_the_client("downloaded_solver_mixing_elbow.cas.h5")
assert file_downloaded_to_the_client("downloaded_solver_mixing_elbow.cas.h5")

meshing = new_mesh_session
meshing.meshing.File.ReadMesh(FileName=import_mesh_file_name)
meshing.meshing.File.WriteMesh(FileName="downloaded_meshing_mixing_elbow.msh.h5")
if meshing._file_transfer_service:
meshing.meshing.File.WriteMesh(
FileName="downloaded_meshing_mixing_elbow.msh.h5"
)
assert meshing.file_exists_on_remote("downloaded_meshing_mixing_elbow.msh.h5")
assert file_downloaded_to_the_client("downloaded_meshing_mixing_elbow.msh.h5")
assert file_downloaded_to_the_client("downloaded_meshing_mixing_elbow.msh.h5")

0 comments on commit b15d1d2

Please sign in to comment.