I attempted to use Maxwell2DManager.plot within a SAF GLOW method without pyvista and numpy in the virtual environment.
The method execution environment in SAF/GLOW recorded the python log (at the INFO level) as follows:
2023-06-07 13:45:47,980 INFO [ansys.platform.instancemanagement.client] [client.py:55] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- Connecting.
2023-06-07 13:45:47,991 INFO [root] [aedt.py:255] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- calling Maxwell2d(specified_version="2023.1", machine="127.0.0.1", port=62015)
2023-06-07 13:45:48,091 INFO [Global] [aedt_logger.py:479] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- StdOut has been enabled
2023-06-07 13:45:48,092 INFO [Global] [aedt_logger.py:479] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- using existing logger.
2023-06-07 13:45:48,098 INFO [Global] [aedt_logger.py:479] [trace_id=0 span_id=0 resource.service.name=Method Runner]- AEDT file load (threaded) time: 0.006998300552368164
2023-06-07 13:45:48,149 INFO [Global] [aedt_logger.py:479] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- AEDT installation Path C:\Program Files\AnsysEM\v231\Win64
2023-06-07 13:45:48,150 INFO [Global] [aedt_logger.py:479] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- Launching AEDT with the gRPC plugin.
2023-06-07 13:45:48,160 INFO [Global] [aedt_logger.py:479] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- Connecting to AEDT session on gRPC port 62015
2023-06-07 13:45:48,168 INFO [Global] [aedt_logger.py:479] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- pyaedt v0.6.79
2023-06-07 13:45:48,168 INFO [Global] [aedt_logger.py:479] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- Python version 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
2023-06-07 13:45:48,170 INFO [Global] [aedt_logger.py:479] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- AEDT 2023.1.0 Build Date 2022-11-20 22:10:41
2023-06-07 13:45:48,175 INFO [Global] [aedt_logger.py:479] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- Project project set to active.
2023-06-07 13:45:48,177 INFO [Global] [aedt_logger.py:479] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- Aedt Objects initialized
2023-06-07 13:45:48,177 INFO [Global] [aedt_logger.py:479] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- Variable Manager initialized
2023-06-07 13:45:48,177 INFO [Global] [aedt_logger.py:479] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- Design Loaded
2023-06-07 13:45:48,177 INFO [Global] [aedt_logger.py:479] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- Materials Loaded
2023-06-07 13:45:48,556 ERROR [Global] [general_methods.py:55] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- File "D:\ANSYSDEV\tutorial-simple-instance\.venv\lib\site-packages\pyaedt\generic\plot.py", line 1491, in plot, NAME ERROR
2023-06-07 13:45:48,557 ERROR [Global] [general_methods.py:55] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- Method arguments:
2023-06-07 13:45:48,557 ERROR [Global] [general_methods.py:55] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- export_image_path = C:\Users\afinney\OneDrive - ANSYS, Inc\Documents\x2\.product_instance_state\first_step\aedt\plot.jpg
2023-06-07 13:45:48,557 ERROR [Global] [general_methods.py:55] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- Check Online documentation on: https://aedt.docs.pyansys.com/version/stable/search.html?q=plot+export_image_path
2023-06-07 13:45:48,574 ERROR [root] [method_runner.py:60] [trace_id=06894ad4a5cf64e391897b8af3c2eb9f span_id=e65098978bcc31a5 resource.service.name=Method Runner]- [Errno 2] No such file or directory: 'C:\\Users\\afinney\\OneDrive - ANSYS, Inc\\Documents\\x2\\.product_instance_state\\first_step\\aedt\\plot.jpg' - Traceback (most recent call last):
whereas running the same code directly in python I got the following more informative output.
>>> maxwell_2d.plot(show=False, export_path=os.path.join(maxwell_2d.working_directory, "Image.jpg"), plot_air_objects=True)
D:\ANSYSDEV\tutorial-simple-instance\.venv\lib\site-packages\pyaedt\generic\plot.py:22: UserWarning: The NumPy module is required to run some functionalities of PostProcess.
Install with
pip install numpy
Requires CPython.
warnings.warn(
D:\ANSYSDEV\tutorial-simple-instance\.venv\lib\site-packages\pyaedt\generic\plot.py:32: UserWarning: The PyVista module is required to run some functionalities of PostProcess.
Install with
pip install pyvista
Requires CPython.
warnings.warn(
Install with
pip install matplotlib
Requires CPython.
warnings.warn(
D:\ANSYSDEV\tutorial-simple-instance\.venv\lib\site-packages\pyaedt\modules\AdvancedPostProcessing.py:21: UserWarning: The NumPy module is required to run some functionalities of PostProcess.
Install with
pip install numpy
Requires CPython.
warnings.warn(
PyAEDT ERROR: File "D:\ANSYSDEV\tutorial-simple-instance\.venv\lib\site-packages\pyaedt\generic\plot.py", line 1491, in plot, NAME ERROR
PyAEDT ERROR: Method arguments:
PyAEDT ERROR: export_image_path = C:/Users/afinney/AppData/Local/Temp/pyaedt_prj_8WE/Project_YEI.pyaedt\Maxwell_2D_OAF\Image.jpg
PyAEDT ERROR: Check Online documentation on: https://aedt.docs.pyansys.com/version/stable/search.html?q=plot+export_image_path
<pyaedt.generic.plot.ModelPlotter object at 0x00000279B0678550>
pyaedt should ensure the extra information above, the "Install with" information, is logged as Errors so that it is visible in logs.
Steps To Reproduce
run the following in an venv without numpy or pyvista
Install with
pip install numpy
Requires CPython.
warnings.warn(
D:\ANSYSDEV\tutorial-simple-instance\.venv\lib\site-packages\pyaedt\generic\plot.py:32: UserWarning: The PyVista module is required to run some functionalities of PostProcess.
Install with
pip install pyvista
Requires CPython.
warnings.warn(
D:\ANSYSDEV\tutorial-simple-instance\.venv\lib\site-packages\pyaedt\generic\plot.py:43: UserWarning: The Matplotlib module is required to run some functionalities of PostProcess.
Install with
pip install matplotlib
Requires CPython.
warnings.warn(
D:\ANSYSDEV\tutorial-simple-instance\.venv\lib\site-packages\pyaedt\modules\AdvancedPostProcessing.py:21: UserWarning: The NumPy module is required to run some functionalities of PostProcess.
Install with
pip install numpy
Requires CPython.
warnings.warn(
PyAEDT ERROR: File "D:\ANSYSDEV\tutorial-simple-instance\.venv\lib\site-packages\pyaedt\generic\plot.py", line 1491, in plot, NAME ERROR
PyAEDT ERROR: Method arguments:
PyAEDT ERROR: export_image_path = C:/Users/afinney/AppData/Local/Temp/pyaedt_prj_ZED/Project_8CT.pyaedt\Maxwell_2D_KSF\Image.jpg
PyAEDT ERROR: Check Online documentation on: https://aedt.docs.pyansys.com/version/stable/search.html?q=plot+export_image_path
but the file c:\temp\log.log only contains
INFO:Global:StdOut has been enabled
INFO:Global:using existing logger.
INFO:Global:AEDT installation Path C:\Program Files\AnsysEM\v231\Win64
INFO:Global:Launching AEDT with the gRPC plugin.
INFO:Global:New AEDT session is starting on gRPC port 63738
INFO:Global:Ansoft.ElectronicsDesktop.2023.1 version started with process ID 32052.
INFO:Global:pyaedt v0.6.79
INFO:Global:Python version 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
INFO:Global:AEDT 2023.1.0 Build Date 2022-11-20 22:10:41
INFO:Global:Project Project_8CT has been created.
INFO:Global:No design is present. Inserting a new design.
INFO:Global:Added design 'Maxwell 2D_KSF' of type Maxwell 2D.
INFO:Global:Aedt Objects initialized
INFO:Global:Variable Manager initialized
INFO:Global:Design Loaded
INFO:Global:Materials Loaded
INFO:Global:aedt file load time 0.0060007572174072266
INFO:Global:Successfully loaded project materials !
ERROR:Global: File "D:\ANSYSDEV\tutorial-simple-instance\.venv\lib\site-packages\pyaedt\generic\plot.py", line 1491, in plot, NAME ERROR
ERROR:Global:Method arguments:
ERROR:Global: export_image_path = C:/Users/afinney/AppData/Local/Temp/pyaedt_prj_ZED/Project_8CT.pyaedt\Maxwell_2D_KSF\Image.jpg
ERROR:Global:Check Online documentation on: https://aedt.docs.pyansys.com/version/stable/search.html?q=plot+export_image_path
Before submitting the issue
Description of the bug
I attempted to use Maxwell2DManager.plot within a SAF GLOW method without pyvista and numpy in the virtual environment.
The method execution environment in SAF/GLOW recorded the python log (at the INFO level) as follows:
whereas running the same code directly in python I got the following more informative output.
pyaedt should ensure the extra information above, the "Install with" information, is logged as Errors so that it is visible in logs.
Steps To Reproduce
run the following in an venv without numpy or pyvista
the following is output to console:
but the file c:\temp\log.log only contains
Which Operating System are you using?
Windows
Which Python version are you using?
3.8
Installed packages