From 8144d72860ba0aa84bbf82311b9c7cbffb2b53ad Mon Sep 17 00:00:00 2001 From: German Martinez Date: Thu, 21 Mar 2024 10:28:17 +0100 Subject: [PATCH 1/3] Fix doc builds in Windows --- src/ansys/mapdl/core/launcher.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ansys/mapdl/core/launcher.py b/src/ansys/mapdl/core/launcher.py index f890a08570..121ea576d9 100644 --- a/src/ansys/mapdl/core/launcher.py +++ b/src/ansys/mapdl/core/launcher.py @@ -1578,6 +1578,7 @@ def launch_mapdl( # launch an instance of pymapdl if it does not already exist and # we're allowed to start instances if GALLERY_INSTANCE[0] is None: + GALLERY_INSTANCE[0] = "Loading..." mapdl = launch_mapdl( start_instance=True, cleanup_on_exit=False, @@ -1588,8 +1589,8 @@ def launch_mapdl( GALLERY_INSTANCE[0] = {"ip": mapdl._ip, "port": mapdl._port} return mapdl - # otherwise, connect to the existing gallery instance if available - elif GALLERY_INSTANCE[0] is not None: + # otherwise, connect to the existing gallery instance if available, but it needs to be fully loaded. + elif GALLERY_INSTANCE[0] != "Loading...": mapdl = MapdlGrpc( ip=GALLERY_INSTANCE[0]["ip"], port=GALLERY_INSTANCE[0]["port"], From 307f831699ba78ff25a801f70e532741208dd737 Mon Sep 17 00:00:00 2001 From: German Martinez Date: Thu, 21 Mar 2024 10:44:32 +0100 Subject: [PATCH 2/3] Remove unreached code --- src/ansys/mapdl/core/launcher.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/ansys/mapdl/core/launcher.py b/src/ansys/mapdl/core/launcher.py index 121ea576d9..481f91d861 100644 --- a/src/ansys/mapdl/core/launcher.py +++ b/src/ansys/mapdl/core/launcher.py @@ -1611,9 +1611,6 @@ def launch_mapdl( print(f"There is an existing MAPDL instance at: {ip}:{port}") return - if pymapdl.BUILDING_GALLERY: # pragma: no cover - LOG.debug("Building gallery.") - if _debug_no_launch: return pack_parameters( port, From 4aa183eea1899166c8e9d7dfb80ad65d9d6936af Mon Sep 17 00:00:00 2001 From: German Martinez Date: Thu, 21 Mar 2024 10:46:35 +0100 Subject: [PATCH 3/3] Better logging --- src/ansys/mapdl/core/launcher.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ansys/mapdl/core/launcher.py b/src/ansys/mapdl/core/launcher.py index 481f91d861..86f338a759 100644 --- a/src/ansys/mapdl/core/launcher.py +++ b/src/ansys/mapdl/core/launcher.py @@ -1578,6 +1578,7 @@ def launch_mapdl( # launch an instance of pymapdl if it does not already exist and # we're allowed to start instances if GALLERY_INSTANCE[0] is None: + LOG.debug("Loading first MAPDL instance for gallery building.") GALLERY_INSTANCE[0] = "Loading..." mapdl = launch_mapdl( start_instance=True, @@ -1591,6 +1592,9 @@ def launch_mapdl( # otherwise, connect to the existing gallery instance if available, but it needs to be fully loaded. elif GALLERY_INSTANCE[0] != "Loading...": + LOG.debug( + "Connecting to an existing MAPDL instance for gallery building." + ) mapdl = MapdlGrpc( ip=GALLERY_INSTANCE[0]["ip"], port=GALLERY_INSTANCE[0]["port"], @@ -1604,6 +1608,9 @@ def launch_mapdl( mapdl.clear() return mapdl + else: + LOG.debug("Bypassing Gallery building flag for the first time.") + else: LOG.debug("Connecting to an existing instance of MAPDL at %s:%s", ip, port)