Closed abacef closed 5 years ago
Min repro:
Add this config to Configs/
{
"name": "Min Repro",
"experiment": [
{
"type": "PY_SCRIPT",
"source": "MinRepro.py",
"order": 1
}
]
}
Also, add this script named MinRepro.py to the src/Scripts directory
import matplotlib.pyplot as plt
def main(data_map, experiment_result):
plt.figure()
and run the code as said in the To Reproduce section of the issue.
When the PyCharm Show plots in tool window is checked, what it does is change the matplotlib backend. When this happens, the UI does not hang the second time. This is probably an issue with the default backend used (TKAgg). Since we have wxPython installed and it comes with its own renderer for some reason, I tried using the renderer and it fixes the issue (WXAgg)
Describe the bug running the queue a second time with at least one experiment that uses matplotlib in its script makes the UI freeze in the middle of the plot creation
Version of PTCS (or master commit hash) ae282291177d5d144dabceed7e808c59761ef1cd
To Reproduce Make sure an experiment exists that uses matplotlib
Expected behavior it does not hang, the queue finishes.
Screenshots N/A
Desktop (please complete the following information):
Instruments Connected (if applicable and useful to include) N/A
Additional context This does not hang when running with PyCharm, but that is because in File > Settings > Tools > Python Scientific > Show plots in tool window is checked which makes python add an entry to the pythonpath which somehow does some weird importing with matplotlib which makes it not hang. Unchecking this box removes that path variable and makes it hang