diff --git a/doc/datamodel_rstgen.py b/doc/datamodel_rstgen.py index 0f54182fb63..cc07aab3812 100644 --- a/doc/datamodel_rstgen.py +++ b/doc/datamodel_rstgen.py @@ -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) @@ -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) diff --git a/doc/tui_rstgen.py b/doc/tui_rstgen.py index b20316865fb..22f8d902384 100644 --- a/doc/tui_rstgen.py +++ b/doc/tui_rstgen.py @@ -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 diff --git a/tests/test_file_transfer_service.py b/tests/test_file_transfer_service.py index 312683eb064..8ad048bc047 100644 --- a/tests/test_file_transfer_service.py +++ b/tests/test_file_transfer_service.py @@ -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")